
I am trying to change the style and colors defined in Docking.xaml default template. Particularly on docking:ToolWindow and docking:DocumentWindow.
I want to define my own color brush resource keys, but the output always uses the color themes in the default themes (i.e. themes:AssetResourceKeys.<brushkeys>).
What I have attempted so far.
- isolated docking (including ribbons)
- added the entire default Docking.xaml as a merged dictionary in App.xaml
- removed "x:key={x:Type ..." declarations to implicitly attempt to load my style
- modified the colors to point to own resource dictionary (in fact, even hard coded colors doesn't get applied)
- Twoway bindings in AdvancedTabItemStyle triggers
Below are some of the snippets from what i tried changing so far (I intentionally want to hard code them to try to define the colors). In my implementation, I want to use my own defined resource keys.
<!-- AdvancedTabControlStyle -->
<Style x:Key="AdvancedTabControlStyle" TargetType="docking:AdvancedTabControl">
<Setter Property="Background" Value="RosyBrown" />
<Setter Property="BorderBrush" Value="Brown" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="IsActive" Value="{Binding RelativeSource={RelativeSource Self}, Path=IsKeyboardFocusWithin}" />
<Setter Property="TabBackground" Value="Red" />
<Setter Property="TabBackgroundActiveSelected" Value="Blue" />
<Setter Property="TabBackgroundInactiveSelected" Value="Orange" />
<Setter Property="TabBackgroundPointerOver" Value="Pink" />
<Setter Property="TabBackgroundPreview" Value="Cyan" />
<Setter Property="TabBackgroundPreviewActiveSelected" Value="Aqua" />
<Setter Property="TabBackgroundPreviewPointerOver" Value="Purple" />
<!-- dockingPrimitives:ToolWindowContainerTabControl -->
<!--<Style x:Key="{x:Type dockingPrimitives:ToolWindowContainerTabControl}" TargetType="dockingPrimitives:ToolWindowContainerTabControl" BasedOn="{StaticResource AdvancedTabControlStyle}">-->
<Style TargetType="dockingPrimitives:ToolWindowContainerTabControl" BasedOn="{StaticResource AdvancedTabControlStyle}">
<Setter Property="Background" Value="Green" />
<Setter Property="BorderBrush" Value="GreenYellow" />
<Setter Property="BorderThickness" Value="{DynamicResource {x:Static themes:AssetResourceKeys.ToolWindowContainerTabControlBorderNormalThicknessKey}}" />
<Setter Property="TabBackground" Value="Red" />
<Setter Property="TabBackgroundActiveSelected" Value="Blue" />
<Setter Property="TabBackgroundInactiveSelected" Value="Orange" />
<Setter Property="TabBackgroundPointerOver" Value="Pink" />
<Setter Property="TabBackgroundPreview" Value="Cyan" />
<Setter Property="TabBackgroundPreviewActiveSelected" Value="Aqua" />
<Setter Property="TabBackgroundPreviewPointerOver" Value="Purple" />
<!-- dockingPrimitives:TabbedMdiContainerTabControl -->
<Style x:Key="{x:Type dockingPrimitives:TabbedMdiContainerTabControl}" TargetType="dockingPrimitives:TabbedMdiContainerTabControl" BasedOn="{StaticResource AdvancedTabControlStyle}">
<Setter Property="Background" Value="AliceBlue" />
<Setter Property="BorderBrush" Value="BlueViolet" />
<Setter Property="BorderThickness" Value="{DynamicResource {x:Static themes:AssetResourceKeys.TabbedMdiContainerTabControlBorderNormalThicknessKey}}" />
<Setter Property="CanTabsHighlightOnPointerOverWhenInactive" Value="True" />
<Setter Property="HasTabCloseButtons" Value="True" />
<Setter Property="HighlightBrushActive" Value="Blue" />
<Setter Property="HighlightBrushInactive" Value="Cyan" />
<Setter Property="HighlightThickness" Value="5" />
<Setter Property="TabBackground" Value="Red" />
<Setter Property="TabBackgroundActiveSelected" Value="Brown" />
<Setter Property="TabBackgroundInactiveSelected" Value="Pink" />
<Setter Property="TabBackgroundPointerOver" Value="Yellow" />
<Setter Property="TabBackgroundPreview" Value="Orange" />
<Setter Property="TabBackgroundPreviewActiveSelected" Value="Beige" />
<Setter Property="TabBackgroundPreviewPointerOver" Value="Violet" />
some of the other implicit defined styles.
<!-- docking:ToolWindow -->
<!--<Style x:Key="{x:Type docking:ToolWindow}" TargetType="docking:ToolWindow" BasedOn="{StaticResource DockingWindowStyle}">-->
<Style TargetType="docking:ToolWindow" BasedOn="{StaticResource DockingWindowStyle}">
<Setter Property="TabToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=Title, Mode=OneWay}" />
</Style>
<!-- docking:DocumentWindow -->
<!--<Style x:Key="{x:Type docking:DocumentWindow}" TargetType="docking:DocumentWindow" BasedOn="{StaticResource DockingWindowStyle}">-->
<Style TargetType="docking:DocumentWindow" BasedOn="{StaticResource DockingWindowStyle}">
<Setter Property="TabToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=FileName, Mode=OneWay}" />
</Style>
I am particulary confident that the styles are getting loaded, Visual Studio Live Property explorer points to the correct Style and correct color values but the colors are just not getting pushed through the UI at runtime.
Just to add some more information, I also tried setting Twoway bindings in AdvancedTabItemStyle triggers where I believe the Binding is driven by the TemplatedParent ("docking:AdvancedTabControl").
<!-- AdvancedTabItemStyle -->
<Style x:Key="AdvancedTabItemStyle" TargetType="docking:AdvancedTabItem">
<ControlTemplate.Triggers>
<Trigger Property="LayoutKind" Value="Pinned">
<Setter TargetName="ToggleLayoutKindButton" Property="ContentTemplate" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=UnpinButtonContentTemplate}" />
</Trigger>
<Trigger Property="LayoutKind" Value="Preview">
<Setter TargetName="ToggleLayoutKindButton" Property="ContentTemplate" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=PromoteButtonContentTemplate}" />
<Setter TargetName="ToggleLayoutKindButton" Property="ToolTip" Value="{productsDocking:SRExtension UIAdvancedTabItemKeepOpenButtonToolTip}" />
</Trigger>
<Trigger Property="HighlightKind" Value="Preview">
<Setter TargetName="TabChrome" Property="UntintedBackground" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BackgroundPreview, Mode=TwoWay}" />
<Setter TargetName="TabChrome" Property="UntintedBorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderBrushPreview, Mode=TwoWay}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ForegroundPreview, Mode=TwoWay}" />
</Trigger>
<Trigger Property="HighlightKind" Value="PointerOver">
<Setter TargetName="TabChrome" Property="UntintedBackground" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BackgroundPointerOver, Mode=TwoWay}" />
<Setter TargetName="TabChrome" Property="UntintedBorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderBrushPointerOver, Mode=TwoWay}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ForegroundPointerOver, Mode=TwoWay}" />
</Trigger>
What am I missing here?
Thanks in advance.
[Modified 7 years ago]