Open existing WPF windows as DocumentWindow in the standard MDI interface programmatically

Docking/MDI for WPF Forum

Posted 7 years ago by Sergey Stepanov
Version: 12.2.0573
Avatar

How to open existing WPF windows as DocumentWindows in the standard MDI interface programmatically? In a QuickStart Samples "Custom Docking Windows" it is made in XAML, but not shown how to do it programmatically. Please, give an example of the method "var doc = new DocumentWindow (...)" to open an existing WPF window (file XAML in application). Thanks.

Comments (4)

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Sergey,

The WPF Window class is intended to be used as a top-level window and not a child control within another Window.  I would recomment that you instead put your window's content in a UserControl and add that as the child of your DocumentWindow.


Actipro Software Support

Posted 7 years ago by Sergey Stepanov
Avatar

Thanks!

Is it possible to programmatically put WPF window's content in a UserControl and add that as the child of DocumentWindow?

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

Hi Sergey,

If you remove the Content from the Window and then put it as the DocumentWindow's Content, that might work.  Both are ContentControls.


Actipro Software Support

Posted 7 years ago by Sergey Stepanov
Avatar

Thanks, will try.

The latest build of this product (v2019.1 build 0683) 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.