2

I am working with the System.Windows.Ribbon in my project. I am also using some other libraries like AvalonDocking,... What I want to do is create my own themes inside the application so that the user can select the prefered theme.

The problem is that I don't get the RibbonTab to change to the correct colors. When I change the ribbon background color the RibbonTab color changes also. But I want to change it seperatly

Does anybody have any experience with changing the layout of the System.Windows.Ribbon?

This is what I tried before:

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock">

    <SolidColorBrush x:Key="WindowBrush" Color="Black"/>

    <Style TargetType="{x:Type Ribbon}">
        <Setter Property="Background" Value="#444444" />
        <Setter Property="Foreground" Value="White" />
    </Style>

    <Style TargetType="{x:Type RibbonTab}">
        <Setter Property="Height" Value="88" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="Background" Value="Black" />
    </Style>

    <Style TargetType="{x:Type xcad:DockingManager}">
        <Setter Property="Background" Value="#444444" />
        <Setter Property="Foreground" Value="White" />
    </Style>
</ResourceDictionary>

Result of theme

As you can see, the RibbonTab is not black like specified inside the ResourceDictionary

Daniel Lemke
  • 1,966
  • 18
  • 24
kevingoos
  • 3,785
  • 4
  • 36
  • 63
  • 1
    Have a read of https://social.msdn.microsoft.com/Forums/vstudio/en-US/22fa73e4-b1db-43ae-83fc-4f50c26f7a0c/placing-a-background-to-a-tab-on-a-ribbon-control?forum=wpf#6d716cea-1624-4b20-b444-f5a4c9445bc8 – Paul Zahra Jul 15 '16 at 08:02
  • That is actually what I need :) Thx – kevingoos Jul 15 '16 at 08:16

0 Answers0