Create dynamic dockable window in WPF - wpf

I have created an application which has one window. Click of a button in this window should open another dockable window. Is there a simple way to do this? I found a CodeProject which does this, but this seems a lot of functionality for me.
http://www.codeproject.com/Articles/140209/Building-a-Docking-Window-Management-Solution-in-W

Are you looking for something like AvalonDock ?
Here's the NuGet: http://www.nuget.org/packages/AvalonDock/

Related

WPF & MVVM: Visual Studio like interface

I would like to create an application using WPF and MVVM Light but i don't know how to organize my application layout for a MVVM application. The idea is to have something similar to Visual Studio:
A main Window with tabs, toolbox and menu that can be docked and moved to different locations. I had been able to easily create this layout using Telerik WPF controls and their sample but all in a simple XAML file with it's code behind, I have no idea how to transform it into a MVVM application.
I would like each pane/window/toolbox to be a different view with its own View Model. I checked tutorials but I didn't find how to have one single application displaying simultaneously multiple views/viewmodels in the same "main window".
Have I do define each view in a specific user control? Have I to use ContentControl to organize my layout? Should I use data template? How to handle binding on multiple view/viewmodels within the same window ?
Thanks a lot for your help!
Doots
look at using http://avalondock.codeplex.com to get a layout like visual studio. Then you could put usercontrols in the LayoutPanes for your views, and have those binded to your viewmodels.
Thanks for your replies! Now i understand, I think I was searching way too far and made it more complex than it should...
Avalon seems a very nice solution, but I have a Telerik licence then I will go for it. If anybody is having the same issue, just take a look at this answer from Laurent Bugnon: http://mvvmlight.codeplex.com/discussions/252035
Thx

Modal Dialog in WPF

Here is my problem: I am migrating an application from Windows Forms to WPF, but I am totally new in WPF technology.
I have been lucky creating a ribbon also have been able to add some elements to it, but right now I am struggling to create a modal dialog.
How can I achieve this? I have already created all the design of the dialog, but I cannot get it open as a modal window.
Besides, since this application has to be developed under MVVM pattern, where could I place that code? According to what I've read, that code has to be place in the view class, am I right?.
Thank you in advance.
You show a WPF Window modally using Window.ShowDialog. Also this WPF Window Overview will help.
Besides, since this application has to be developed under MVVM
pattern, where could I place that code?
Look under the Related questions to your right, there are many answers to this question in there. For example:
Open dialog in WPF MVVM

Custom Design Close /Minimize button on WPF Form?

Is there anyway I can create a Windows WPF form with custom design of the Close, Minimize, Maximize Button?
Thank you
It'll require pretty much code but you might want to have a look at GlassWindow in FluidKit at CodePlex: http://fluidkit.codeplex.com/
The source code has a custom Window Style looking like this. I've used it once and it works good
Yes you can.

How to set Win32 window as owner of WPF window?

I want to use WPF windows in a legacy win32 application.
I'd like to behave them in a similar way, like the WPF window always being displayed on top of the win32 window.
For this I'd like to set the owner of the WPF window to the win32 windows, but I got no idea how to achieve this.
Any help here?
Since the answer is hidden behind some link, here the code that did the trick:
System::Windows::Interop::WindowInteropHelper^ helper = gcnew System::Windows::Interop::WindowInteropHelper(myWpfChildWindow);
helper->Owner = (System::IntPtr)myMainWindowHWND;
This article shows how to get the handles for both as well as how to make the WPF window become a transparent overlay for the win32 window.
http://dedjo.blogspot.com/2007/04/transparent-wpf-control-over-unmanaged.html
This article uses a WindowInteropHelper to accomplish similar functionality.
http://blogs.msdn.com/wpfsdk/archive/2007/04/03/centering-wpf-windows-with-wpf-and-non-wpf-owner-windows.aspx
MSDN page on WindowInteropHelper:
http://msdn.microsoft.com/en-us/library/system.windows.interop.windowinterophelper.aspx
Hope that helps,
Ed
How about SetParent()? I know works when making a WPF window an MDI Child of a Windows Form.

Have a wpf window inside another wpf window

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
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...
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?
a bit late on this, but I guess with WindowsForms interop you can put in WPF a WinForms control host and in that host put a WinForms control that hosts the handle of a WPF window
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.
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.

Resources