Hello
In our application we have a menu item that allows us to change the color scheme. When this is used the brushes used for borders etc. are switched.
That works perfectly for all brushes except the HighlightActiveBrush of the TabControlStyle of the TabbedMdiHost in TabbedMdi-Mode, that keeps the color of the previous color scheme. So basically we have a green line at the top of a tab instead of an orange one after switching from the green to the orange color scheme.
To apply our color scheme we have our own style. Below is a drastically shortened version of that style.
<Style TargetType="{x:Type docking:TabbedMdiHost}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="HasTabImages" Value="True" />
<Setter Property="TabOverflowBehavior" Value="ShrinkWithMenu" />
<Setter Property="TabControlStyle">
<Setter.Value>
<Style TargetType="{x:Type docking:TabbedMdiContainerTabControl}">
<Setter Property="HighlightBrushActive" Value="{DynamicResource TabbedMdiActiveTabBackgroundBrush}" />
<Setter Property="HighlightBrushInactive" Value="{DynamicResource TabbedMdiInactiveTabBackgroundBrush}" />
<Setter Property="TabBackgroundActiveSelected" Value="{DynamicResource TabbedMdiActiveTabBackgroundBrush}" />
<Setter Property="TabBorderBrush" Value="{DynamicResource TabbedMdiInactiveTabBackgroundBrush}" />
...
</Setter.Value>
</Setter>
</Style>
When the color scheme is changed the DynamicResources change. HighlightBrushActive and HighlightBrushInactive do not react to that change, while the other brushes, like TabBackgroundActiveSelected, are changed correctly.
As far as we could find out HighlightBrushActive is set by TabbedMdiContainerTabControl.UpdateHighlightBrushes. That method is called in AdvanvedTabItem.OnLayoutKindPropertyChanged, if ownerTabControl is not null. It is also called when the Status of the ItemContainerGenerator is changed, but only if requiresPendingHighlightBrushUpdate is true. And in RequestHighlightBrushUpdate, it SelectedTabItem is not null. Finally it is also called in AdvancedTabControl.OnSelectionChanged.
We can gain some insight into that code with a decompiler, but we cannot debug it to see where exactly the HightlightBrushes are either not set or set to the wrong value.
Is this a known problem?
Can we do anything against it, by setting a property in the style? Or is it a bug in the actipro-framework that you can fix?