Hello!
I have a Window with two tabs, as follows:
<TabControl Padding="0" >
<TabItem Header="Products" x:Name="TabItem1" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ContentControl Content="{Binding ProdListView}" Grid.Row="0" Grid.Column="1" Margin="0,0,5,0" />
</Grid>
</TabItem>
<TabItem Header="Products" x:Name="TabItem2" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ContentControl Content="{Binding ProdListView}" Grid.Row="0" Grid.Column="1" Margin="0,0,5,0" />
</Grid>
</TabItem>
</TabControl>
ProdListView is XAML with DataGrid.
When I click on TabItem1, it displays all the data, and when I click on TabItem2, it also displays all the data. However, when I click back on TabItem1, the tab content is blank and when I click on TabItem2,
the data is displayed again. When I use a different view control instead of ProdListView on one of the TabItems, everything works fine.
I need this kind of set-up as I use ProdListView for two different master/detail views.
Many thanks for your help.
Abbas