I have a TabControl
that is data bound to an ObservableCollection
like following
<TabControl HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Style="{DynamicResource BreadCrumbTabControl}"
ItemsSource="{Binding SalesItem.DispayedCategory}"
SelectedIndex="{Binding SalesItem.TabIndex}">
<TabControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding DisplayText}" />
</DataTemplate>
</TabControl.ItemTemplate>
<TabControl.ContentTemplate>
<DataTemplate>
<-- user control -->
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
I wanted to style the tabs so the very first tab will have a different style and other tabs will have another style. I know how to do it if is not data bound.
<TabItem Header="Page 1" Style="{DynamicResource FirstTabItem}" />
<TabItem Header="Page 2" Style="{DynamicResource NormalTabItem}"/>
Can anyone help me out so I can achieve the above while the tabs are data bound?
Cheers.