I'm using WPF TabControl and got a simple question (I hope).
I got a List of items, and for each item there are details displayed in a TabControl with 3 Tabs.
<TabControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" ItemsSource="{Binding SelectedLibrary.DetailViewModels}" IsSynchronizedWithCurrentItem="False">
<TabControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</TabControl.ItemTemplate>
<TabControl.Resources>
<DataTemplate DataType="{x:Type provider:PropertyPageViewModel}">
<dxprg:PropertyGridControl
ReadOnly="True"
ShowProperties="WithPropertyDefinitions"
ExpandCategoriesWhenSelectedObjectChanged="True"
ShowCategories="Hidden"
ShowMenuButtonInRows="False"
ShowToolPanel="False"
ValueColumnWidth="2*"
ShowSearchBox="False"
SelectedObject="{Binding FunctionBaseData.Function, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}">
<dxprg:PropertyDefinition Path="Name" Header="{x:Static fpProperties:Resources.PropertyGridHeaderName}" />
<dxprg:PropertyDefinition Path="Id" Header="{x:Static fpProperties:Resources.PropertyGridHeaderId}" />
<dxprg:PropertyDefinition Path="Type" Header="{x:Static fpProperties:Resources.PropertyGridHeaderType}" />
<dxprg:PropertyDefinition Path="Category" Header="{x:Static fpProperties:Resources.PropertyGridHeaderCategory}" />
<dxprg:PropertyDefinition Path="Version" Header="{x:Static fpProperties:Resources.PropertyGridHeaderVersion}"/>
<dxprg:PropertyDefinition Path="LastModified" Header="{x:Static fpProperties:Resources.PropertyGridHeaderLastModified}" />
</dxprg:PropertyGridControl>
</DataTemplate>
<DataTemplate DataType="{x:Type provider:PreviewPageViewModel}">
<TextBlock Text="PreviewPage"></TextBlock>
</DataTemplate>
<DataTemplate DataType="{x:Type provider:CodePageViewModel}">
<TextBlock Text="SourcePage"></TextBlock>
</DataTemplate>
</TabControl.Resources>
</TabControl>
This works.
When the user selects another item in the list the SelectedObject of my Tab changes, thats fine.
But the selected tab also changes, I want the selected Tab to stay the same as for the item before.
I Tried this IsSynchronizedWithCurrentItem="True", but that wouldnt help. Please tell me theres a property I can easily set for the WPF TabControl.
Thanks
SelectedObjectin your sample markup. - mm8