ArcGIS Runtime SDK for WPF - Library Reference
Geometry Property
See Also  Example
ESRI.ArcGIS.Client.Tasks Namespace > Query Class : Geometry Property

The geometry to apply to the spatial filter. The spatial relationship as specified by Query.SpatialRelationship is applied to this geometry while performing the query. The valid geometry types are: MapPoint, Polyline, Polygon, Envelope, or MultiPoint.

Syntax

Visual Basic (Declaration) 
Public Property Geometry As Geometry
C# 
public Geometry Geometry {get; set;}

Remarks

Setting the Geometry Property allows a spatial query to be applied to the QueryTask. A spatial query selects geographic features in the ArcGIS Server feature service using a valid ESRI.ArcGIS.Client.Geometry type (e.g. MapPoint, Polyline, Polygon, Envelope, or MultiPoint). The type of spatial query that selects features in the ArcGIS feature service is based upon the Query.SpatialRelationship Property. By default, the Query.SpatialRelationship Property uses the ESRI.ArcGIS.Client.Tasks.SpatialRelationship.esriRelIntersects Enumeration (e.g. the Query.Geometry that intersects or contains the geographies in the ArcGIS Server feature service are the ones returned). The following diagram provides visual examples of the various types of ESRI.ArcGIS.Client.Geometry types that can be used in the Query.Geometry Property using the default Query.SpatialRelationship enumeration of esriRelIntersects:

Query.Geometry spatial selection examples using the default Query.SpatialRelationship of esriRelIntersects.

The Geometry Property is one of the minimum Properties that must be set in order to have a valid Query object for use in a QueryTask operation. The number-of and combination-of Properties that need to be set in the Query object order to obtain valid results from a QueryTask's execution vary widely. The queries can be spatial, textual, or a combination of two. At a minimum at least one of the following Query Properties must be used in order to obtain valid results from a QueryTask:

If none of the above listed Query Properties are used, then an error message similar to the following will be returned in the QueryTask.Failed Event:

'Error code '400': 'Unable to complete operation.'
'where' parameter not specified
'objectIds' parameter not specified
'time' parameter not specified
'geometry' parameter not specified
'text' parameter not specified
'Unable to complete Query operation.

The other Properties on the Query class may also be necessary to augment the spatial or textual query to obtain the results desired. When setting multiple spatial or textual Query Property values (those listed in the bulleted list above) they act and as an 'AND' type of condition for retrieving results from the feature service. This means that only those features that meet the conditions of both these spatial/textual queries will be returned in the FeatureSet. The number of combinations that can be used to filter which data is returned is nearly limitless.

NOTE: ** Query.Text and Query.Where are the only exceptions to this rule of setting both of these Query Properties acting as an 'AND'. When these two properties are both set, the Query.Where Property take precedence and the Query.Text Property is ignored!

Setting the .Geometry Property is used to select features in the QueryTask operation. To return features from the QueryTask operation in the QueryTask.ExecuteCompleted Event or QueryTask.Execute Method that can be used to display as Graphics in the Map, you must set the Query.ReturnGeometry Property to True. NOTE: By default to improve performance by minimizing the amount of data returned to the client application, the Query.ReturnGeometry is False.

Another related Property on the Query object that is typically set when Graphic features are returned is the Query.OutSpatialReference. The .OutSpatialReference Property determines the SpatialReference of the returned Graphics. Typically, you would set the Query.OutSpatialReference to the Map.SpatialReference if you want to display those returned Graphics in the Map. NOTE: it is not always true that the features in the feature service are in the same SpatialReference as the Map control; many times the data in the feature service are re-projected on-the-fly to match the Map.SpatialReference. Setting the Query.OutSpatialRefernce to that of the Map.SpatialReference saves the client application time from having to iterate through the Graphics in the returned FeatureSet and applying a custom project using a Method like ESRI.ArcGIS.Client.Tasks.GeometryService.ProjectAsync(IEnumerable<Graphic>,SpatialReference).

Example

How to use:

Choose a Graphic type to draw from the ComboBox. Then draw a Graphic in left Map over some of the US States. A QueryTask will be executed that selects features from the States FeatureLayer and displays them in the Map on the right.

