将 UI(设计器/编辑器)逻辑与包框架(如 Visual Studio 包)分离的最佳方法是什么

发布于 2024-07-07 02:30:54 字数 402 浏览 5 评论 0原文

我想在这里分开关注点。 创建自定义 XML 设计器、对象模型、验证等的所有 UI 逻辑并将其嵌入到单独的程序集中。 然后,Package 框架只需注册设计者信息并请求 UI 服务,一切就会神奇地进行。

这样,当我需要修改 UI 设计器时,我不需要使用 Package 框架(Visual Studio Package)程序集。

这个问题也适用于任何必须将 UI 逻辑与加载它的骨架框架分离的情况,例如插件。

我有多种选择:ServiceProvider 模型、插件模型或其他模型。

欢迎任何样品、图案建议、链接。

更新 1:我正在寻找的是这样的想法:“Prism(复合 WPF)符合要求吗?有人从事过像我上面提到的那样分离关注点的项目/应用程序吗?等等” (我还在寻找答案)

I want to separate concerns here. Create and embed all the UI logic for the Custom XML designer, object model, validations etc in to a separate assembly. Then the Package framework should only register the designer information and ask for a UI Service and everything works magically.

This way I don't need to play with the Package framework (Visual Studio Package) assembly, when I need to modify the UI designer.

This question also applies to anything where you have to separate the UI logic from the Skeleton framework that loads it up, like a plugin.

I have several choices a ServiceProvider model, a plugin model or may be other.

Any samples, suggestions for patterns, links are welcome.

Update 1: What I am looking for is a thought such as - "Does Prism (Composite WPF) fit the bill? Has anyone worked on a project/application which does the separation of concerns just like I mentioned above? etc"
(I am still looking out for answers)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

黑寡妇 2024-07-14 02:30:54

我创建了一个加载编辑器的 VSPackage。 编辑器位于单独的程序集中并实现我定义的接口。 VSPackage 与界面配合使用,因此只要我不更改界面,我对编辑器(及其程序集)所做的任何更改都不会影响 VSPackage。

I've created a VSPackage that loads an editor. The Editor sits in a separate assembly and implements an interface that I defined. The VSPackage works with the interface, so any changes I make to the editor (and its assembly) does not affect the VSPackage as long as I don't change the interface.

酸甜透明夹心 2024-07-14 02:30:54

您所问的接缝问题非常类似于 MVC 模式试图实现的关注点分离执行。

ASP.NET MVC 已经有了 预览版 5

它主要用于网络,但我认为他们也计划将它用于 WinForms,但我不确定。

What you're asking about seams very much like the separation of concerns that the MVC pattern tries to enforce.

ASP.NET MVC is already out there with a preview 5.

It's mainly for web but I think they are planning on using it also for WinForms, but I'm not sure.

永不分离 2024-07-14 02:30:54

我更喜欢 模型视图演示者 模式

I prefer the Model View Presenter pattern

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文