简体   繁体   English

如何在扩展工具包PropertyGrid中更改背景/前景

[英]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.

相关问题 扩展的WPF工具包PropertyGrid PasswordEditor - Extended WPF Toolkit PropertyGrid PasswordEditor 扩展的WPF工具包PropertyGrid IsExpandable模板 - Extended WPF Toolkit PropertyGrid IsExpandable Template 将ViewModel直接绑定到扩展WPF工具包PropertyGrid - Binding a ViewModel directly to an Extended WPF Toolkit PropertyGrid 具有自定义属性的扩展WPF工具包PropertyGrid - Extended WPF Toolkit PropertyGrid with Custom Attributes WPF扩展工具包PropertyGrid-组成SelectedObject - WPF Extended Toolkit PropertyGrid - Compose SelectedObject 在使用PropertyGrid的CollectionEditor(扩展的WPF工具包)时,如何填充出现的CollectionControlDialog? - How to populate the CollectionControlDialog that comes up when using the PropertyGrid's CollectionEditor (Extended WPF Toolkit)? 如何使用 C# 中的另一个(嵌套)编辑器为扩展 WPF 工具包 PropertyGrid 创建自定义属性编辑器? - How to create a custom property editor for Extended WPF Toolkit PropertyGrid with another (nested) editor in C#? WPF扩展工具包PropertyGrid DateTime属性更新问题 - WPF extended toolkit PropertyGrid DateTime property updating issue PropertyGrid(扩展WPF工具包)中没有xaml的多行字符串? - Multi-line string in PropertyGrid (Extended WPF toolkit) without xaml? WPF 扩展工具包 PropertyGrid - 默认展开所有属性 - WPF Extended Toolkit PropertyGrid - Expand all properties by default
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM