activate existing mapview.active after it has been superseded

234
2
Jump to solution
02-12-2018 12:08 PM
MikeRatcliffe
Occasional Contributor

Using C#, I need to activate (or bring focus to) MapView.Active that has become inactive or been superseded.  I need to ensure it's active before running operations on it in a customized interface.  Thanks.

0 Kudos
1 Solution

Accepted Solutions
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Hi Mike,

 There is an example dealing with MapViews here: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/OpenMapViews

The code snippet below finds any map view pane with a given caption and brings the first matching one to the foreground (by calling .Activate()).

var mapPanes = ProApp.Panes.OfType<IMapPane>();
foreach (Pane pane in mapPanes)
{
    if (pane.Caption == "Your map view's caption")
    {
        pane.Activate();
        break;
    }
}

View solution in original post

2 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Hi Mike,

 There is an example dealing with MapViews here: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/OpenMapViews

The code snippet below finds any map view pane with a given caption and brings the first matching one to the foreground (by calling .Activate()).

var mapPanes = ProApp.Panes.OfType<IMapPane>();
foreach (Pane pane in mapPanes)
{
    if (pane.Caption == "Your map view's caption")
    {
        pane.Activate();
        break;
    }
}
MikeRatcliffe
Occasional Contributor

Thank You.

0 Kudos