Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove a trigger in a BasedOn Style?

<Style x:Key="originalStyle" TargetType="TextBox">
    ...setters...
    <Style.Triggers>
        <DataTrigger Binding="{Binding yyy}" Value="1">
            <Setter Property="FontSize" Value="{DynamicResource xxx}"/>
        </DataTrigger>
    </Style.Triggers>
</Style>

I like everything in the Style except for the DataTrigger which I want to remove. How can change it?

<Style x:Key="derivedStyle" BasedOn="{StaticResource originalStyle}">
   ...How to remove the DataTrigger???....
</Style>
like image 953
tofutim Avatar asked Oct 16 '25 13:10

tofutim


1 Answers

You could make a "base style" containing all the common stuff, and create two styles BasedOn that style.

like image 79
Olav Haugen Avatar answered Oct 18 '25 07:10

Olav Haugen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!