切换到 WPF。时间到了吗?

发布于 2024-08-11 19:16:53 字数 126 浏览 5 评论 0原文

我正在考虑从 MFC 切换到 WPF。

我首先担心的是,有太多用户尚未安装带有 WPF 的 .NET。有人可以指出包含 WPF 渗透率数字的来源吗?

我的第二个问题是速度。

还有其他考虑吗?

I'm considering switching from MFC to WPF.

My first concern is that there are too many users who don't have .NET with WPF installed yet. Can anybody point to a source containing the WPF penetration numbers?

My second concern is speed.

Any other considerations?

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

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

发布评论

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

评论(6

诺曦 2024-08-18 19:16:53

我已经研究 WPF 一段时间了。它很出色,但它仍然有(偶尔的)漏洞,你必须自己堵上。然而,所有迹象都表明 .NET 4.0 将是向前迈出的重要一步。

我想说现在就开始。 WPF 的学习曲线非常陡峭,相信我,您需要一段时间才能向用户发布软件。也帮自己一个忙,获取WPF Unleashed一书。是比较优越的

速度不是考虑因素。 WPF 提供的强大功能完全值得任何速度方面的缺点,而速度方面的缺点(来自 Windows 窗体)老实说我还没有注意到。

I've been banging away at WPF for a while now. It is brilliant, but it still has (occasional) holes you've to plug yourself. However all indications are .NET 4.0 will be a significant step forward.

I would say start now. The WPF learning curve is REALLY steep, and it'll be a while before you'll be releasing software to users, believe me. Also do yourself a favour and get the WPF Unleashed book. It's superior.

Speed isn't a consideration. The power WPF gives is well worth any drawbacks with speed, which - coming from Windows Forms - I haven't noticed to be honest.

萌梦深 2024-08-18 19:16:53

您正在开发什么样的应用程序?如果您希望您的祖母安装一个广泛发行的桌面应用程序,那么您对 ​​.NET 3.0/3.5 采用的担忧是合理的。到目前为止,就我所见,性能并不是那么令人担忧。

What kind of application are you developing? If it's a wide-distribution desktop app that you want your grandmother to install, your concern about .NET 3.0/3.5 adoption is valid. So far from what I've seen, performance is less of a concern.

梦罢 2024-08-18 19:16:53

WPF渗透率

首先,Windows Vista和Windows 7都预装了WPF,占自动获得 35% 的市场。 Windows XP 已经拥有它,就像三年多以来,.NET Framework 3.0 作为 Windows Update 中的一个选项一样,并且许多应用程序都附带它,因此它也可能安装在很高比例的 Windows XP 计算机上。 StatOwl 指出大约 80% 的 NET Framework 安装是版本 3 或更高版本。

如果您以 CD 形式提供,那么在 CD 上包含最新的 .NET Framework 并自动安装它并没有什么大不了的。如果用户正在下载您的应用程序,它可以联系 Microsoft 的 Web 服务器来下载并安装最新的 .NET Framework。如果您希望人们能够直接从 Web 浏览器启动其应用程序而无需安装它,则在线 ClickOnce 部署也具有此功能。

因此,底线是,您可能不需要担心人们的计算机上是否安装了 WPF,除非您的目标市场主要由 Windows XP 上的拨号客户组成,他们不运行太多第三方软件(即,它们只运行 Windows 和您的应用程序)。

速度

不是问题。我有一台 1998 年生产的 200 MHz Pentium Pro,具有 384 MB RAM,我在上面测试我的软件,并且我的 WPF 应用程序具有与同等 MFC 应用程序相当的性能。如果您的 WPF 应用程序使用大量精美的图形和动画,它将在古老的 CPU 和显卡上运行缓慢,但具有相同功能的普通 MFC 应用程序也会如此。

WPF penetration

First of all, Windows Vista and Windows 7 both have WPF preinstalled, which accounts for 35% of the market automatically. Windows XP has had it as it had .NET Framework 3.0 as an option in Windows Update for over three years, and many applications ship with it, so it is likely to also be installed on a high percentage of Windows XP machines. StatOwl indicates that about 80% of NET Framework installations are version 3 or above.

If you're shipping on CD it is no big deal to include the latest .NET Framework on the CD and have it install automatically. If users are downloading your application, it can contact Microsoft's web server to download and install the latest .NET Framework. Online ClickOnce deployment also has this capability if you want people to be able to start their application directly from the web browser without installing it.

So the bottom line is, you probably don't need to worry about whether people will have WPF installed on their machines or not unless your target market consists primarily of dial up customers on Windows XP who don't run much third-party software (i.e., they just run Windows and your application).

Speed

Not an issue. I have a 200 MHz Pentium Pro with 384 MB RAM from 1998 that I test my software on, and my WPF applications have comparable performance with equivalent MFC applications. If your WPF application uses lots of fancy graphics and animation it will run slowly on ancient CPUs and graphics cards, but so would an ordinary MFC application with the same features.

孤君无依 2024-08-18 19:16:53

如果您在接下来的一两年内坚持使用 Visual Studio 2008,甚至不必尝试使用 WPF。这段经历将会非常痛苦。我说的是“我的 IDE 再次崩溃”类型的痛苦。

如果您打算在不久的将来使用 VS 2010,那么 WPF 是一个很好的选择。下载测试版,CodePlex 上的几个主题可以开始播放。一旦你克服了(巨大的)学习曲线,我想你会发现它非常有趣。

Don't even bother trying to use WPF if you are sticking with Visual Studio 2008 for the next year or two. The experience will be way too painful. I'm talking about "my IDE crashed again" type of pain.

If you are going to use VS 2010 in the near future, then WPF is a blast. Download the beta, a couple of themes off CodePlex, are start playing. Once you get past the (freaking huge) learning curve I think you will find it to be quite enjoyable.

你丑哭了我 2024-08-18 19:16:53

恕我直言,您应该等待 Visual Studio 2010 和 WPF 4.0 进行实际迁移。他们将弥补产品中一些非常恼人的差距。

同时,你也可以尝试一下。 好得多

在编码/可读性方面——它会比 MFC = ) 对于性能和平台——这不应该成为问题,除非您有任何非常特殊的情况(例如您不能要求用户安装.NET)。

