FeatureService & Popups

This sample demonstrates how to retrieve contents from a webmap on ArcGIS Online that contains feature service layer with pop-ups. Since feature service layers are represented as feature layers in the map, popup templates are applied to map tips configured on the layer. A set of attached properties on the Document class enable access to feature layer properties within a webmap. This includes popup template details provided as a data template via the PopupTemplate attached property. Attribute values of features in the feature layer can be used to populate the data template. In this sample, a feature layer represents a feature service layer on which pop-ups are configured. You can choose to show attribute data as map tips or in an info window using the PopupTemplate data template to define display.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.WebMapFeatureServicePopups"
    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" Background="White">
        <Grid.Resources>
            <LinearGradientBrush x:Key="PanelGradient" 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>
        </Grid.Resources>
        <esri:Map x:Name="MyMap" />

        <esri:InfoWindow x:Name="MyInfoWindow"
                         Padding="2"
                         CornerRadius="10"                        
                         Map="{Binding ElementName=MyMap}">
            <esri:InfoWindow.Background>
                <LinearGradientBrush EndPoint="1.038,1.136" StartPoint="0.015,0.188">
                    <GradientStop Color="#FFD1DFF2"/>
                    <GradientStop Color="#FF666666" Offset="0.946"/>
                </LinearGradientBrush>
            </esri:InfoWindow.Background>
        </esri:InfoWindow>

        <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,15,15,0" >
            <Rectangle Fill="{StaticResource PanelGradient}" Stroke="Gray"  RadiusX="10" RadiusY="10" Margin="0,0,0,5" >
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <Rectangle Fill="#FFFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,15" />
            <StackPanel Orientation="Vertical" Margin="25,20,25,25">
                <TextBlock Text="Display Attributes In:" Foreground="Black" FontWeight="Bold" FontSize="12" Margin="3" />
                <RadioButton x:Name="MapTipRB" GroupName="MyRadioButtons" Checked="MapTipRadioButton_Checked" IsChecked="True" Content="Map Tip" Margin="2" />
                <RadioButton GroupName="MyRadioButtons" Checked="InfoWindowRadioButton_Unchecked" Content="Info Window" Margin="2"/>
            </StackPanel>
        </Grid>

    </Grid>
</UserControl>

Sample code usage restrictions
5/16/2014