How to Find active Tab in Tabbed MDI

Docking/MDI for WPF Forum

Posted 15 years ago by United Biosource - United Biosource
Version: 4.5.0486
Avatar
I want my Tabbed MDI page to register command bindings to the common windows commands (Save, Edit, etc.) and then call a command on a control in an MDI Container as appropriate, but I don't see how to get a reference to the Active window within the MdiContainer. MainDockSite.ActiveWindow doesn't restrict possible windows to only those in the MDI container. How can I do this?

Thanks.

Comments (4)

Posted 15 years ago by United Biosource - United Biosource
Avatar
Found it, I think:

var window = MyMdiContainer.SelectedWindow.Content;

or just

var window = MyMdiContainer.SelectedWindow;

if you only wanted the tab window rather than the control inside it
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sydney,

Never track container instances since they are transient and are created/destroyed at run-time as needed.

Instead use DockSite.LastActiveDocument. That should give what you wanted.


Actipro Software Support

Posted 15 years ago by United Biosource - United Biosource
Avatar
Will this work even if

a) a user has clicked on one of the Toolbars in the DockSite that is not in the Workspace
b) I don't have any Documents in my workspace, just tool windows
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes it should. The term "document" means any document window or tool window in the MDI area.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.