The XAML code in this example is used in conjunction with the code-behind (C# or VB.NET) to demonstrate the functionality.

The following screen shot corresponds to the code example in this page.

Using various Geometries as input for the Query.Geometry Property.

XAMLCopy Code
<Grid x:Name="LayoutRoot" Background="White">
  
  <!-- Add user defined resources for the symbology of the Graphics being drawn in the Map Controls. -->
  <Grid.Resources>
    <esri:SimpleLineSymbol x:Key="DrawLineSymbol" Color="Green" Width="4" />
    <esri:SimpleFillSymbol x:Key="DrawFillSymbol" Fill="#3300FF00" BorderBrush="Green" BorderThickness="2" />
    <esri:SimpleMarkerSymbol x:Key="DefaultMarkerSymbol" Color="Red" Size="12" Style="Circle" />
    <esri:SimpleLineSymbol x:Key="DefaultLineSymbol" Color="Red" Width="4" />
    <esri:SimpleFillSymbol x:Key="DefaultFillSymbol" Fill="#33FF0000" BorderBrush="Red" BorderThickness="2" />
    <esri:SimpleRenderer x:Key="PolygonRenderer" Symbol="{StaticResource DefaultFillSymbol}"/>
    <esri:SimpleRenderer x:Key="PolylineRenderer" Symbol="{StaticResource DefaultLineSymbol}"/>
    <esri:SimpleRenderer x:Key="PointRenderer" Symbol="{StaticResource DefaultMarkerSymbol}"/>
  </Grid.Resources>
  
  <!-- Instructions to tell the user what to do in Map1. -->
  <TextBlock Height="23" HorizontalAlignment="Left" Margin="134,122,0,0" 
   Name="TextBlock_Label1" Text="Draw Graphics on this Map:" VerticalAlignment="Top" Width="164" />
  
  <!-- Add a Map Control. -->
  <esri:Map Background="White" HorizontalAlignment="Left" Margin="134,144,0,0" Name="Map1" VerticalAlignment="Top" 
   WrapAround="True" Height="275" Width="225" Extent="-14254112,37686,-7157495,8711329">
    
    <!-- Add a backdrop ArcGISTiledMapServiceLayer. -->
    <esri:ArcGISTiledMapServiceLayer ID="PhysicalTiledLayer"
     Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
    
    <!-- Add a backdrop FeatureLayer. It will display the states outlines. -->
    <esri:FeatureLayer ID="States" 
     Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5"/>
    
    <!-- Add some GraphicsLayers to hold the user drawn Graphgics. -->
    <esri:GraphicsLayer ID="InputPolygonLayer" Renderer="{StaticResource PolygonRenderer}"/>
    <esri:GraphicsLayer ID="InputPolylineLayer" Renderer="{StaticResource PolylineRenderer}"/>
    <esri:GraphicsLayer ID="InputPointLayer" Renderer="{StaticResource PointRenderer}"/>
     
  </esri:Map>
  
  
  <!-- Instructions to tell the user what to do in Map2. -->
  <TextBlock Height="36" HorizontalAlignment="left" Margin="375,109,0,0" Name="TextBlock_Label2" TextWrapping="Wrap" Width="225"
   Text="Features returned from the QueryTask will be drawn in this Map:" VerticalAlignment="Top" />
  
  <!-- Add a Map Control. -->
  <esri:Map Background="White" HorizontalAlignment="Left" Margin="375,144,0,0" Name="Map2" 
   VerticalAlignment="Top" WrapAround="True" Height="275" Width="225" Extent="-14254112,37686,-7157495,8711329">
     
    <!-- Add a backdrop ArcGISTiledMapServiceLayer. -->
    <esri:ArcGISTiledMapServiceLayer ID="PhysicalTiledLayer"
     Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
     
    <!-- Add a GraphicsLayer to display the returned Polygon features from the QueryTask. -->
     <esri:GraphicsLayer ID="TheGraphicsLayer"/>
       
  </esri:Map>
  
  <!-- ComboBox for the user specifying which type of Graphic to draw. -->
  <TextBlock Height="23" HorizontalAlignment="Left" Margin="0,122,0,0" Name="TextBlock_Label3" 
   Text="Pick a Graphic Type:" VerticalAlignment="Top" />
  <ComboBox x:Name="ComboBox_GraphicMode" Height="28" HorizontalAlignment="Left" Margin="0,144,0,0" VerticalAlignment="Top" 
   Width="120" SelectionChanged="Mode_SelectionChanged"/>
  
  <!-- Provide the instructions on how to use the sample code. -->
  <TextBlock Height="102" HorizontalAlignment="Left" Name="TextBlock1" VerticalAlignment="Top" Width="600" TextWrapping="Wrap"
   Text="Choose a Graphic type to draw from the ComboBox. Then draw a Graphic in left Map over some of the US 
   States. A QueryTask will be executed that selects features from the States FeatureLayer and displays 
   them in the Map on the right." />
  
</Grid>
C#Copy Code
// Member (i.e. Global) variable used for user drawn Graphics in the left Map (i.e. Map1). 
private ESRI.ArcGIS.Client.Draw _Draw;
            
public MainPage()
{
  
  InitializeComponent();
  
  // Populate the ComboBox with the various types of Graphics that can be drawn in Map1. 
  ComboBox_GraphicMode.ItemsSource = new ESRI.ArcGIS.Client.DrawMode[] { ESRI.ArcGIS.Client.DrawMode.None, ESRI.ArcGIS.Client.DrawMode.Point, ESRI.ArcGIS.Client.DrawMode.Polyline, ESRI.ArcGIS.Client.DrawMode.Polygon };
  
  // Instantiate the Draw object as new. Set the .Map, .LineSymbol, and .FillSymbol Properties to those specified
  // in XAML.
  _Draw = new ESRI.ArcGIS.Client.Draw();
  _Draw.Map = Map1;
  _Draw.LineSymbol = LayoutRoot.Resources["DrawLineSymbol"] as ESRI.ArcGIS.Client.Symbols.LineSymbol;
  _Draw.FillSymbol = LayoutRoot.Resources["DrawFillSymbol"] as ESRI.ArcGIS.Client.Symbols.FillSymbol;
  
  // Wire up an event handler for when the user is done adding a user drawn graphic to Map1.
  _Draw.DrawComplete += _Draw_DrawComplete;
  
  // Set the starting item in the ComboxBox to the first one.
  ComboBox_GraphicMode.SelectedIndex = 0;
}
            
private void _Draw_DrawComplete(object sender, ESRI.ArcGIS.Client.DrawEventArgs e)
{
  // The user has completed drawing a Graphic in Map1 using the Draw tool. The process of drawing Graphics
  // can be done several times as the individual Graphics are just added to the existing GraphicsLayers.
  
  // There are two parts to this function: 
  // Part1: Take the user drawn graphic from the Draw Tool and add it to one of the GraphicsLayers (defined in
  // XAML) to Map1.
  // Part2: Use the Geometry from the user drawn graphic to execute a QueryTask to return features from the 
  // State FeatureLayer to draw them in Map2.
  
  //--- PART 1: ---
  
  // Get the DrawEventArgs. 
  ESRI.ArcGIS.Client.DrawEventArgs theEventArgs = e;
  
  // Get the type of Geometry from the DrawEventArgs that the user drew in Map1. 
  ESRI.ArcGIS.Client.Geometry.Geometry theUserDrawnGeometry = theEventArgs.Geometry;
  
  // Create a generic GraphicsLayer to hold the user drawn Graphics.
  ESRI.ArcGIS.Client.GraphicsLayer theGraphicsLayer1 = null;
  
  // Branch based upon the type of Geometry being processed. Cast one of the existing GraphicsLayers
  // in Map1 to the generic GraphicsLayer. We do this so we can draw the correct symbology.
  if (theUserDrawnGeometry is ESRI.ArcGIS.Client.Geometry.MapPoint)
  {
    theGraphicsLayer1 = Map1.Layers["InputPointLayer"] as ESRI.ArcGIS.Client.GraphicsLayer;
  }
    else if (theUserDrawnGeometry is ESRI.ArcGIS.Client.Geometry.Polyline)
  {
    theGraphicsLayer1 = Map1.Layers["InputPolylineLayer"] as ESRI.ArcGIS.Client.GraphicsLayer;
  }
    else if (theUserDrawnGeometry is ESRI.ArcGIS.Client.Geometry.Polygon)
  {
    theGraphicsLayer1 = Map1.Layers["InputPolygonLayer"] as ESRI.ArcGIS.Client.GraphicsLayer;
  }
  
  // Add the user drawn Graphic to the generic GraphicsLayer (it will display in Map1).
  theGraphicsLayer1.Graphics.Add(new ESRI.ArcGIS.Client.Graphic() { Geometry = theUserDrawnGeometry });
  
  
  //--- PART 2: ---
  
  // Create a new QueryTask object. Set the Url to be a sample public FeatureLayer.
  ESRI.ArcGIS.Client.Tasks.QueryTask myQueryTask = new ESRI.ArcGIS.Client.Tasks.QueryTask();
  myQueryTask.Url = ("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5");
  
  // Wire up the event handler for when the QueryTask completes.
  myQueryTask.ExecuteCompleted += myQueryTask_ExecuteCompleted;
  
  // Create a new Query object.
  ESRI.ArcGIS.Client.Tasks.Query myQuery = new ESRI.ArcGIS.Client.Tasks.Query();
  
  // Set the Query.Geometry to be that of the user draw graphic in Map1.
  myQuery.Geometry = theUserDrawnGeometry;
  
  // Return the Geometry to the QueryTask.ExecuteCompleted Event so that new Graphics can be drawn on Map2.
  myQuery.ReturnGeometry = true;
  
  // Set the SpatialReference of the returned features from the QueryTask to be that of Map2. 
  // NOTE: You could experiment by changing the base ArcGISTiledMapServiceLayer to be in a different
  // SpatialReference and thus altering the Map2 SpatialReference. Then you will see the returned 
  // FeatureSet Graphics in a different projection than from Map1.
  myQuery.OutSpatialReference = Map2.SpatialReference;
  
  // Execute the QueryTask. 
  myQueryTask.ExecuteAsync(myQuery);
}
            
private void myQueryTask_ExecuteCompleted(object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs e)
{
  // Get the returned FeatureSet from the QueryTask.
  ESRI.ArcGIS.Client.Tasks.FeatureSet myFeatureSet = e.FeatureSet;
  
  // Get the GraphicsLayer that was defined in XAML for Map2.
  ESRI.ArcGIS.Client.GraphicsLayer myGraphicsLayer = (ESRI.ArcGIS.Client.GraphicsLayer) Map2.Layers["TheGraphicsLayer"];
  
  // Create a SimpleFillSymbol to draw the graphics in Map2.
  ESRI.ArcGIS.Client.Symbols.SimpleFillSymbol mySimpleFillSymbol = new ESRI.ArcGIS.Client.Symbols.SimpleFillSymbol();
  System.Windows.Media.SolidColorBrush mySolidColorBrush = new System.Windows.Media.SolidColorBrush(Colors.Yellow);
  mySolidColorBrush.Opacity = 0.5;
  mySimpleFillSymbol.Fill = mySolidColorBrush;
  
  // Ensure the we have a FeatureSet with data.
  if (myFeatureSet != null && myFeatureSet.Features.Count > 0)
  {
    // Iterate over each feature (which is a Graphic object) in the FeatureSet.
    foreach (ESRI.ArcGIS.Client.Graphic graphicFeature in myFeatureSet.Features)
    {
      // The Graphic returned has valid Polygon Geometry values for the States. 
      if (graphicFeature.Geometry is ESRI.ArcGIS.Client.Geometry.Polygon)
      {
        // Attach the custom solid fill symbol to the Graphic.
        graphicFeature.Symbol = mySimpleFillSymbol as ESRI.ArcGIS.Client.Symbols.Symbol;
        
        // Add the Graphic to the GraphicsLayer in Map2.
        myGraphicsLayer.Graphics.Add(graphicFeature);
      }
    }
  }
}
            
private void Mode_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
  // This function executes when the user changes the ComboBox choice to select a different type of
  // Graphic to draw.
  
  if (e.AddedItems == null || e.AddedItems.Count == 0)
  {
    // No change or invalid choice made.
    return;
  }
  
  // Enable the Draw object to accept user input for the particular Graphic type to be drawn.
  _Draw.DrawMode = (ESRI.ArcGIS.Client.DrawMode)(e.AddedItems[0]);
  _Draw.IsEnabled = _Draw.DrawMode != ESRI.ArcGIS.Client.DrawMode.None;
}
VB.NETCopy Code
' Member (i.e. Global) variable used for user drawn Graphics in the left Map (i.e. Map1). 
Private _Draw As ESRI.ArcGIS.Client.Draw
            
