Hello Coders,
For example I have 2 different ViewModel class like VM1, VM2 and I have two different UserControl based View class like V1 and V2. V1's job is to display data of VM1 and V2 will display datas of VM1. I'd like to put the V1 and V2 into different Dragablz Tab.
in *.CS:
Tabs.Add(new Dragablz.HeaderedItemViewModel()
{
Header = "Tab1",
Content = new ViewModel1()
});
Tabs.Add(new Dragablz.HeaderedItemViewModel()
{
Header = "Tab2",
Content = new ViewModel2()
});
in *.xaml:
<dockablz:Layout>
<dragablz:TabablzControl
x:Name="tabControl"
ItemsSource="{Binding Tabs}"
Margin="8"
UseLayoutRounding="True"
ShowDefaultAddButton="False"
ShowDefaultCloseButton="True"
ClosingItemCallback="{Binding ClosingTabItemHandler}"
HeaderMemberPath="Header"
DisplayMemberPath="Content"
>
<dragablz:TabablzControl.InterTabController>
<dragablz:InterTabController ></dragablz:InterTabController>
</dragablz:TabablzControl.InterTabController>
</dragablz:TabablzControl>
</dockablz:Layout>
How could I bind together the corresponding ViewModels and Views on the tabs? (On "Tab1" should display a View1 which is binded to Tab1's Content (a ViewModel1 object)
I think TabablzControl's ContentTemplate not going to work because I have different View types and different ViewModel types.
Every example on the Internet (what I did found) was "Hello world" level, or hard coded in XAML with "TabItem" tags