Here’s my (general) custom Button styling for the whole App I’m building:
<Style TargetType="{x:Type Button}"
BasedOn="{StaticResource MahApps.Styles.Button}">
<Setter Property="HorizontalAlignment"
Value="Left" />
<Setter Property="VerticalAlignment"
Value="Top" />
<Setter Property="BorderThickness"
Value="2" />
<Setter Property="Background"
Value="Red />
</Style
which apply on all Buttons I have on the App.
Now, for some specific CustomNoBorderButtonStyle
, I’d like to inherit these actual Button styles properties, and add/overwrite some more. Tried this:
<Style x:Key="CustomNoBorderButtonStyle"
TargetType="{x:Type Button}"
BasedOn="{StaticResource MahApps.Styles.Button}">
<Setter Property="BorderThickness"
Value="0" />
<Setter Property="controls:ControlsHelper.CornerRadius"
Value="0" />
</Style>
placing on view as:
<Button Name="buttonPlayPauseVideo"
Style="{StaticResource CustomNoBorderButtonStyle}" />
but it miss all the style from the main Button (i.e. Red background for example is missing).
What’s wrong on this settings?