Public Shared Sub ClearSelection( _ ByVal graphicsLayer As GraphicsLayer _ )
public static void ClearSelection( GraphicsLayer graphicsLayer )
Parameters
- graphicsLayer
Public Shared Sub ClearSelection( _ ByVal graphicsLayer As GraphicsLayer _ )
public static void ClearSelection( GraphicsLayer graphicsLayer )
| Exception | Description |
|---|---|
| ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
{
//unselect the first element in the currently selected elements
var elem = graphicsLayer.GetSelectedElements().FirstOrDefault();
// Note: must be called on the QueuedTask
{
if (elem != null)
//Unselect one element
graphicsLayer.UnSelectElement(elem);
//unselect all elements
graphicsLayer.UnSelectElements();
//equivalent to
graphicsLayer.ClearSelection();
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)