Dynamic Service & Popups

This sample demonstrates how to retrieve contents from a webmap on ArcGIS Online that contains a dynamic map service with pop-ups. A set of attached properties on the Document class enable access to layer properties within a webmap. This includes popup details provided as data templates via the PopupTemplates attached property. The PopupTemplates property references a dictionary of data templates, one for each layer in a dynamic map service on which a popup was configured. Attribute values of features in layers within an ArcGIS dynamic map service can be used to populate the data template. In this sample, a layer in an ArcGIS dynamic map service on which pop-ups are configured is queried upon click of the map. If the query of the layer returns attributes, the attributes of the first feature are displayed in an InfoWindow whose content template is set to the data template for the popup.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.WebMapDynamicServicePopups"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
      xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
    <Grid x:Name="LayoutRoot" >
        <esri:Map x:Name="MyMap" MouseClick="MyMap_MouseClick" />
        <esri:InfoWindow x:Name="MyInfoWindow"
                         Padding="2"
                         CornerRadius="10"                        
                         Map="{Binding ElementName=MyMap}" Foreground="Black" >
            <esri:InfoWindow.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <LinearGradientBrush.RelativeTransform>
                        <TransformGroup>
                            <ScaleTransform CenterY="0.5" CenterX="0.5"/>
                            <SkewTransform CenterY="0.5" CenterX="0.5"/>
                            <RotateTransform Angle="176" CenterY="0.5" CenterX="0.5"/>
                            <TranslateTransform/>
                        </TransformGroup>
                    </LinearGradientBrush.RelativeTransform>
                    <GradientStop Color="#FF145787" Offset="0.16"/>
                    <GradientStop Color="#FF3D7FAC" Offset="0.502"/>
                    <GradientStop Color="#FF88C5EF" Offset="0.984"/>
                </LinearGradientBrush>
            </esri:InfoWindow.Background>
        </esri:InfoWindow>
    </Grid>
</UserControl>


Sample code usage restrictions
5/16/2014