Posted 13 years ago
by Andy Ver Murlen
Version: 11.1.0545
Platform: .NET 4.0
Environment: Windows 7 (32-bit)
When a TaskTabControl is nested inside a TabControl, IsSelected on the TaskTabControl's TaskTabITems is not honored as the user cycles through the tabs of the parent TabControl.
The Odd thing is, if everything remains the same and the TaskTabControl is changed to a BackStage, the problem disappears.
Consider the following code. If you click on the "Two" tab of the parent control, the "Three" tab will be selected on the TaskTabControl, even though IsSelected is set on the "Four" tab. To compound matters, if you click on the "Four" tab in the TaskTabControl, then click on the "One" tab and back to the "Two" tab in the parent tab control, the "Four" tab will no longer be selected.Now consider this code. When the "Two" tab is selected on the parent tab control, the "Four" tab is properly set.
This is also not an issue using standard WPF TabControls nested inside each other.
[Modified at 08/25/2011 03:50 PM]
The Odd thing is, if everything remains the same and the TaskTabControl is changed to a BackStage, the problem disappears.
Consider the following code. If you click on the "Two" tab of the parent control, the "Three" tab will be selected on the TaskTabControl, even though IsSelected is set on the "Four" tab. To compound matters, if you click on the "Four" tab in the TaskTabControl, then click on the "One" tab and back to the "Two" tab in the parent tab control, the "Four" tab will no longer be selected.
<Window
x:Class="TestApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow"
Height="350"
Width="525"
xmlns:Ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
>
<Grid>
<TabControl>
<TabItem Header="One">
<Ribbon:TaskTabControl>
<Ribbon:TaskTabItem Header="One">
<Grid>
<TextBlock Text="Tab One Content" />
</Grid>
</Ribbon:TaskTabItem>
<Ribbon:TaskTabItem Header="Two" IsSelected="True">
<Grid>
<TextBlock Text="Tab Two Content" />
</Grid>
</Ribbon:TaskTabItem>
</Ribbon:TaskTabControl>
</TabItem>
<TabItem Header="Two">
<Ribbon:TaskTabControl>
<Ribbon:TaskTabItem Header="Three">
<Grid>
<TextBlock Text="Tab Three Content" />
</Grid>
</Ribbon:TaskTabItem>
<Ribbon:TaskTabItem Header="Four" IsSelected="True">
<Grid>
<TextBlock Text="Tab Four Content" />
</Grid>
</Ribbon:TaskTabItem>
</Ribbon:TaskTabControl>
</TabItem>
</TabControl>
</Grid>
</Window>
<Window
x:Class="TestApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow"
Height="350"
Width="525"
xmlns:Ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
>
<Grid>
<TabControl>
<TabItem Header="One">
<Ribbon:Backstage>
<Ribbon:BackstageTab Header="One">
<Grid>
<TextBlock Text="Tab One Content" />
</Grid>
</Ribbon:BackstageTab>
<Ribbon:BackstageTab Header="Two" IsSelected="True">
<Grid>
<TextBlock Text="Tab Two Content" />
</Grid>
</Ribbon:BackstageTab>
</Ribbon:Backstage>
</TabItem>
<TabItem Header="Two">
<Ribbon:Backstage>
<Ribbon:BackstageTab Header="Three">
<Grid>
<TextBlock Text="Tab Three Content" />
</Grid>
</Ribbon:BackstageTab>
<Ribbon:BackstageTab Header="Four" IsSelected="True">
<Grid>
<TextBlock Text="Tab Four Content" />
</Grid>
</Ribbon:BackstageTab>
</Ribbon:Backstage>
</TabItem>
</TabControl>
</Grid>
</Window>
[Modified at 08/25/2011 03:50 PM]