BringForward(GraphicsLayer,Element) Method
Bring the element forward within its parent's element collection.
This method must be called on the MCT. Use QueuedTask.Run.
Ordering: Send backward and Bring forward
//On the QueuedTask
//get the current selection set
var sel_elems = graphicsLayer.GetSelectedElements();
//can they be brought forward? This will also check that all elements have the same parent
if (graphicsLayer.CanBringForward(sel_elems))
{
//bring forward
graphicsLayer.BringForward(sel_elems);
//bring to front (of parent)
//graphicsLayer.BringToFront(sel_elems);
}
else if (graphicsLayer.CanSendBackward(sel_elems))
{
//send back
graphicsLayer.SendBackward(sel_elems);
//send to the back (of parent)
//graphicsLayer.SendToBack(sel_elems);
}
Ordering: Send backward and Bring forward
//On the QueuedTask
//get the current selection set
var sel_elems = graphicsLayer.GetSelectedElements();
//can they be brought forward? This will also check that all elements have the same parent
if (graphicsLayer.CanBringForward(sel_elems))
{
//bring forward
graphicsLayer.BringForward(sel_elems);
//bring to front (of parent)
//graphicsLayer.BringToFront(sel_elems);
}
else if (graphicsLayer.CanSendBackward(sel_elems))
{
//send back
graphicsLayer.SendBackward(sel_elems);
//send to the back (of parent)
//graphicsLayer.SendToBack(sel_elems);
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.