简体   繁体   English

使用WPF和MVVM实现大型设置对话框的方法

[英]Ways to implement large settings dialog with WPF and MVVM

I am building an extensible WPF + MVVM application that will possibly have a significant number of user settings (from both core of the application and plugins). 我正在构建一个可扩展的WPF + MVVM应用程序,它可能具有大量的用户设置(来自应用程序和插件的核心)。 From my previous experience I can tell that managing options dialogs is pain when the application grows. 根据我以前的经验,我可以看出,管理选项对话框在应用程序增长时很痛苦。 Are there any best practices or design patterns that I could follow? 我可以遵循哪些最佳实践或设计模式? How other applications like Visual Studio implement options dialogs with large number of categories and settings? Visual Studio等其他应用程序如何实现具有大量类别和设置的选项对话框? Are these dialogs generated at runtime? 这些对话框是在运行时生成的吗?

Thanks! 谢谢!

I have had a similar issue in the past, and went for the PropertyGrid in the Extended WPF Toolkit . 我过去遇到过类似的问题,并在Extended WPF Toolkit中找到了PropertyGrid

This lets you bind the grid to an object, containing all of your configurable properties and will auto-populate the grid based on those properties. 这使您可以将网格绑定到包含所有可配置属性的对象,并根据这些属性自动填充网格。 You can provide templates for custom editors too. 您也可以为自定义编辑器提供模板。

从包含很少项目的对话框开始,因此稍后更容易添加更多项目,而不需要用户搜索更改的位置(甚至在其他分割的对话框中找到它)。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM