2012-04-04 45 views
1

我在项目中使用AvalonDock。对于这个例子的目的而言,如下的结构:Restyling AvalonDock高对比度主题?

<ad:DockingManager> 
    <ad:DockablePane> 
     <ad:DockableContent Title="Test1"> 
     </ad:DockableContent> 
     <ad:DockableContent Title="Test2"> 
     </ad:DockableContent> 
    </ad:DockablePane> 
</ad:DockingManager> 

Normal tabs

这是好的,但不幸的是,标签不看那么好上的高对比度主题,如下图所示。

High contrast tabs

理想我想再整的标签以用于背景(例如窗口颜色)的系统的颜色。这可能吗?

谢谢你,艾伦

+0

下载从代码Plex的有位。你会发现那里有xaml风格的文件。拿一个,开始嘲笑它。 – 2012-04-06 22:30:45

回答

3

去CodePlex上下载阿瓦隆位。你应该能够快速找到他们的样式的XAML文件。以一个为基准,开始嘲笑它。

你应该看到这样的事情(我将只包括一个风格)

<!--DockingManager--> 
<Style x:Key="{x:Type ad:DockingManager}" TargetType="{x:Type ad:DockingManager}"> 
    <Setter Property="Background" Value="{StaticResource DockManagerBackground}"/> 
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/> 
    <Setter Property="Template"> 
     <Setter.Value> 
      <ControlTemplate TargetType="{x:Type ad:DockingManager}"> 
       <Grid Background="{TemplateBinding Background}"> 
        <Grid.ColumnDefinitions> 
         <ColumnDefinition Width="Auto"/> 
         <ColumnDefinition/> 
         <ColumnDefinition Width="Auto"/> 
        </Grid.ColumnDefinitions> 
        <Grid.RowDefinitions> 
         <RowDefinition Height="Auto"/> 
         <RowDefinition/> 
         <RowDefinition Height="Auto"/> 
        </Grid.RowDefinitions> 
        <StackPanel Name="PART_LeftAnchorTabPanel" 
          Grid.Column="0" Grid.Row="1" Orientation="Vertical"> 
         <StackPanel.Resources> 
          <Style TargetType="{x:Type ad:DockablePaneAnchorTabGroup}"> 
           <Setter Property="LayoutTransform"> 
            <Setter.Value > 
             <RotateTransform Angle="90"/> 
            </Setter.Value> 
           </Setter> 
           <Setter Property="Margin" Value="0,2,2,0"/> 
          </Style> 
          <Style TargetType="Border"> 
           <Setter Property="CornerRadius" Value="0,0,3,3"/> 
          </Style> 
         </StackPanel.Resources> 
        </StackPanel> 
        <StackPanel Name="PART_RightAnchorTabPanel" Grid.Column="2" Grid.Row="1" Orientation="Vertical"> 
         <StackPanel.Resources> 
          <Style TargetType="{x:Type ad:DockablePaneAnchorTabGroup}"> 
           <Setter Property="LayoutTransform"> 
            <Setter.Value > 
             <RotateTransform Angle="90"/> 
            </Setter.Value> 
           </Setter> 
           <Setter Property="Margin" Value="2,2,0,0"/> 
          </Style> 
          <Style TargetType="Border"> 
           <Setter Property="CornerRadius" Value="3,3,0,0"/> 
          </Style> 
         </StackPanel.Resources> 
        </StackPanel> 
        <StackPanel Name="PART_TopAnchorTabPanel" Grid.Column="1" Grid.Row="0" Orientation="Horizontal"/> 
        <StackPanel Name="PART_BottomAnchorTabPanel" Grid.Column="1" Grid.Row="2" Orientation="Horizontal"/> 
        <Border 
         x:Name="PART_InternalContainer" 
         Background="{StaticResource DockManagerBorderBackground}" 
         Grid.Column="1" Grid.Row="1" 
         Padding="2"> 
         <ContentPresenter /> 
        </Border> 
       </Grid> 
      </ControlTemplate> 
     </Setter.Value> 
    </Setter> 
</Style> 

note that right on top of the file there will be a bunch of brushes, start with them, then start digging dipper 
+0

非常感谢Denis。我设法使用这种方法重新获得标签。 – 2012-04-07 20:05:11

+0

我很高兴能有所帮助。放轻松艾伦! – 2012-04-08 04:02:07