UnSelectElements Method (GraphicsLayerExtensions)
Unselect the elements within the GraphicsLayer collection.
This method must be called on the MCT. Use QueuedTask.Run.
Un-Select Graphic elements
{
await QueuedTask.Run(() =>
{
//unselect the first element in the currently selected elements
var elem = graphicsLayer.GetSelectedElements().FirstOrDefault();
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.