I have an assignment where I have to show two instances of the same class in two different windows within same WPF window. Is there any ways to achieve this? I am very new to WPF so its bit tough to handle. How to design the GUI part, which panel to use and how to assign the class to respective windwow in code-behind.
I have tried with DockPanel, code is below
<Window x:Class="Layout"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="Layout" Height="450" Width="800">
<Grid x:Name="grd_main">
<DockPanel x:Name="dockpanel1" HorizontalAlignment="Left" Height="194" LastChildFill="False" Margin="10,10,0,0" VerticalAlignment="Top" Width="772">
<Window Name="windows1">
</Window>
</DockPanel>
<DockPanel x:Name="dockpanel2" HorizontalAlignment="Left" Height="200" LastChildFill="False" Margin="10,209,0,0" VerticalAlignment="Top" Width="772">
<Window Name="windows2"></Window>
</DockPanel>
</Grid>
</Window>
But dont know how to assign class instance to window in code-behind. I would like to know the best approach to achieve, provide me with some example code snippet. Thanks in advance.