How do I apply the current syncfusion theme to the Ribbon control?
See the attached example.
Project is made with Visual Studio 2015 using version 18.2.0.44.
Attachment: WpfApplication1_be04d1ff.zip
SIGN IN To post a reply.
9 Replies
1 reply marked as answer
VR
Vijayalakshmi Roopkumar
Syncfusion Team
November 20, 2020 12:18 PM UTC
Hi Zeljko
Thank you for your update.
We have checked the reported query and understood that your requirement is to apply the MaterialDarkBlue theme for Ribbon control. However in your sample, you have not changed the Window to RibbonWindow and also not refer the RibbonBar style according to the referred SfSkinManager themes. So only the theme does not reflected in your sample. We have modified the same and it can be downloaded from following location:
Code:
|
<Setter.Value>
<Style BasedOn="{StaticResource SyncfusionRibbonBarStyle}" TargetType="{x:Type syncfusion:RibbonBar}">
<Setter Property="Header" Value="{Binding BarHeader}" />
<Setter Property="ItemsSource" Value="{Binding CustomRibbonItems}" />
<Setter Property="ItemTemplateSelector" Value="{StaticResource selector}" />
</Style>
</Setter.Value>
|
Sample:
Sample: https://www.syncfusion.com/downloads/support/forum/159898/ze/WpfApplication_modified460389047.zip
Please let us know if you need any further assistance on this.
Regards,
Vijayalakshmi VR
Marked as answer
ZL
Zeljko Lazic
November 20, 2020 03:59 PM UTC
Thanks. I wasn't aware the RibbonWindow was required.

