Identify Online

This sample demonstrates performing identify operations. 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, an IdentifyTask is to perform the identify operation. The tasks IdentifyParameters specify to query the geometry of the map click andIto query all the layers in the target map service, which enables the returning of results from multiple layers.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.Identify"
    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>
            <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" WrapAround="True" Background="White" Extent="-15000000,2000000,-7000000,8000000" MouseClick="QueryPoint_MouseClick" >
            <esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" 
                      Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
            <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>

    </Grid>
</UserControl>
Sample code usage restrictions
5/16/2014