Reset inherited WPF style?

老子叫甜甜 提交于 2019-11-30 20:58:08
Domysee

There are 2 ways to reset the style:

  1. Set the style property of the element to {x:Null}. You will have to do this on every element.

    <Button Height="50" Style="{x:Null}"></Button>
    
  2. Define an empty style in the resources of the element containing the elements you want to reset. Don't specify BasedOn, otherwise it will inherit all properties and does not reset them to standard (as you correctly noticed).

    <Style TargetType="{x:Type DataGridColumnHeader}">
    </Style>
    
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!