4

我熟悉使用 C# 在 ASP.NET MVC 中创建网站。但我从未学习过如何使用 C# 创建桌面应用程序。所以我想进一步研究一下。自从我对 ASP.NET 有经验以来,我几乎涵盖了后端。但是我不知道什么时候涉及到前端开发。我猜微软提供了几种创建桌面应用程序的方法(表单、MVC、...),就像 java 提供不同的包一样。但是当我打开 Visual Studio 时,我看到的只是创建 Windows 窗体应用程序的可能性。

  1. 在 C# 中创建 Windows 桌面应用程序有哪些可能性(Windows 窗体、mvc?)
  2. 哪个被认为是“最好的”/“最普遍的”?
  3. 有什么推荐的教程、指南或免费电子书吗?
  4. 任何其他建议总是受欢迎的。
4

4 回答 4

6

如果您使用的是大多数人都使用的 Visual Studio,那么这是一个艰难的选择。

WinForms非常适合不需要过多自定义边框、背景等设计的快速项目,因为它使用了 Microsoft 相当旧的表单(它们已经在视觉上进行了很多改进并且明显调整了)它们有很多限制(例如在文本字段等内容上没有填充),但如果您只想要一个具有干净 UI 的常规应用程序,它们仍然看起来不错并且很好。

If you want a dynamic one which is easier to adjust and much more customisable, and also separates design from code using XAML, you definitely want WPF. Sadly you'll need to put in a decent amount of time to learn XAML fluently.

So to sum up, if you want a quick project that looks nice, and you don't want to learn XAML, WinForms If you want to spend a little longer to make it more visually attractive and customisable (Mostly on the coding end, not the end user's), it's got to be WPF.

Another advantage of WPF is that, like I said, it separates design and code, so you could collaborate with a designer at some point on the future. There's also hard-coded WPF as far as I know, but most people use XAML.

Also, I've never looked this up, but I'd give a good guess it's much easier to get a job with experience in WPF as opposed to WinForms in a professional environment due to the design/code seperation

于 2012-04-04T14:09:56.790 回答
4

我推荐 WPF 而不是 WinForms,而 MVVM 模式最适合。

WPF 比 WinForms 更现代、更强大和更灵活,WinForms 在技术上并没有过时,但没有那么有前途(可能类似于 WebForms)。XAML 技能对于 Silverlight 和 Metro 应用程序开发非常有用。

至于 WPF / MVVM 资源 - 互联网上的大量资源。首先,看看Prism 框架

比较 MVC 和 MVVM 模式以及它们各自的 ViewModel - 也是一本不错的读物。

于 2012-04-04T14:03:39.503 回答
2

我主张相反。与 WinForms 相比,WPF 有很多东西要学。一旦你掌握了后者,就一定要进步到前者。另外,请获取 Adam Nathan 的书 'Windows Presentation Foundation Unleashed',因为这将有助于您顺利完成任务。

于 2012-04-04T14:06:13.217 回答
0
  1. 是的,winform,wpf都用了,ms的mvc没有,是ms的web应用的pattern
  2. 是的,拖钓最有帮助
  3. 是的,我大部分时间都在使用谷歌教程。我从http://asp.net网站学习 asp.net
于 2012-04-04T14:06:49.650 回答