Is there a Property Dialog control that i can use in my WPF App?

微笑、不失礼 提交于 2019-11-29 03:08:32

问题


I'm building an application using WPF that will be a designer of sorts, meaning, a user can drag and drop custom UI elements into a canvas and be able to configure their behavior via properties.

(Think of this like a domain specific PowerPoint. You can add elements to the presentation, configure the elements' properties and then eventually you can run the "slideshow" and those elements will behave according to their properties)

So in my app, what is the best way of showing and configuring an element's properties? Is there a Property Dialog control I can use? (similar to the one in Visual Studio for controls)


回答1:


Sadly, there is no PropertyGrid control in WPF. Either you will have to use WinForms property grid or one available in open source community or buy from 3rd party vendors. You have following options to choose from -

Open Source -

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

In case you are working on .Net 4.0 you can use WWF's PropertyInspectorView control as property grid in WPF. As explained in this article - http://www.codeproject.com/KB/grid/WpfPropertyGrid.aspx

3rd party :

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

Custom -

In Case you want to build your own PropertyGrid, have a look at these articles -

(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




回答2:


You need to use a propertygrid for this. See these posts for how to create one.

Limitations of using .NET 2.0 (Windows Forms) controls in WPF?

wpf propertyGrid



来源:https://stackoverflow.com/questions/3800416/is-there-a-property-dialog-control-that-i-can-use-in-my-wpf-app

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