No ViewActivated event fires when activating a Viewport
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The title is about all this post needs. It appears that activating a Viewport on a sheet does not fire the ViewActivated event. Testing this behavior is also as simple as it gets - I subscribe to the ViewActivated event, and it reliably fires when a view, a schedule, a legend, or a sheet is activated, but not when a viewport on a sheet is activated.
The result is that code which relies on the ViewActivated event to run some behavior must be run manually when a Viewport is activated, or contrive some other workaround. In my case, this is a modeless form which displays a truncated table of View Filters and overrides in the active view. When the user switches views, the form updates the list of filters and overrides automatically. But the automatic updating won't work when activating a viewport. So I have to expose a "refresh" button when a manual refresh is needed, (querying the UIDocument.ActiveGraphicalView in such a state does indeed return the active viewport's view as expected), or would have to run something on every Idling event, or run a background monitoring thread - out of these options, I like the manual refresh the best.