activate existing mapview.active after it has been superseded

142
2
Jump to solution
02-12-2018 12:08 PM
Highlighted
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.

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
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
Highlighted
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

Highlighted
Occasional Contributor

Thank You.

Reply
0 Kudos