Header not populating correctly.
The header for the tabcontrols are getting populated with the namespace of the class.
I am passing in a public header string from my view model as well as the viewmodel itself as the object.
The view of the viewmodel it is attached to populates correctly in each tab, but the header is getting messed up.
TabModels.Add(new TabContent(mainWorkQueueViewModel.Header, mainWorkQueueViewModel));
The header when launched is getting displayed with ViewModel.Common.TabContent.
Not sure what is going wrong. In the observable collection the header is not null. It is being populated with "work queue".
I got the same problem, and when I include the dll in the dragablz master sample code instead of the nuget one, the problem solved.
I have the same problem with Caliburn Micro Screens,
<dragablz:TabablzControl x:Name="Items">
<dragablz:TabablzControl.ItemTemplate>
<DataTemplate>
<TabItem Header="{Binding DisplayName}" />
</DataTemplate>
</dragablz:TabablzControl.ItemTemplate>
</dragablz:TabablzControl>
My ShellViewModel is a Conductor<IScreen>.Collection.OneActive and I add new Tabs with
var vm = new TabViewModel {DisplayName = "TabName"};
ActivateItem(vm);
to the Items Collection. TabablzControl ignores the DataTemplate and always shows ViewModel.ToString()
Workaround in TabViewModel:
public override string ToString(){ return DisplayName;}
EDIT:
use HeaderMemberPath
<dragablz:TabablzControl x:Name="Items" HeaderMemberPath="DisplayName" />
Me too, I got the same problem and I tried with different dragablz versions, from 0.0.3.203 to 0.0.3.154 and the last one solve my problem. 😄
I have the same problem with Caliburn Micro Screens,
<dragablz:TabablzControl x:Name="Items"> <dragablz:TabablzControl.ItemTemplate> <DataTemplate> <TabItem Header="{Binding DisplayName}" /> </DataTemplate> </dragablz:TabablzControl.ItemTemplate> </dragablz:TabablzControl>My ShellViewModel is a
Conductor<IScreen>.Collection.OneActiveand I add new Tabs withvar vm = new TabViewModel {DisplayName = "TabName"}; ActivateItem(vm);to the Items Collection. TabablzControl ignores the DataTemplate and always shows ViewModel.ToString()
Workaround in TabViewModel:
public override string ToString(){ return DisplayName;}EDIT: use HeaderMemberPath
<dragablz:TabablzControl x:Name="Items" HeaderMemberPath="DisplayName" />
Thank you thank you thank you!!!