Public ReadOnly Property Elements As IElement()
public IElement[] Elements {get;}
Public ReadOnly Property Elements As IElement()
public IElement[] Elements {get;}
{
ArcGIS.Desktop.Layouts.Events.ElementEvent.Subscribe((args) =>
{
//check if the container is a graphics layer - could be a Layout (or even map view)
if (args.Container is ArcGIS.Desktop.Mapping.GraphicsLayer graphicsLayer)
{
//get the total selection count for the container
var count = args.Elements.Count();
//Check count - could have been an unselect or clearselect
if (count > 0)
{
//this is a selection or add to selection
var elems = graphicsLayer.GetSelectedElements();
//TODO process the selection...
}
else
{
//This is an unselect or clear selection
//TODO process the unselect or clear select
}
}
});
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)