Public Sub New()
  
  InitializeComponent()
  
  ' Populate the ComboBox with the various types of Graphics that can be drawn in Map1. 
  ComboBox_GraphicMode.ItemsSource = New ESRI.ArcGIS.Client.DrawMode() {ESRI.ArcGIS.Client.DrawMode.None,
                                                                        ESRI.ArcGIS.Client.DrawMode.Point,
                                                                        ESRI.ArcGIS.Client.DrawMode.Polyline,
                                                                        ESRI.ArcGIS.Client.DrawMode.Polygon}
  
  ' Instantiate the Draw object as new. Set the .Map, .LineSymbol, and .FillSymbol Properties to those specified
  ' in XAML.
  _Draw = New ESRI.ArcGIS.Client.Draw()
  _Draw.Map = Map1
  _Draw.LineSymbol = TryCast(LayoutRoot.Resources("DrawLineSymbol"), ESRI.ArcGIS.Client.Symbols.LineSymbol)
  _Draw.FillSymbol = TryCast(LayoutRoot.Resources("DrawFillSymbol"), ESRI.ArcGIS.Client.Symbols.FillSymbol)
  
  ' Wire up an event handler for when the user is done adding a user drawn graphic to Map1.
  AddHandler _Draw.DrawComplete, AddressOf _Draw_DrawComplete
  
  ' Set the starting item in the ComboxBox to the first one.
  ComboBox_GraphicMode.SelectedIndex = 0
  
