Dear Syncfusion Support Team,
I am currently using Syncfusion WPF controls in my application and utilizing the SfSkinManager to apply themes. Specifically, I have the Windows11Light theme active, configured in my Window's XAML like this:
xmlns:syncfusionskin="clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF"
...
syncfusionskin:SfSkinManager.Theme="{syncfusionskin:SkinManagerExtension ThemeName=Windows11Light}"
My goal is to change the background color of a syncfusion:ButtonAdv control to red specifically when it is disabled (IsEnabled="False").
I attempted to achieve this by defining a local Style for the ButtonAdv with a Trigger targeting the IsEnabled property, like so:
<syncfusion:ButtonAdv Label="" ToolTip="New Project"
SmallIcon="../Theme/SLT_Icons/32_NewFile.png"
Command="{Binding NewProjectCommand}"
Margin="5" Padding="10,5" Background="Transparent" BorderBrush="Transparent"
RenderOptions.BitmapScalingMode="HighQuality"
WindowChrome.IsHitTestVisibleInChrome="True">
<syncfusion:ButtonAdv.Style>
<Style TargetType="syncfusion:ButtonAdv" BasedOn="{StaticResource {x:Type syncfusion:ButtonAdv}}">
<Setter Property="Background" Value="Transparent"/>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</syncfusion:ButtonAdv.Style>
</syncfusion:ButtonAdv>
However, this approach does not seem to work as expected. The background of the button does not turn red when it is disabled, presumably because the active Windows11Light theme's styles are taking precedence or overriding the local style trigger.
Could you please advise on the currently recommended or best practice method for overriding specific visual states (like the disabled background) of a Syncfusion control (specifically ButtonAdv) when using the SfSkinManager and predefined themes like Windows11Light?
Is there a specific technique required to ensure custom styles are applied correctly in conjunction with the theme manager, or should I perhaps look into customizing the theme itself?
Thank you for your time and assistance.
Hi Angelo Schadler,
We are currently validating your reported query and will provide an update on or before April 28th, 2025. We appreciate your patience until then.
Regards,
Bhaskar Suresh
Hi Angelo Schadler,
We have prepared a sample to override the style of the ButtonAdv control to modify the Disabled state style when Windows11Light theme was applied. Please refer to the attached sample and the documentation link regarding this and let us know if you have any concerns.
Regards,
Bhaskar Suresh