Changing from 1 Documentwindow to another notification

Docking/MDI for WPF Forum

Posted 11 years ago by Willie
Version: 4.5.0486
Avatar
Hi,

if i change from one documentwindow to another, i want to get notified by using an event.

How can i do this?
The WindowActivatedEvent is not usable, since this also is triggered when i hit the toolbox, and afterwards click on the same documentwindow.

So i only want to know if the in front shown documentwindow is changed.

Comments (5)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Willie,

You can probably use WindowActivated but in your handler, check to see if the window is a DocumentWindow or a ToolWindow that is in a DockingWindowState.Document state. In either of those cases, the window is in the MDI area.


Actipro Software Support

Posted 11 years ago by Willie
Avatar
If I have a certain documentwindow open on the right, and i click on the toolbox on the left and after that click back on the documentwindow on the right, the windowactivated goes off again.

Isn't there a selectionchanged or something to tell me that a different documentwindow from the mditabcontainer is pushed to the foreground?
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Willie,

I'm assuming your Toolbox is a tool window. We don't have an event that fires right now for what you describe, but that's a good idea.

Still the logic for such an event would likely follow what I last posted in this thread. So what I posted should still be valid and can be used.


Actipro Software Support

Posted 11 years ago by Willie
Avatar
You are right, it is a toolwindow.

I do need a lot of code now to find out if a user switches from 1 to another, with an event this would have been easy.
Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Willie,

We've added a concept of the "primary window" to our MDI hosts. The primary window is the currently selected window in the host. For tabbed MDI, which can have several selected windows at once, the primary document is the one that was selected/activated last. There is also an associated event that you can listen for.

We've added a QuickStart to show how this can be used. This will all be available in the next maintenance release.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.