Question

I was wondering if this is possible? It seems like a WPF application must have one and only one MainWindow, which is the window for the application. If I create other windows and show them, will they show up as separate items in the taskbar like MS Word?

Was it helpful?

Solution 5

Seems like I was overthinking this. All I needed to do was create the child window and call Window.Show().

Of course, any "MDI"-ness won't be baked in and will need to be managed manually, using this solution.

OTHER TIPS

Perhaps something as simple as this:

// http://stackoverflow.com/questions/6417558/wpf-and-showdialog

Window window = new Window()
{
    Title = "Modal Dialog",
    ShowInTaskbar = true,                // show the dialog on the taskbar
    Topmost = true,                      // ensure we're Always On Top
    ResizeMode = ResizeMode.NoResize     // remove excess caption bar buttons
};

window.ShowDialog(Application.Current.MainWindow);

WPF suggests to use non-MDI interface because the parent window only holds the WinHandle (unlike each MDI children in Winforms have separate WinHandles of their own).

If you are planning to build this up from scartch then it would be a little complicated and a big project for you... I suggest you to use various Dockmanagers available on the net such as Infragistics \ Avalon Dock \ WPF Docking Library (CodeProject) etc.

These can work similar to the MDI windows in WinForms (i.e. it can contain child windows in a parent space and also can tab them when arranged and docked something like a Visual Studio)

I have a WPF app that I'm working on right now that has two windows. There are two items in the Task Bar when the app is running, so yes, this is definitely possible.

I think you are refering to MDI.

Please read this article

Also (now knowing this is about MDI) this question

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top