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

Add style to existing button style by using property BasedOn

I am using ChromelessWindow for my WPF application. I have added a style resources like this:

<ResourceDictionary Source="/Syncfusion.SfGrid.WPF;component/Styles/Styles.xaml" />


Now I want to add some more style to button like padding e.t.c to exising style using BasedOn property.

<Style TargetType="Button" x:Key="CustomButtonStyle" BasedOn="--------">
                <Setter Property="Padding" Value="20, 10"/>
                <Setter Property="HorizontalAlignment" Value="Left"/>
</Style>


But don't know what is the name of default style.


Attachment: SyncfusionWpfApp1_e7ce3786.zip

1 Reply

JP Jagadeesan Pichaimuthu Syncfusion Team June 18, 2019 10:42 AM UTC

Hi Amit, 
  
Thanks for using Syncfusion product. 
  
We don’t have any styles for MS Button, so no need for BasedOn property. You can apply the style for a Button, as per the below code it will works. 
  
Please refer the below code snippet,  
<Style TargetType="Button" x:Key="CustomButtonStyle" > 
    <Setter Property="Padding" Value="20, 10"/> 
    <Setter Property="Background" Value="Red"/> 
    <Setter Property="HorizontalAlignment" Value="Left"/> 
</Style> 
  
 Please refer the below screen shot for your reference, 
 
  
 
Let us know whether this helps also if you need any further assistance on this.  
 
Regards, 
Jagadeesan 


Loader.
Live Chat Icon For mobile
Up arrow icon