.net - 是否有可以在 WPF 应用程序中使用的属性对话框控件?

标签 .net wpf properties controls propertygrid

我正在使用 WPF 构建一个应用程序,该应用程序将成为各种设计器,这意味着用户可以将自定义 UI 元素拖放到 Canvas 中,并能够通过属性配置其行为。

(将此视为特定于域的 PowerPoint。您可以将元素添加到演示文稿中,配置元素的属性,然后最终您可以运行“幻灯片”,这些元素将根据其属性进行操作)

那么在我的应用程序中,显示和配置元素属性的最佳方式是什么?是否有我可以使用的属性对话框控件? (类似于 Visual Studio 中的控件)

最佳答案

可悲的是,没有 PropertyGrid WPF 中的控件。您必须使用 WinForms 属性网格或开源社区中可用的属性网格,或者从 3rd 方供应商处购买。您有以下选项可供选择 -

开源 -

WPF Property Grid: http://wpg.codeplex.com/

PropertyTools (previously called PropertyEditor) for WPF: http://propertytools.codeplex.com/

Extended WPF Toolkit PropertyGrid: https://github.com/xceedsoftware/wpftoolkit/wiki/PropertyGrid

Native WPF 4 PropertyGrid http://www.codeproject.com/Articles/87715/Native-WPF-4-PropertyGrid

WPF PropertyGrid - MVVM techniques: http://www.codeproject.com/KB/WPF/PropertyGridMVVM.aspx



如果您正在使用 .Net 4.0,您可以使用 WWF 的 PropertyInspectorView控件作为 WPF 中的属性网格。如本文所述 - http://www.codeproject.com/KB/grid/WpfPropertyGrid.aspx

第三方:

Actipro: http://www.actiprosoftware.com/products/controls/wpf/propertygrid

ComponentOne: http://www.componentone.com/SuperProducts/PropertyGridWPF/

Mindscape: http://www.mindscape.co.nz/products/WPFPropertygrid/

Syncfusion: http://www.syncfusion.com/products/wpf/property-grid



定制 -

如果您想建立自己的 PropertyGrid ,看看这些文章——

(Very) simple WPF PropertyGrid in 20 minutes: http://blog.joachim.at/?p=36

Your own PropertyGrid in a couple of hours: http://dvuyka.spaces.live.com/blog/cns!305B02907E9BE19A!448.entry

关于.net - 是否有可以在 WPF 应用程序中使用的属性对话框控件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3800416/

相关文章:

c# - DataGridComboBoxColumn 不更新模型 WPF

objective-c - 很多只读属性,什么时候初始化它们?

java - 如何在不重新部署的情况下更改weblogic中的属性值?

.net - 为什么 FontStretch 在 WPF 中不起作用?

c# - .Net: FtpWebRequest "(503) Bad sequence of commands"错误

c# - WPF 工具包 - IntegerUpDown

java - Struts 2 中 Java 类内部的验证

c# - 升级到 .Net 4.0 后出现 AccessViolationException

.net - 使用 Entity Framework 的导航属性的有意义的名称

c# - 为什么 x :Array element cause any x:Shared attribute following it to be ignored?