How to use Global Resource Style with ButtonAdv?

In a WPF application, I have a ChromelessWindow that contains 10 ButtonAdv controls. 

The FluentDark theme is applied as shown below:

<syncfusion:ChromelessWindow 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
    xmlns:syncfusionskin ="clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF"
    syncfusionskin:SfSkinManager.Theme="{syncfusionskin:SkinManager ThemeName=FluentDark}">
    <StackPanel>
      <syncfusion:ButtonAdv
         Label="Σκευάσματα"
         VerticalAlignment="Center"
         VerticalContentAlignment="Center"
         HorizontalContentAlignment="Center"
         Height="80"
         Width="80"
         Margin="5 0 0 0"
         IconWidth="30"
          IconHeight="40"
          SizeMode="Large"
         Foreground="White"
         IconTemplate="{StaticResource Syringe}"/>
<!-- Nine more ButtonAdv controls go here -->
   </StackPanel>
</syncfusion:ChromelessWindow>


I've set values to some properties of the buttons (VerticalAlignment, VerticalContentAlignment, HorizontalContentAlignment, Height, Width, Margin, IconWidth, IconHeight, SizeMode, Foreground) to customize the buttons. All those values are the same for all buttons. I tried to create a global Style for ButtonAdv, for example:

<Style TargetType="{syncfusion:ButtonAdv}">
    <Setter Property="VerticalAlignment" Value="Center"/>
    <Setter Property="Foreground" Value="White"/>
<!-- Other Setters go here -->
</Style>

But it doesn't work. The Style is not applied to the ButtonAdv controls. I also tried with a keyed Style but it doesn't work either.

How can I apply a global or keyed Style to ButtonAdv controls?



1 Reply

NS Nithi Sneha Samuel Jeba Kumar Syncfusion Team January 22, 2025 04:03 AM UTC

Hi Dimitris,


We have validated your query, and  prepared sample with the requested functionality for your reference. If you have any further questions or need additional assistance, please don't hesitate to ask.


Regards,
Nithi Sneha S


Attachment: ButtonAdvSample_dee90bde.zip

Loader.
Up arrow icon