I'm creating a dockable window add-in that requires the Active View to be the Data View.
I would like to disable my window when the user enters Layout View, but I've been unable to find an event that is triggered when the View changes.
I've attempted to us the "ActiveViewEvents" but none of them go off when switching views. And I know I can check if I'm in Layout view via:
IMxDocument doc = ArcMap.Document as IMxDocument;
if (doc.ActiveView is IPageLayout){/*disable window*/}
else {/*enable window*/}
but I'm at a loss on where to put this sort of check.
What event can I utilize to check when the users changes the View?
I want this event to be fired any time the user changes the view, and I do not want to put this check on every control.
Enabled = False
if the map is in Layout View. This will disable the button. And if the dockable window is already open you can put whatever code you want to disable the window functionality in there as well, for exampledockableWindow.Show(False)
.