WPF Extended Toolkit PropertyGrid: Change font color in rows and search box

北战南征 提交于 2019-12-12 04:23:47

问题


I am using the WPF Extended Toolkit PropertyGrid in a WPF app which also uses MahApps.

I have set the application theme to BaseDark.

When I display PropertyGrid, the text in the first column of the grid and in the Search textbox is white on a white background.

I would like to change the Foreground color of this text to black.

I have tried applying this Foreground color to various target controls (i.e. TextBlock, TextBox, DataGridCell) in PropertyGrid.Resources.Style but this has not changed these particular texts.

What should I do to achieve this?


回答1:


You can find the appropriate Keys in the MahApps Colors section, TargetTypes through elimination

<pg:PropertyGrid.Resources>
    <!--TextBox-->
    <SolidColorBrush x:Key="TextBrush" Color="Black" />
    <!--Label-->
    <SolidColorBrush x:Key="LabelTextBrush" Color="Black" />
    <!--TextBlock-->
    <SolidColorBrush x:Key="BlackBrush" Color="Black" />
<pg:PropertyGrid.Resources/>


来源:https://stackoverflow.com/questions/38487407/wpf-extended-toolkit-propertygrid-change-font-color-in-rows-and-search-box

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!