tags:

views:

1017

answers:

4

Is there a way to host a WPF window inside another WPF window. I have a couple of somewhat complex forms in place. But now to simplify things I am trying to merge a few of them as tabpages inside one 'Dashboard' form.

Please note that I am not trying to host a Windows Form, but another WPF window

A: 

Can I answer this question with another question; why would you not create them as controls rather than other WPF windows, that you want to host in the main WPF window?

Sebastian Gray
I guess that's because he wants to take advantage of the default window behavior (title bar to move it, close/min/max buttons...)
Thomas Levesque
Not really Thomas. I don't care about having any of those things. Is it possible to convert an existing Window into a User Control? What I'm really trying to do is to save time and use existing Windows which are already running (and have been tested in production) within a new "Main" Window. Each of the existing Window will just become a tab within this "Main" window instead of being a separate window.
dtmunir
+3  A: 

If you want tabpages, why not use a TabControl with UserControls inside ? If you need to transform one of these tabs to a floating window, just put the UserControl in a new Window...

Thomas Levesque
I am already using a TabControl. But instead of hosting a UserControl, I'd like to host an already existing Window. Is that possible?
dtmunir
no it's not... you have to change your window to a UserControl
Thomas Levesque
A: 

I think what you're asking for is MDI, Multiple Document Interface. Something like this might help.

Do note, however, that the MDI paradigm is largely shunned these days. There are usually better ways to achieve the same functionality.

HTH, Kent

Kent Boogaart
Cool... however the chrome for the child windows is quite ugly ;)
Thomas Levesque
MDI is sooo 1995 ;)
Thorsten79
A: 

I think you want to hosting contents of WPF Window1.xaml (page1.xaml) inside within another WPF Window.

Well...you can use Navigation. Instead running window1.xaml contents inside tab then you can work with your data inside Navigation. Navigation can run within WPF Window Application. You just design your form / UI in page1.xaml.

one another..MDI old and rusty. We want clear of top window nowadays.

BoboSurabaya