Dragablz icon indicating copy to clipboard operation
Dragablz copied to clipboard

Header not populating correctly.

Open shortcircuit21 opened this issue 9 years ago • 4 comments

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".

shortcircuit21 avatar Mar 10 '17 21:03 shortcircuit21

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.

Baggioowen avatar Apr 17 '17 15:04 Baggioowen

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" />

marceldostal avatar Aug 20 '17 21:08 marceldostal

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. 😄

silexcorp avatar Nov 24 '18 01:11 silexcorp

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" />

Thank you thank you thank you!!!

djxtazy avatar Feb 20 '20 00:02 djxtazy