4

i am Using the Fluent-Ribbons to create my view in wpf. to have a better organisation of my code i wanted to put the different RibbonTabItems into their own files.

The problem is: the designer does not show the content of the ribbontab. I only see the a blank page.

Is there a way to make the RibbonTab visible in the designer?

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Markus
  • 195
  • 1
  • 11

1 Answers1

1

If anyone else lands here from google, I was having this situation where the ribbon was not only invisible in the designer, but also not showing at runtime. After spending some time, I found that you have import generic fluent ribbon theme resources into your Window or Application Resources section, like this:

<Window.Resources>
  <ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="pack://application:,,,/Fluent;component/Themes/Generic.xaml" />
    </ResourceDictionary.MergedDictionaries>
  </ResourceDictionary>
</Window.Resources>

After this my ribbon started showing in the designer as well as at runtime.

You can also use other themes in the same way. Just override the generic theme like this:

<Window.Resources>
  <ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="pack://application:,,,/Fluent;component/Themes/Generic.xaml" />

      <!-- change "Cobalt" to the color you want -->
      <ResourceDictionary Source="pack://application:,,,/Fluent;component/Themes/Themes/Dark.Cobalt.xaml" />
    </ResourceDictionary.MergedDictionaries>
  </ResourceDictionary>
</Window.Resources>

Hope this helps someone down the road.

Credit to the project documentation at github.

dotNET
  • 33,414
  • 24
  • 162
  • 251