We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Setting Visual Style / Theme for All Controls (Syncfusion and standard WPF controls)

Not entirely sure how I am making this so difficult. But after looking at the examples provided with my dashboard and reviewing some forum threads on here I just can't get this to work. I simply want to set the Office2007BlueStyle for all Controls ever used in my application.

I've managed to get all Non-Syncfusion controls to work by doing this:

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="DataTemplates/ProjectTemplates.xaml"/>
                <ResourceDictionary Source="/Syncfusion.Shared.WPF;component/SkinManager/SkinManager.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>

Not sure why Controls like ComboBox and Button work fine with the above, however, nothing with Syncfusion will display the style (ButtonAdv/ComboBoxAdv).

Thanks in Advance.

11 Replies

DK Dinesh Kumar P Syncfusion Team September 20, 2012 06:27 PM UTC

Hi Brantley,

 

Query: Set the Office2007BlueStyle for all Controls in the application.

 

This has been done using ‘Syncfusion:SkinStorage.VisualStyle’ property and its value set to ‘Office2007Blue’. Using ‘VisualStyle’ property we can apply specific theme for all the controls.

 

Please find the sample with VisualStyle set with Office2007Blue,

 

Apart from this, the added Resource dictionary “<ResourceDictionary Source="/Syncfusion.Shared.WPF;component/SkinManager/SkinManager.xaml" />” contains only styles for non- syncfusion controls  hence Syncfusion controls did not have style change.

 

Please refer the below link, to add resource dictionary for Syncfusion controls also with specific visual style,

 

http://help.syncfusion.com/UG/User%20Interface/WPF/Tools/default.htm#!documents/3344resourcedictiona.htm

 

 

Please let us know if you have any queries.

 

Regards,

P. Dinesh kumar



StyleToAllControls_3526a6d7.zip


MF Michelle Fowler October 10, 2013 10:31 PM UTC

The zip file can no longer be downloaded. Can you make it available again?


KP Karuppasamy P Syncfusion Team October 17, 2013 06:05 AM UTC

Hi Michelle,

Sorry for the delay being caused.

We have created a sample and attached here. Please find the sample below.
In the sample we have added Framework controls and Syncfusion Controls and have set the VisualStyle Office2007Blue using VisualStyle property.

Please let us know if you have any concerns.

Regards,
Karuppasamy p




StyleToAllControls_7cd2f039.zip


AD Administrator Syncfusion Team December 11, 2013 02:47 PM UTC

Hi, how would one do this in c# as to set all controls with one statement, ie...

SyncFusion.SkinStorage.SetVisualStyle(mainWindow, Skins.Blend);

Thank you


AD Administrator Syncfusion Team December 11, 2013 02:49 PM UTC

...Also how would one change the fontsize for all controls? Thanks :-)


MA Muthukumar A Syncfusion Team December 12, 2013 11:51 AM UTC

Hi Sharron,
Thanks for contacting Syncfusion Support.
Query #1 : How to set skin by Code behind.
We have created a sample based on your requirement. Please download the same from the below location.
Query #2 : How to Set Fontsize for all controls in Window.
Generally if we do not set FontSize explicitly, controls will get FontSize from their immediate parent. In your case if you want to set font size for all controls in Window, then you can set font size for window. This will be applied to all the controls in it.

Please let us know if you need  further assistance.

Thanks,
Muthukumar


StyleToAllControls_cbbfccc5.zip


AD Administrator Syncfusion Team December 12, 2013 10:15 PM UTC

Oh Wow!! Thank you!


MA Mike Anderson December 12, 2014 07:31 PM UTC

I am having similar problems setting the visual style - the zip file is no longer valid, can you re-post the example please.


JR Jegan Raj M Syncfusion Team December 15, 2014 05:16 AM UTC

Hi Mehran & Mike,

Sorry for the inconvenience caused.
Please download the sample from below link.

Please let us know if you need further assistance.

Regards,
Jegan Raj M


Attachment: VisualStyle_Sample_76ac27c7.zip


FA Farrukh February 22, 2016 09:26 AM UTC

where should i write this line



VR Venkateshwaran Ramdoss Syncfusion Team February 23, 2016 08:59 AM UTC

Hi Farrukh,

Thank you for contacting Syncfusion Support.

We have created a simple sample based on your requirement. Please download the same from the below attachment. In this sample we have added "SkinStorage.SetVisualStyle(this,"Metro")" line in the constructor of the MainWindow to set the VisualStyle for all the control in the window.

Regards,
Venkateshwaran V.R.

Attachment: VisualStyleSample_5ba0aafa.zip

Loader.
Live Chat Icon For mobile
Up arrow icon