开始使用 MVC 创建大型 C# 应用程序的最佳方法是什么?

发布于 2024-10-18 03:06:12 字数 52 浏览 2 评论 0原文

我们想要创建一个使用 MVC 设计模式的大型 C# 应用程序。有人可以指导我们如何开始吗?

We want to create a huge C# application that uses MVC design pattern. Could somebody guide us how do we start?

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

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

发布评论

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

评论(1

莫相离 2024-10-25 03:06:12

如果您计划在 Winforms 中执行此操作,我建议您转向 WPF。

我曾经/现在处于完全相同的情况,我正在为一位非常知名的客户建立一个 LOB。

我用 win-forms 制作了模型,然后我意识到我需要一个合适的框架,我环顾四周,没有找到太多东西,并尝试编写自己的 MVC 框架,但结果一团糟。

以下是我发现的一些 win-form mvc 内容:
https://stackoverflow.com/questions/2406/looking-for-a- mvc-sample-for-winforms
寻找干净的 C# WinForms MVC 教程
如何在 Windows 窗体应用程序中实现 MVC?
使用 Windows 窗体实现 MVC

我上周刚刚迁移到 WPF,我很高兴,我并不是说不可能实现一个好的 Windows 窗体应用程序。我确信有大量的 Windows 窗体应用程序。

我只是说,如果您是从头开始并且负担得起,请考虑 WPF。这绝对对我有帮助。

以下是 WPF 如何帮助实现良好的 UI 分离:

  1. XAML 中的视图可以自定义和数据绑定,并且与逻辑完全分离。 (与 Windows 窗体代码隐藏相反)
  2. WPF 支持 MVVM 模式,它简洁明了,并且不需要庞大的框架。 (我已经在一个小型 Silverlight 应用程序中非常成功地使用了它)请查看 MVVM Light Toolkit尽管有时您甚至不需要框架。
  3. WPF 确实允许您制作外观精美(专业)的应用程序,我不是在谈论养眼的应用程序,例如在 WPF 中制作选中的列表框或树视图网格非常简单。您以后可以随时升级您的应用程序以支持增强的外观等。

这只是我上个月自己的经验的 2 美分,好吗!? =)

If you are planning to do this in Winforms I would suggest moving to WPF.

I was/and currently am in the exact same situation, I'm building an LOB for a very high profile client.

I made mockups in win-forms, then I realized I was going to need a proper framework, I looked around and didn't find much and tried writing my own MVC framework which was a horrendous mess.

Here are some win-form mvc stuff I found:
https://stackoverflow.com/questions/2406/looking-for-a-mvc-sample-for-winforms
Looking for clean WinForms MVC tutorial for C#
How would you implement MVC in a Windows Forms application?
Implementing MVC with Windows Forms

I just made the move to WPF last week and I'm pretty happy, I'm not suggesting that it is impossible to implement a good Windows Forms app. I'm sure there are huge Windows Forms apps out there.

I'm merely saying if you are starting from scratch and if you can afford it, do consider WPF. It definitely helped me.

Here is how WPF helps with good UI separation:

  1. Views in XAML can be customized and data bound and are completely separate from logic. (As opposed to windows forms code behind)
  2. WPF supports the MVVM pattern, its neat and simple, and doesn't require huge frameworks. (I've used it in a tiny Silverlight app very successfully) Do have a look at the MVVM Light Toolkit Although sometimes you won't even need a framework.
  3. WPF does allow you to make good (professional) looking apps, I'm not talking eye candy, for example a checked Listbox, or a treeview-grid is quite simple to make in WPF. You can always upgrade your app later to support enhanced looks etc.

This is just my 2 cents from my own experience last month ok!? =)

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