How to insert one WPF form into another?

I would like to have a basic WPF form with a tab control, where each tab contains one independent WPF form. These forms are independent of each other, so I thought it would be easier to develop each of them separately, and then just embed them in the main form.

The number of forms is known, so there is no need for a dynamic plug-in system.

+4
source share
4 answers

Check out this MSDN article by Josh Smith. This is a great solution for your question.

WPF Applications with Model-View-ViewModel Design Pattern

http://msdn.microsoft.com/en-us/magazine/dd419663.aspx

+2
source

When you use Frame or NavigationWindow you can load different xaml Pages and even html. You can also make it act like a browser with forward and reverse navigation. See http://msdn.microsoft.com/en-us/library/ms750478.aspx

You can place a frame on each tab and upload it to a specific page.

<Window x:Class="PluginApplication.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <DockPanel> <Frame Name="frame" NavigationUIVisibility="Visible" Source="SomePage.xaml" /> </DockPanel> </Window> <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" WindowTitle="Page Title" WindowWidth="500" WindowHeight="200"> Hello world </Page> 
+7
source

Create child forms from UserControl, in the main form add a tab control with one of these controls inside each tab.

+4
source

I prefer to do this with userControl First create a user control enter image description here

after, include this user’s link in another location enter image description here

anywhere frmHome ...

  <DockPanel> <Entity:ucContactList/> </DockPanel> 
+1
source

All Articles