Disable mouse events on Graphic features

Last Published: April 25, 2020


By default, user interface (UI) elements in a Silverlight application are able to report mouse events. This may inhibit the ability to interact with components that overlap, such as Graphics layers in the ArcGIS API for Microsoft Silverlight/WPF. In general, UI elements allow mouse events to be disabled by setting the IsHitTestVisible property to false. However, Graphics layers and Graphic components are not UI elements, so this property is not available. Instead, a custom control template can be used to configure the IsHitTestVisible property on the geometry of the symbol used to render the Graphic. Instructions provided describe how to disable mouse events on Graphic features.


In the XAML page, modify the existing symbol markup to define a control template. In this example, a fill symbol is used:


<esriSymbols:SimpleFillSymbol x:Name="DefaultFillSymbol" Fill="#66FF0000"
BorderBrush="Red" BorderThickness="1" >
<Path x:Name="Element"
Fill="{Binding Symbol.Fill}"
Stroke="{Binding Symbol.BorderBrush}"
StrokeThickness="{Binding Symbol.BorderThickness}"/>

The IsHitTestVisible property is set to false. Any polygon Graphic features rendered in a Graphics layer using this symbol will not respond to mouse events. This enables interaction with graphics in another layer below these polygon Graphic features.

    Article ID:000010541

    • ArcGIS API for Silverlight Prev

    Receive notifications and find solutions for new or common issues

    Get summarized answers and video solutions from our new AI chatbot.

    Download the Esri Support App

    Discover more on this topic

    Get help from ArcGIS experts

    Contact technical support

    Download the Esri Support App

    Go to download options