Styling button using BasedOn for skin

I am following the instructions on this thread https://www.syncfusion.com/forums/165058/how-to-define-a-custom-style-using-basedon-for-basic-controls-using-sfskinmanager.

I am trying to base a custom style on the default style provided by the Office2019White theme. However, it doesn't appear to be working for me. The program gives an error on startup.

Attached is my project


Attachment: Desktop.Wpf.Theme_65514415.zip

3 Replies 1 reply marked as answer

SA Sulthan Amanu Syncfusion Team May 30, 2022 01:38 PM UTC

Hi Walter,

 

We have checked the reported requirement and understood that you want to override the Office2019White style for MS Button control. For this the respective XAML path and BasedOn key name are shown in the following code: 

 

Code snippets:

 

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<ResourceDictionary.MergedDictionaries>

<ResourceDictionary

 Source="/Syncfusion.Themes.Office2019White.WPF;component/MSControl/Button.xaml" />

</ResourceDictionary.MergedDictionaries>

<Style x:Key="RecentlyUsedButtonStyle"

TargetType="{x:Type Button}"

BasedOn="{StaticResource WPFButtonStyle}">

<Setter Property="Background"

Value="Transparent" />

<Setter Property="Cursor"

Value="Hand" />

</Style>

</ResourceDictionary>

 

 

And we have shared a working sample for your convenience.

If the attached sample does not similar to your requirement, please share more details such as a complete code snippet or update us with modifying the attached sample in the issue reproduced state which will be helping us to proceed further to provide the solution at the earliest.


Regards,

Sulthan Amanu


Attachment: Skinmanager_style_1583fa04.zip

Marked as answer

WA Walter replied to Sulthan Amanu June 5, 2022 02:22 PM UTC

Great, that worked!



SP Sangavi Periyannan Syncfusion Team June 6, 2022 05:37 AM UTC

Hi Walter,


We are glad that the provided response meets your requirement. Please let us know if you need further assistance. As always, we are happy to help you out. 


Regards,

Sangavi


Loader.
Up arrow icon