I have a button using accent style
<Button Grid.Column="1" Grid.Row="0" Height="90" Width="90" VerticalAlignment="Top" Margin="15"
Style="{StaticResource MaterialDesignFloatingActionAccentButton}" >
<materialDesign:PackIcon Kind="Alert" Height="40" Width="40" />
</Button>
But I want this specific button to use a red accent style and not my default accent which is lime.
This will only happen in this specific window.
How do I achieve this?
Thanks
You need to redefine the secondary accent brush in the resources of your button
<Button Grid.Column="1" Grid.Row="0" Height="90" Width="90" VerticalAlignment="Top" Margin="15"
Style="{StaticResource MaterialDesignFloatingActionAccentButton}">
<Button.Resources>
<SolidColorBrush x:Key="SecondaryAccentBrush" Color="#F44336"/>
<SolidColorBrush x:Key="SecondaryAccentForegroundBrush" Color="#E57373"/>
</Button.Resources>
<materialDesign:PackIcon Kind="Alert" Height="40" Width="40" />
</Button>
I hope it can help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With