UnSelectElement Method (GraphicsLayerExtensions)
Unselect the element within the GraphicsLayer collection.
This method must be called on the MCT. Use QueuedTask.Run.
Un-Select Graphic elements
{
//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)
ArcGIS Pro version: 3.0 or higher.