简体   繁体   English

MahApps Metro和DataGridExtensions

[英]MahApps Metro and DataGridExtensions

In a project that I am starting I am using the 2 following libraries: 在我启动的项目中,我正在使用以下2个库:

MahApps.Metro - http://mahapps.com/MahApps.Metro/ MahApps.Metro- http: //mahapps.com/MahApps.Metro/

DataGridExtensions - https://datagridextensions.codeplex.com/ DataGridExtensions- https://datagridextensions.codeplex.com/

DatagridExtensions has some pretty nice datagrid filtering tools. DatagridExtensions有一些非常不错的datagrid过滤工具。 The only problem is that using it removes the Metro style from the datagrid. 唯一的问题是使用它会从数据网格中删除Metro样式。 Is there any way I can keep the Metro Styling on the datagrid and use the extensions. 有什么办法可以将Metro Styling保留在数据网格上并使用扩展名。

The only .xaml file I could find in the DataGridExtensions library was the generic.xaml file. 我可以在DataGridExtensions库中找到的唯一.xaml文件是generic.xaml文件。 I modified this to include BasedOn in any styles in there, as this has worked in the past: 我将其修改为在其中包含任何样式的BasedOn,这在过去一直有效:

eg 例如

<Style TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}>

Setting a default header style solved the problem for me: 设置默认标题样式可以为我解决问题:

<Style TargetType="{x:Type DataGridColumnHeader}"
       BasedOn="{StaticResource MetroDataGridColumnHeader}" />

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

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