另请参阅有关从 Windows 窗体切换到 WPF 的相关问题

IMHO, you should wait for Visual Studio 2010 and WPF 4.0 to make the actual migration. They will close some very annoying gaps in the product.

Meanwhile, you can try it out. In terms of coding/readability -- it's going to be WAAAY better than with MFC =)

As for the performance and platform -- it shouldn't be a problem unless you have any very special circumstances (like if you can't require users to install .NET).

Also see this related question on switching to WPF from Windows Forms.

十雾 2024-08-18 19:16:53

如果您正在考虑更大的模块化应用程序,我建议您查看 Prism。它本身有点复杂,但在掌握 C#、依赖属性和 XAML 后,您应该能够解决它。另外,学习 Prism 让我对 WPF/Silverlight 有了更好的理解,至少从开发/绑定方面来说是这样。

Mike Taulty 在 Prism 上发布了精彩的 10 部分视频系列。这是了解平台的好方法。

我还推荐从 入门 Codeplex 上的页面。毕竟,您可能已经准备好处理下载附带的参考实现。

我之前的回答也可能有助于消除任何剩余的困惑您可能拥有的框架中的控制器/演示者(我有)。

If you are thinking about a larger, modular, appliation I recommend checking out Prism. It's a bit of a beast itself, but you should be able to tackle it after coming to grips with C#, Dependency Properties and XAML. Plus, learning Prism gave me a much better understanding of WPF/Silverlight, at least from the development/binding side.

Mike Taulty posted an excellent 10 part video series on Prism. It's a great way to get your head around the platform.

I'd also recommend the pages linked to from the Getting Started page on codeplex. After all that, you're probably ready to tackle the Reference Implementation which comes with the download.

A previous answer of mine might also help clear up any remaining confusion around Controllers/Presenters in the framework that you might have (I did).

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