However, adding references to other syncfusion themes, and changing syncfusion:SfSkinManager.VisualStyle will result in a crash.
Here are some themes I tested: blend, Office365, Office2016Colorfull
If I removed the "BasedOn" property circled in red, then it will launch without crashing.
BR
Backia Raj Kanagaraj
Syncfusion Team
November 23, 2020 11:28 AM UTC
Hi Zeljko,
Thanks for your update.
We have checked your requirement and found that, we have maintained the predefined style key (SyncfusionRibbonBarStyle) for Material, Office2019 style. Remaining styles are maintained in another style key (Office2013RibbonBarStyle) reference. If you want to set the theme like Metro, Office365, Office2016Colorful styles, you need to set the Office2013RibbonStyle in BasedOn property. Refer the below code and sample for your reference.
Code snippet:
|
//Set visual style to Office365
syncfusionskin:SfSkinManager.VisualStyle="Office365"
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style BasedOn="{StaticResource Office2013RibbonBarStyle}" TargetType="{x:Type syncfusion:RibbonBar}">
<Setter Property="Header" Value="{Binding BarHeader}" />
<Setter Property="ItemsSource" Value="{Binding CustomRibbonItems}" />
<Setter Property="ItemTemplateSelector" Value="{StaticResource selector}" />
</Style>
</Setter.Value>
</Setter> |
Sample link: https://www.syncfusion.com/downloads/support/directtrac/159898/ze/WpfApplication1798005309
Please try it with the provided solution and let us know if you need any further assistance on this. We will be glad to assist you.
Regards,
Backia Raj Kanagaraj
ZL
Zeljko Lazic
November 23, 2020 08:10 PM UTC
It's still crashing if the VisualStyles enum value corresponds to 0
syncfusionskin:SfSkinManager.VisualStyle="Default"
VR
Vijayalakshmi Roopkumar
Syncfusion Team
November 24, 2020 08:19 AM UTC
Hi Zeljiko
Thank you for your update.
From your update, we come to know that you are dynamically changing the SfSkinManager themes. So here we have listed out the Predefined style maintained for RibbonBar of all our SfSkinManager themes.
|
S.NO |
Themes |
Predefined style key |
|
1. |
Default |
DefaultRibbonBarStyle |
|
2. |
Syncfusion.Themes.Blend.WPF |
Office2013RibbonBarStyle |
|
3. |
Syncfusion.Themes.Office365.WPF |
Office2013RibbonStyle |
|
4. |
Syncfusion.Themes.Office2010Blue.WPF |
Office2013RibbonBarStyle |
|
5. |
Syncfusion.Themes.Office2010Black.WPF |
Office2013RibbonBarStyle |
|
6 |
Syncfusion.Themes.Office2010Silver.WPF |
Office2013RibbonBarStyle |
|
7 |
Syncfusion.Themes.Office2013White.WPF |
Office2013RibbonBarStyle |
|
8 |
Syncfusion.Themes.Office2013LightGray.WPF |
Office2013RibbonBarStyle |
|
9 |
Syncfusion.Themes.Office2013DarkGray.WPF |
Office2013RibbonBarStyle |
|
10 |
Syncfusion.Themes.Office2016Colorful.WPF |
Office2013RibbonBarStyle |
|
11 |
Syncfusion.Themes.Office2016White.WPF |
Office2013RibbonBarStyle |
|
12 |
Syncfusion.Themes.Office2016DarkGray.WPF |
Office2013RibbonBarStyle |
|
13 |
Syncfusion.Themes.Office2019Black.WPF |
SyncfusionRibbonBarStyle |
|
14 |
Syncfusion.Themes.Office2019Colorful.WPF |
SyncfusionRibbonBarStyle |
|
15 |
Syncfusion.Themes.MaterialDark.WPF |
SyncfusionRibbonBarStyle |
|
16 |
Syncfusion.Themes.MaterialLight.WPF |
SyncfusionRibbonBarStyle |
|
17 |
Syncfusion.Themes.Lime.WPF |
Office2013RibbonBarStyle |
|
18 |
Syncfusion.Themes.Metro.WPF |
Office2013RibbonBarStyle |
|
19 |
Syncfusion.Themes.Saffron.WPF |
Office2013RibbonBarStyle |
|
20 |
Syncfusion.SystemThemes.WPF |
Office2013RibbonBarStyle |
|
21 |
Syncfusion.Themes.VisualStudio2013.WPF |
Office2013RibbonBarStyle |
|
22 |
Syncfusion.Themes.VisualStudio2015.WPF |
Office2013RibbonBarStyle |
So please make use of this in your application and let us know if it meets your requirement.
Regards,
Vijayalakshmi VR
Hi ZeljikoThank you for your update.From your update, we come to know that you are dynamically changing the SfSkinManager themes. So here we have listed out the Predefined style maintained for RibbonBar of all our SfSkinManager themes.
S.NO Themes Predefined style key 1. Default DefaultRibbonBarStyle 2. Syncfusion.Themes.Blend.WPF Office2013RibbonBarStyle 3. Syncfusion.Themes.Office365.WPF Office2013RibbonStyle 4. Syncfusion.Themes.Office2010Blue.WPF Office2013RibbonBarStyle 5. Syncfusion.Themes.Office2010Black.WPF Office2013RibbonBarStyle 6 Syncfusion.Themes.Office2010Silver.WPF Office2013RibbonBarStyle 7 Syncfusion.Themes.Office2013White.WPF Office2013RibbonBarStyle 8 Syncfusion.Themes.Office2013LightGray.WPF Office2013RibbonBarStyle 9 Syncfusion.Themes.Office2013DarkGray.WPF Office2013RibbonBarStyle 10 Syncfusion.Themes.Office2016Colorful.WPF Office2013RibbonBarStyle 11 Syncfusion.Themes.Office2016White.WPF Office2013RibbonBarStyle 12 Syncfusion.Themes.Office2016DarkGray.WPF Office2013RibbonBarStyle 13 Syncfusion.Themes.Office2019Black.WPF SyncfusionRibbonBarStyle 14 Syncfusion.Themes.Office2019Colorful.WPF SyncfusionRibbonBarStyle 15 Syncfusion.Themes.MaterialDark.WPF SyncfusionRibbonBarStyle 16 Syncfusion.Themes.MaterialLight.WPF SyncfusionRibbonBarStyle 17 Syncfusion.Themes.Lime.WPF Office2013RibbonBarStyle 18 Syncfusion.Themes.Metro.WPF Office2013RibbonBarStyle 19 Syncfusion.Themes.Saffron.WPF Office2013RibbonBarStyle 20 Syncfusion.SystemThemes.WPF Office2013RibbonBarStyle 21 Syncfusion.Themes.VisualStudio2013.WPF Office2013RibbonBarStyle 22 Syncfusion.Themes.VisualStudio2015.WPF Office2013RibbonBarStyleSo please make use of this in your application and let us know if it meets your requirement.Regards,Vijayalakshmi VR
It's still crashing when attempting to use "Default" visual style.
S.NO | Themes | Predefined style key |
1. | Default | DefaultRibbonBarStyle |
<syncfusion:RibbonWindow x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApplication1" xmlns:syncfusion="http://schemas.syncfusion.com/wpf" xmlns:syncfusionskin="clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF" Title="MainWindow" Width="525" Height="350" WindowStartupLocation="CenterScreen" syncfusionskin:SfSkinManager.VisualStyle="Default"> <Window.Resources> <ResourceDictionary> <local:BooltoSizeformConverter x:Key="sizeform" /> <local:ItemDataTemplateSelector x:Key="selector" /> <local:ImageConverter x:Key="image" /> <DataTemplate x:Key="Ribbonbutton"> <syncfusion:RibbonButton Label="{Binding ItemHeader}" LargeIcon="{Binding Image, Converter={StaticResource image}}" SizeForm="{Binding IsLarge, Converter={StaticResource sizeform}}" SmallIcon="{Binding Image, Converter={StaticResource image}}" /> DataTemplate> <DataTemplate x:Key="Splitbutton"> <syncfusion:SplitButton Label="{Binding ItemHeader}" LargeIcon="{Binding Image, Converter={StaticResource image}}" SizeForm="{Binding IsLarge, Converter={StaticResource sizeform}}" SmallIcon="{Binding Image, Converter={StaticResource image}}" /> DataTemplate> ResourceDictionary> Window.Resources> <Window.DataContext> <local:ViewModel /> Window.DataContext> <Grid> <syncfusion:Ribbon x:Name="_ribbon" VerticalAlignment="Top" ItemsSource="{Binding CustomRibbonTabs}"> <syncfusion:Ribbon.ItemContainerStyle> <Style TargetType="{x:Type syncfusion:RibbonTab}"> <Setter Property="Caption" Value="{Binding TabHeader}" /> <Setter Property="ItemsSource" Value="{Binding CustomRibbonBars}" /> <Setter Property="ItemContainerStyle"> <Setter.Value> <Style BasedOn="{StaticResource DefaultRibbonBarStyle}" TargetType="{x:Type syncfusion:RibbonBar}"> <Setter Property="Header" Value="{Binding BarHeader}" /> <Setter Property="ItemsSource" Value="{Binding CustomRibbonItems}" /> <Setter Property="ItemTemplateSelector" Value="{StaticResource selector}" /> Style> Setter.Value> Setter> Style> syncfusion:Ribbon.ItemContainerStyle> syncfusion:Ribbon> Grid> syncfusion:RibbonWindow>
VR
Vijayalakshmi Roopkumar
Syncfusion Team
January 22, 2021 12:11 PM UTC
Hi Zeljko
Thank you for your update.
As the default theme for Ribbon is generic , then all parts of Ribbon would be properly rendered without applying it explicitly. So we recommend you to not to set the BasedOn style for RibbonBar for Default theme. However when you are trying to apply other themes expect default, the RibbonBar style need to be apply it explicitly and it would work as expected. Please find the sample for the same for default theme.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Default_styleribbon-90051806.zip
Screenshot:
So please try this suggestion and let us know if it is resolved at your end.
Regards,
Vijayalakshmi VR
ZL
Zeljko Lazic
January 22, 2021 02:31 PM UTC
The following new themes all crash when used. What should the ribbonbar BasedOn value be for the following themes?
| Office2019Colorful | Syncfusion.Themes.Office2019Colorful.Wpf.dll | Syncfusion.Themes.Office2019Colorful.WPF |
| Office2019Black | Syncfusion.Themes.Office2019Black.Wpf.dll | Syncfusion.Themes.Office2019Black.WPF |
| Office2019White | Syncfusion.Themes.Office2019White.Wpf.dll | Syncfusion.Themes.Office2019White.WPF |
| Office2019DarkGray | Syncfusion.Themes.Office2019DarkGray.Wpf.dll | Syncfusion.Themes.Office2019DarkGray.WPF |
| Office2019HighContrast | Syncfusion.Themes.Office2019HighContrast.Wpf.dll | Syncfusion.Themes.Office2019HighContrast.WPF |
| Office2019HighContrastWhite | Syncfusion.Themes.Office2019HighContrastWhite.Wpf.dll | Syncfusion.Themes.Office2019HighContrastWhite.WPF |
VR
Vijayalakshmi Roopkumar
Syncfusion Team
January 25, 2021 10:04 AM UTC
Hi Zeljiko
Thank you for your update.
Query : The following new themes all crash when used. What should the ribbonbar BasedOn value be for the following themes?
Please find the predefined style maintained for RibbonBar of all requested SfSkinManager themes.
|
S.NO |
Themes |
Predefined style key |
|
1. |
Syncfusion.Themes.Office2019Black.WPF |
SyncfusionRibbonBarStyle |
|
2. |
Syncfusion.Themes.Office2019White.Wpf.dll |
SyncfusionRibbonBarStyle |
|
3. |
Syncfusion.Themes.Office2019Colorful.Wpf.dll |
SyncfusionRibbonBarStyle |
|
4. |
Syncfusion.Themes.Office2019DarkGray.Wpf.dll |
SyncfusionRibbonBarStyle |
|
5. |
Syncfusion.Themes.Office2019HighContrast.Wpf.dll |
SyncfusionRibbonBarStyle |
|
6 |
Syncfusion.Themes.Office2019HighContrastWhite.Wpf.dll |
SyncfusionRibbonBarStyle |
So please make use of this in your application and let us know if it meets your requirement.
Regards,
Vijayalakshmi VR
SIGN IN To post a reply.
- 9 Replies
- 3 Participants
- Marked answer
-
ZL Zeljko Lazic
- Nov 19, 2020 08:28 PM UTC
- Jan 25, 2021 10:04 AM UTC