End Sub
            
Private Sub _Draw_DrawComplete(sender As Object, e As ESRI.ArcGIS.Client.DrawEventArgs)
  
  ' The user has completed drawing a Graphic in Map1 using the Draw tool. The process of drawing Graphics
  ' can be done several times as the individual Graphics are just added to the existing GraphicsLayers.
  
  ' There are two parts to this function: 
  ' Part1: Take the user drawn graphic from the Draw Tool and add it to one of the GraphicsLayers (defined in
  ' XAML) to Map1.
  ' Part2: Use the Geometry from the user drawn graphic to execute a QueryTask to return features from the 
  ' State FeatureLayer to draw them in Map2.
  
  '--- PART 1: ---
  
  ' Get the DrawEventArgs. 
  Dim theEventArgs As ESRI.ArcGIS.Client.DrawEventArgs = e
  
  ' Get the type of Geometry from the DrawEventArgs that the user drew in Map1. 
  Dim theUserDrawnGeometry As ESRI.ArcGIS.Client.Geometry.Geometry = theEventArgs.Geometry
  
  ' Create a generic GraphicsLayer to hold the user drawn Graphics.
  Dim theGraphicsLayer1 As ESRI.ArcGIS.Client.GraphicsLayer = Nothing
  
  ' Branch based upon the type of Geometry being processed. Cast one of the existing GraphicsLayers
  ' in Map1 to the generic GraphicsLayer. We do this so we can draw the correct symbology.
  If TypeOf theUserDrawnGeometry Is ESRI.ArcGIS.Client.Geometry.MapPoint Then
    theGraphicsLayer1 = TryCast(Map1.Layers("InputPointLayer"), ESRI.ArcGIS.Client.GraphicsLayer)
  ElseIf TypeOf theUserDrawnGeometry Is ESRI.ArcGIS.Client.Geometry.Polyline Then
    theGraphicsLayer1 = TryCast(Map1.Layers("InputPolylineLayer"), ESRI.ArcGIS.Client.GraphicsLayer)
  ElseIf TypeOf theUserDrawnGeometry Is ESRI.ArcGIS.Client.Geometry.Polygon Then
    theGraphicsLayer1 = TryCast(Map1.Layers("InputPolygonLayer"), ESRI.ArcGIS.Client.GraphicsLayer)
  End If
  
  ' Add the user drawn Graphic to the generic GraphicsLayer (it will display in Map1).
  theGraphicsLayer1.Graphics.Add(New ESRI.ArcGIS.Client.Graphic() With {.Geometry = theUserDrawnGeometry})
  
            
  '--- PART 2: ---
  
  ' Create a new QueryTask object. Set the Url to be a sample public FeatureLayer.
  Dim myQueryTask As ESRI.ArcGIS.Client.Tasks.QueryTask = New ESRI.ArcGIS.Client.Tasks.QueryTask
  myQueryTask.Url = ("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5")
  
  ' Wire up the event handler for when the QueryTask completes.
  AddHandler myQueryTask.ExecuteCompleted, AddressOf myQueryTask_ExecuteCompleted
  
  ' Create a new Query object.
  Dim myQuery As ESRI.ArcGIS.Client.Tasks.Query = New ESRI.ArcGIS.Client.Tasks.Query
  
  ' Set the Query.Geometry to be that of the user draw graphic in Map1.
  myQuery.Geometry = theUserDrawnGeometry
  
  ' Return the Geometry to the QueryTask.ExecuteCompleted Event so that new Graphics can be drawn on Map2.
  myQuery.ReturnGeometry = True
  
  ' Set the SpatialReference of the returned features from the QueryTask to be that of Map2. 
  ' NOTE: You could experiment by changing the base ArcGISTiledMapServiceLayer to be in a different
  ' SpatialReference and thus altering the Map2 SpatialReference. Then you will see the returned 
  ' FeatureSet Graphics in a different projection than from Map1.
  myQuery.OutSpatialReference = Map2.SpatialReference
  
  ' Execute the QueryTask. 
  myQueryTask.ExecuteAsync(myQuery)
  
