如何在基于样式中删除触发器?

4
<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>

我喜欢这个样式的所有东西,除了我想要删除的DataTrigger。我该如何更改它?

<Style x:Key="derivedStyle" BasedOn="{StaticResource originalStyle}">
   ...How to remove the DataTrigger???....
</Style>
1个回答

4
你可以创建一个包含所有常用内容的“基础样式”,并创建两个基于该样式的样式BasedOn

如果您无法控制要基于哪种样式(例如基于VsResourceKeys.ButtonStyleKey),该怎么办? - ILMTitan

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接