tags:

views:

363

answers:

3

Hi, I am having multiple windows( .xaml files). I want to dock one window in other.

Say, I am having a ParentWindow.xaml. On a button click in ParentWindow I open ChildWindow.xaml. After opening ChildWindow.xaml, I have to dock it in the ParentWindow.xaml.

How to implement this?

+2  A: 

have a look at this library: http://www.codeproject.com/KB/WPF/WPFdockinglib.aspx

Tony
A: 

I think what you are looking for is an MDI interface. This is not possible in WPF : children of a window cannot be windows, they can only be controls.

Instead, you could change your ChildWindow to be a UserControl and display it in a TabControl. Most modern UI now use tabs rather than MDI...

Thomas Levesque
A: 

Do you wanna docking just like widget in your MainWindow or wanna dock its contents in MainWindow UIElement?

Lets try this in mainwindow.xaml.vb:

Dim NewMyWinChild As Window2 = New Window2()
Dim TheMyContent As Object = NewMyWinChild.Content
GridNameOfMyUIElemnt.Children.Add(TheMyContent)

This will Add the content of Window2 to GridNameOfMyUIElemnt-mainwindow.xaml on Runtime.

I think if you want widget then you can set "Z-panel index" properties.

MDI, yes it can, just googling but it old.

(It works fine with me in VB 2005 express with .Net 3.0)

Bobo