GUI 表单构建在对象上(如 Propertygrid)
我想知道,当我有一个对象并希望能够在 GUI(对话框等)中编辑它时,设计模式是什么。我正在使用 C#.NET...也许 Visual Studio 2008 也有一些集成功能?
通过使用 PropertyGrid,我可以将一个对象附加到它 (.SelectedObject)。我正在寻找类似的东西:让 gui 自动构建附加到它的对象。
任何提示都是非常受欢迎的! 问候,格雷格
I am wondering, what the design pattern is, when I have an object and want to be able to edit it in a GUI (dialogue, etc). I'm using C#.NET... Perhaps there are also some integrated features with visual studio 2008?
By using a PropertyGrid, I can attach an object to it (.SelectedObject). What I'm looking for is something similar: to let a gui automatically build about the object which is attached to it.
Any hints are most welcome!
Regards, Greg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否正在寻找一个现成的控件库来使用?
它只是文档视图(如果还有控制器,可能在 MVC 上下文中)。
唯一的特殊部分是您有一个特别动态/通用的视图(控件)。
如果你真的坚持,你可以切线提及
但这开始进入完全推测的领域。我什至可能会说“SpaghettiCodePattern”可用于实现此目的。可能会,但不一定如此。
我不认为(有)/(你正在寻找)设计模式
could it be you are looking for a ready-made control library to use?
It would be simply document-view (possibly in a MVC context if there is also going to be a controller).
The only special part is that you have a particularly dynamic/generic view (control).
If you really insist you could tangentially mention
but this starting to get in the realm of complete conjecture. I might even say that 'SpaghettiCodePattern' could be used in implementing this. It might, and it doesn't have to be.
I don't think (there is)/(you are looking) for a design pattern
如果我错了,请纠正我,但我认为 propertygrid 是基于使用反射的。
Correct me if I am wrong, but I think the propertygrid is based on using reflection.
你的问题很笼统。有一种模式称为裸对象模式,您是指类似这样的模式吗?
另请看看这些:
生成 GUI(WinForms 或 WPF)的工具来自班级
Your question is very general. There is pattern which is called naked object pattern, do you mean something like this?
Also have a look at these:
Tool to generate a GUI (WinForms or WPF) from a class