<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>
最佳答案
您可以制作一个包含所有常见内容的“基本样式”,并创建两种样式 BasedOn
该样式。
关于c# - 如何删除 BasedOn 样式中的触发器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6310711/