Select to view content in your preferred language

Automatically update infowindow content

2761
1
10-19-2012 04:43 AM
Labels (1)
ae
by
Frequent Contributor
Hi,

I have an application where I open InfoWindows when I click on graphics in the map. Within the contenttemplate of the infowindow I show information about the graphic by binding to its attributes. In general this works fine, but if an attribute of a graphic is updated while the infowindow for this graphic is open, then the value shown in the infowindow is not updated until I close the infowindow and open it again. Is it somehow possible to update the attributes shown in the infowindow automatically (like it would if I bind to a property), without having to close and reopen the infowindow?

Alternatively, is it possible to bind to properties within the contenttemplate of an infowindow?

Cheers
0 Kudos
1 Reply
AnttiKajanus1
Deactivated User
I think attributes should be updated automatically via bindings on the InfoWindows.

In Samples / toolkit controls / controls / InfoWindow is defined like this


<esri:InfoWindow x:Name="MyInfoWindow"                         Padding="2"                         CornerRadius="20"                                                   Background="{StaticResource PanelGradient}"                         Map="{Binding ElementName=MyMap}"                          ContentTemplate="{StaticResource MyFeatureLayerInfoWindowTemplate}"                         MouseLeftButtonUp="MyInfoWindow_MouseLeftButtonUp" />


and content template uses binding to "STATE_NAME" attribute. Note the [] marks that enables you to access the attribute by its name in the binding.

 <DataTemplate x:Key="MyFeatureLayerInfoWindowTemplate">
                <TextBlock Text="{Binding [STATE_NAME]}" Foreground="White" FontSize="12" /> 
            </DataTemplate>


Hope this helps.
0 Kudos