[英]How to change background/Foreground in an Extended Toolkit PropertyGrid
I have a Extended Wpf Toolkit propertyGrid: 我有一个扩展的Wpf Toolkit propertyGrid:
<wpg:PropertyGrid x:Name="pg" Width="450" Height="300" Margin="10" ShowSearchBox="False" Background="Transparent" >
and here is what it looks like: 这是它的样子:
So it's pretty clear that the background doesn't entails the rows which are therefore independent. 因此,很明显,背景并不意味着行是独立的。
That said I have seen that by adding 那就是说我已经看到了
<wpg:PropertyGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="Red" />
</wpg:PropertyGrid.Resources>
I am able to change some of the lines (not all) but I need to do that programmatically through code-behind. 我可以更改某些行(不是全部),但是我需要通过后台代码以编程方式进行更改。
This is what I'd like to achieve: 这是我想要实现的:
Thanx 谢谢
Styling the WPF PropertyGrid has an example at: WPF PropertyGrid的样式在以下位置有一个示例:
https://gist.github.com/Tide https://gist.github.com/Tide
Save the PropertyGrid.xaml to your project, and in App.xaml add 将PropertyGrid.xaml保存到您的项目中,然后在App.xaml中添加
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="PropertyGrid.xaml" />
</ResourceDictionary.MergedDictionaries>
inside: 内:
<ResourceDictionary>
</ResourceDictionary>
Probably the best approach is using a Theme as shown on the old CodePlex site: 最好的方法可能是使用旧CodePlex网站上显示的主题:
https://wpfpropertygrid.codeplex.com https://wpfpropertygrid.codeplex.com
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.