【发布时间】:2021-08-18 17:04:28
【问题描述】:
我正在为我的应用程序设计一个深色主题,并且我的所有控件都使用 AvalonDock。在大多数情况下,我已经成功地将所有其他控件更新为我的黑暗模式。除了这些 tabitems(见下图)
我的应用程序中的每个选项卡项都有这个皮肤问题。这是因为该控件位于 AvalonDock:DockingManager 中,因此我可以简单地创建目标类型 TabControl 或 TabItem 的样式;我试过了,但没有用。
这就是我设置 DockingManager 的方式:
<avalonDock:DockingManager x:Name="DockingManager"
Foreground="Black"
DocumentsSource="{Binding Panes}"
AnchorablesSource="{Binding Tools}"
ActiveContent="{Binding MyActiveContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
LayoutItemTemplateSelector="{StaticResource AvalonDockPaneDataTemplateSelector}"
AllowMixedOrientation="True"
Grid.Row="1">
<avalonDock:DockingManager.LayoutItemContainerStyleSelector>
<view:PaneStyleSelector>
<view:PaneStyleSelector.ToolStyle>
<Style TargetType="{x:Type avalonDock:LayoutAnchorableItem}">
<Setter Property="Title"
Value="{Binding Model.Title}" />
<!--<Setter Property="IconSource" Value="{Binding Model.IconSource}"/>-->
<Setter Property="Visibility"
Value="{Binding Model.IsVisible, ConverterParameter={x:Static Visibility.Hidden}, Converter={StaticResource BooleanToVisibilityConverter}, Mode=TwoWay}" />
<Setter Property="ContentId" Value="{Binding Model.ContentId}"/>
<Setter Property="IsActive" Value="{Binding Model.IsActive, Mode=TwoWay}"/>
</Style>
</view:PaneStyleSelector.ToolStyle>
<view:PaneStyleSelector.PaneStyle>
<Style TargetType="{x:Type avalonDock:LayoutItem}">
<Setter Property="Title"
Value="{Binding Model.Title}"/>
<Setter Property="CloseCommand"
Value="{Binding CloseCommand}" />
<!--<Setter Property="IconSource" Value="{Binding Model.IconSource}"/>-->
<Setter Property="ContentId" Value="{Binding Model.ContentId}"/>
</Style>
</view:PaneStyleSelector.PaneStyle>
</view:PaneStyleSelector>
</avalonDock:DockingManager.LayoutItemContainerStyleSelector>
<avalonDock:LayoutRoot>
<avalonDock:LayoutPanel Orientation="Horizontal">
<avalonDock:LayoutDocumentPane />
<avalonDock:LayoutAnchorablePane Name="MyPane"
DockWidth="350" />
</avalonDock:LayoutPanel>
</avalonDock:LayoutRoot>
</avalonDock:DockingManager>
如何访问这些控件的颜色/画笔/填充/背景?
【问题讨论】:
标签: wpf xaml avalondock