End Sub
            
Private Sub myQueryTask_ExecuteCompleted(sender As Object, e As ESRI.ArcGIS.Client.Tasks.QueryEventArgs)
  
  ' Get the returned FeatureSet from the QueryTask.
  Dim myFeatureSet As ESRI.ArcGIS.Client.Tasks.FeatureSet = e.FeatureSet
  
  ' Get the GraphicsLayer that was defined in XAML for Map2.
  Dim myGraphicsLayer As ESRI.ArcGIS.Client.GraphicsLayer = Map2.Layers("TheGraphicsLayer")
   
  ' Create a SimpleFillSymbol to draw the graphics in Map2.
  Dim mySimpleFillSymbol As New ESRI.ArcGIS.Client.Symbols.SimpleFillSymbol
  Dim mySolidColorBrush As New System.Windows.Media.SolidColorBrush(Colors.Yellow)
  mySolidColorBrush.Opacity = 0.5
  mySimpleFillSymbol.Fill = mySolidColorBrush
  
  ' Ensure the we have a FeatureSet with data.
  If myFeatureSet IsNot Nothing AndAlso myFeatureSet.Features.Count > 0 Then
    
    ' Iterate over each feature (which is a Graphic object) in the FeatureSet.
    For Each graphicFeature As ESRI.ArcGIS.Client.Graphic In myFeatureSet.Features
      
      ' The Graphic returned has valid Polygon Geometry values for the States. 
      If TypeOf graphicFeature.Geometry Is ESRI.ArcGIS.Client.Geometry.Polygon Then
        
        ' Attach the custom solid fill symbol to the Graphic.
        graphicFeature.Symbol = TryCast(mySimpleFillSymbol, ESRI.ArcGIS.Client.Symbols.Symbol)
        
        ' Add the Graphic to the GraphicsLayer in Map2.
        myGraphicsLayer.Graphics.Add(graphicFeature)
        
      End If
      
    Next graphicFeature
    
  End If
  
End Sub
            
Private Sub Mode_SelectionChanged(ByVal sender As Object, ByVal e As SelectionChangedEventArgs)
  
  ' This function executes when the user changes the ComboBox choice to select a different type of
  ' Graphic to draw.
  
  If e.AddedItems Is Nothing OrElse e.AddedItems.Count = 0 Then
    ' No change or invalid choice made.
    Return
  End If
  
  ' Enable the Draw object to accept user input for the particular Graphic type to be drawn.
  _Draw.DrawMode = CType(e.AddedItems(0), ESRI.ArcGIS.Client.DrawMode)
  _Draw.IsEnabled = _Draw.DrawMode <> ESRI.ArcGIS.Client.DrawMode.None
  
End Sub

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8

See Also

© ESRI, Inc. All Rights Reserved.