简体   繁体   English

如何停止MahApps.Metro覆盖基本控件的样式

[英]How to Stop MahApps.Metro Overriding Styles for Basic Controls

All, I have started using MahApps.Metro but some controls that this library overrides ( GroupBox for example) are, to me, a little too rambunctious. 所有,我已经开始使用MahApps.Metro了,但是这个库覆盖的一些控件(例如GroupBox )对我来说有点过于蛮横。

My question is sinple: if I want to stop MahApps.Metro overriding the style of a certain control, what can I do? 我的问题是sinple: 如果我想阻止MahApps.Metro覆盖某个控件的风格,我该怎么办?

I have attempted to fix this for a DataGrid by overriding the DataGrid creating my own public class SomeDataGrid : DataGrid and this allows me to use this control as WPF default. 我试图解决这一问题的DataGrid通过重写DataGrid创造我自己的public class SomeDataGrid : DataGrid ,这允许我使用这个控制,WPF默认。 However, to do this for ALL the controls is non-ideal. 但是,为所有控件执行此操作是不理想的。

Thanks for your time. 谢谢你的时间。

For the control, which you do not want to overwrite the style, set style null : 对于您不想覆盖样式的控件,请设置样式null

<ProgressBar Style="{x:Null}" Width="300" Height="30" IsIndeterminate="True" />

This construction set the Style for the control's default value. 此构造将Style设置为控件的默认值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM