WPF 复合应用程序

发布于 2024-09-02 08:01:37 字数 202 浏览 1 评论 0原文

我是 WPF 应用程序的新手,正在开发一个新的 WPF 应用程序,它可以执行 4 种不同的操作(4 个不同的模块)。

我在谷歌上搜索并发现了有关 WPF 复合应用程序的信息。

我正在阅读 msdn 文章,但有一些不同的地方,但所有应用程序都非常大,因此理解它们有点困难。

有谁有一个非常简单的 WPF 复合应用程序或任何我可以找到它的链接吗?

I am new to WPF application and are developing a new WPF application which does 4 different things (4 different modules).

I was googling around and found regarding WPF composite application.

I was reading through the msdn articles but and a few a different place but all the apps are very large and so understanding them is a bit difficult.

Has anyone got a very simple WPF composite application or any link where i can find it out?

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

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

发布评论

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

评论(2

み零 2024-09-09 08:01:37

你的问题很广泛,但我会尽力给你一些提示。

这只是我的 0.02 美元,因为我最近遇到了类似的挑战。

首先,不要将其视为 WPF 复合应用程序,而是将其视为您希望反映到 WPF 窗口上的复合应用程序。有很大的不同。组合的每个模块都应该是一个独立的、功能齐全的单元——稍后您可以将某些功能绑定到 WPF 控件。如果您尝试从头开始设计它以使用且仅使用特定的 WPF 界面,那么您将进入一个难以重构和不可测试的痛苦世界。

研究用于 WPF 应用程序设计的模型-视图-ViemModel (MVVM) 方法。为每个模块创建一个 ViewModel —— 这是一个适配器类,它将模块(MVVM 中的“模型”)的功能公开给 WPF 控件(MVVM 中的“视图”)。

我建议你做如下的事情:

  1. 为每个类设计独立的类
    4 个模块。

  2. 创建4个Visual Studio“测试
    测试每种方法的项目”
    您的模块。

  3. 创建 4 个实例化的 ViewModel
    对您的模块的单一引用
    并公开它们的功能,
    即使这些 ViewModel 看起来
    一开始是多余的。

  4. 创建 4 个 WPF 用户控件
    实例化您的 ViewModel。

  5. 研究 WPF 数据绑定,让您的 UserControl 通过且仅通过其各自的 ViewModel 访问您的模块。

    研究 WPF 数据绑定,并让您的

每个步骤都非常广泛,需要大量工作,但是一旦您了解具体细节,这里有很多内容可以帮助您完成每一步:D

祝您好运!

Your question is very broad, but I'll try to give you a few tips.

This is just my $0.02USD since I've reacently approached a similar challenge.

First thing, don't approach this as a WPF composite application, think of it as a composite application that you wish to reflect onto a WPF window. There's a big difference. Each module of your composite should be a self contained, and fully functional unit -- later you can tie some of the functionality to WPF controls. If you try to design this from the ground up to work with and only with a certain WPF interface, you're entering a world of pain with difficult refactoring and untestability.

Research the Model-View-ViemModel (MVVM) approach to WPF application design. For each of your modules create a ViewModel -- which is an adapter class that exposes the functionality of your module ("Model" in MVVM) to a WPF control ("View" in MVVM).

I would suggest you do something like the following:

  1. Design independent classes for each
    of your 4 modules.

  2. Create 4 Visual Studio "Test
    Projects" that test each method of
    your modules.

  3. Create 4 ViewModels that instantiate
    a single reference to your modules
    and exposes their functionality,
    even if these ViewModels seems
    redundant at first.

  4. Create 4 WPF UserControls that
    instantiate your ViewModels.

  5. Research WPF data binding and have your UserControls access your modules through and only through their respective ViewModels.

Each of these steps are very broad and will take lots of work, but there are plenty around here that will help you each step of the way once you get into the specifics :D

Good luck!

你如我软肋 2024-09-09 08:01:37

WPF/Silverlight - Prism - 初学者资源

我开始使用以下代码开发一个小型应用程序WPF 和棱镜。 msdn 文章帮助了我,并查看了上面的 stackoverflow 问题。

WPF/Silverlight - Prism - Resources for beginners

I started developing a small app using WPF and PRISM. The msdn article helped me and the have look at the above stackoverflow question..

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