Hello everyone,
Is it possible for a xaml style to inherit from a style with the setter "template", inherit all existing triggers AND expand it with another trigger?
Example Style:
<Style x:Key="BigButton" TargetType={x:Type RadioButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RadioButton}">
<ControLTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Opacity" Value="1"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" Value="Red"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Style>
Most of my Buttons have style with these two triggers.
So now to my question.
If I have following new Style:
<Style x:Key="BigButton" TargetType={x:Type RadioButton}" based on="{StaticResource BigButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType={x:Type RadioButton}">
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="true">
<Setter Property="Background" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Style>
With this style it overwrites the previous Template Setter.
So my question is:
Is there a way to NOT overwrite the previous Template Setter and only add the trigger in the new Style?
I hope you can help me.
If there are missing information please write it
Greetings
Richard
What I have tried:
Based On
Tried to get the triggers out of the controltemplate