Identify

This sample demonstrates using the ArcGIS Runtime SDK for WPF to perform identify operations on local data. To use the sample, simply click anywhere in the United States to identify features. The results will be shown in the drop-down menu and DataGrid in the upper right corner of the application. View the data for different results by selecting them from the drop-down menu.

In the code-behind, a LocalMapService is started and the Url property is used to create an IdentifyTask to perform the identify operation. The tasks IdentifyParameters are specified to query the geometry of the map click and to query all the layers in the local map service, which enables the returning of results from multiple layers.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.LocalIdentify"
    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>
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
            <esri:SimpleRenderer x:Key="MySimplePolygonRenderer">
                <esri:SimpleRenderer.Symbol>
                    <esri:SimpleFillSymbol Fill="#440000FF"/>
                </esri:SimpleRenderer.Symbol>
            </esri:SimpleRenderer>
            <esri:PictureMarkerSymbol x:Key="DefaultPictureSymbol" OffsetX="35" OffsetY="35" 
                 Source="/Assets/Images/i_about.png" />
            <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" MinimumResolution="2445.98490512499" Extent="-15000000,2000000,-7000000,8000000" Background="#FFE3E3E3" MouseClick="QueryPoint_MouseClick" IsEnabled="False" >
            <esri:ArcGISLocalTiledLayer ID="BaseMap" Path="..\\Data\\TPKs\\Topographic.tpk"/>
            <esri:ArcGISLocalDynamicMapServiceLayer Path="..\\Data\\MPKS\\USCitiesStates.mpk"/>
            <esri:GraphicsLayer ID="MyGraphicsLayer" />
        </esri:Map>
        <Grid x:Name="IdentifyGrid" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,7,7,0" >
            <Rectangle Fill="{StaticResource PanelGradient}" Stroke="Gray" Margin="-5,1,-2,-6" RadiusX="10" RadiusY="10">
                <Rectangle.Effect>
                    <DropShadowEffect/>
                </Rectangle.Effect>
            </Rectangle>
            <TextBlock x:Name="DataDisplayTitleTop" Text="Click on map to identify a feature" Foreground="White" FontSize="12" 
                      Margin="2,8,8,-3" />
            <StackPanel x:Name="IdentifyResultsPanel" Orientation="Vertical" Margin="15" HorizontalAlignment="Center" 
                            VerticalAlignment="Top" Visibility="Collapsed" >
                <ComboBox x:Name="IdentifyComboBox" MinWidth="150" SelectionChanged="cb_SelectionChanged"
                         Margin="2,10,2,2" >
                </ComboBox>
                <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Auto"  
                         Width="230" MaxHeight="340">
                    <DataGrid x:Name="IdentifyDetailsDataGrid" AutoGenerateColumns="False" HeadersVisibility="None" 
                              Background="White">
                        <DataGrid.Columns>
                            <DataGridTextColumn Width="95" Binding="{Binding Path=Key}" FontWeight="Bold" IsReadOnly="True"/>
                            <DataGridTextColumn Width="115" Binding="{Binding Path=Value}" IsReadOnly="True"/>
                        </DataGrid.Columns>
                    </DataGrid>
                </ScrollViewer>
            </StackPanel>
        </Grid>
        <ProgressBar x:Name="MyProgressBar" IsIndeterminate="True" VerticalAlignment="Bottom" Width="200" Height="20" Margin="10" Visibility="{Binding Path=IsBusy, Converter={StaticResource BooleanToVisibilityConverter}}"></ProgressBar>
    </Grid>
</UserControl>
Sample code usage restrictions
5/16/2014