In my Tabcontrol the first tabitem content differs from the rest, it is added through XAML, works fine. However all the rest are added from viewmodel (upon load of control) based on the count of a custom collection and those tabs share the same design, but share different data, the problem is that all tabs data are the same, namely sets with the last data in the collection. (Except for the tab header text, those are OK). The Tabitems which use the same content build up like so:
The contenttemplate uses a DataTemplate which has the binding for textblocks / textboxes.
<ContentControl Content="{Binding}" x:Key="ResourceTabItemContent" ContentTemplate="{StaticResource ResourceBookingDataTemplate}"/>
Then all this gets used in viewmodel's control load like so:
foreach (var item in MyCollection) { DXTabItem dxti = new DXTabItem(); dxti.Content = (ContentControl)tabmain.FindResource("ResourceTabItemContent"); dxti.DataContext = item; dxti.Header = $"{item.Order} - {item.Name}"; tabmain.InsertTabItem(dxti, tabmain.Items.Count); }
So what's the way to see the proper data on each tabs not the same ones, Thanks for the ideas!