简体   繁体   中英

MahApps Metro and DataGridExtensions

In a project that I am starting I am using the 2 following libraries:

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

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

DatagridExtensions has some pretty nice datagrid filtering tools. The only problem is that using it removes the Metro style from the datagrid. Is there any way I can keep the Metro Styling on the datagrid and use the extensions.

The only .xaml file I could find in the DataGridExtensions library was the generic.xaml file. I modified this to include BasedOn in any styles in there, as this has worked in the past:

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}" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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