简体   繁体   English

WPF扩展工具包PropertyGrid-组成SelectedObject

[英]WPF Extended Toolkit PropertyGrid - Compose SelectedObject

I have a Settings class that is bound to a WPF Extended Toolkit PropertyGrid's SelectedObject property. 我有一个绑定到WPF扩展工具包PropertyGrid的SelectedObject属性的Settings类。 The Settings class is composed of two other classes: DisplaySettings and IOSettings. Settings类由另外两个类组成:DisplaySettings和IOSettings。 I would like these two classes to appear as separate categories in the PropertyGrid and would like their properties to be displayed as subitems under these categories. 我希望这两个类在PropertyGrid中显示为单独的类别,并希望它们的属性在这些类别下显示为子项。 However, when the PropertyGrid is displayed, the properties of these sub-classes are not displayed. 但是,当显示PropertyGrid时,不会显示这些子类的属性。 Only the class names are displayed with the full class name as their values. 仅显示类名,并以完整的类名作为其值。

How do I get the properties of these sub-classes to be displayed in the PropertyGrid? 如何获取这些子类的属性以显示在PropertyGrid中?

子类PropertyGrid屏幕截图

You should add ExpandableObject attribute to properties. 您应该将ExpandableObject属性添加到属性。 This attribute lives in Xceed.Wpf.Toolkit.PropertyGrid.Attributes namespace. 此属性位于Xceed.Wpf.Toolkit.PropertyGrid.Attributes命名空间中。

...
[ExpandableObject]
public CDisplaySettings CDisplaySettings { get; set; }
[ExpandableObject]
public CIOSettings CIOSettings { get; set; }
...

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

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