WPF 应用程序与 Winform for Business 应用程序的优势?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/636028/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 20:07:10  来源:igfitidea点击:

Advantage of WPF app vs Winform for business apps?

wpfwinforms

提问by Abdu

I know asp.net and winform development. I am not the type of developer who jumps into a new technology just because it's new. It needs to give me extra benefits like higher productivity.

我知道asp.net和winform开发。我不是那种仅仅因为新技术就跳入新技术的开发人员。它需要给我额外的好处,比如更高的生产力。

What are the advantages of WPF over Winforms for pure business apps? I am not interested in the extra eye candy, animation, gradients, image display effects and so on which WPF provides. The business apps are for data entry, data reporting and maybe some charts and static display of photos.

对于纯业务应用程序,WPF 与 Winforms 相比有哪些优势?我对 WPF 提供的额外的眼睛糖果、动画、渐变、图像显示效果等不感兴趣。商业应用程序用于数据输入、数据报告以及一些图表和照片的静态显示。

How will WPF help in these apps? Better richer data binding? WinForm is a mature proven technology and I like the fact I can do everything in Visual Studio vs multiple IDE's for WPF (VS & Blend family). Plus I think WPF doesn't have as rich data binding controls like their Winform counterparts (DataGridView..etc). AFAIK, Microsoft will still support Winforms for many years.

WPF 将如何帮助这些应用程序?更好更丰富的数据绑定?WinForm 是一种成熟的经过验证的技术,我喜欢这样一个事实,我可以在 Visual Studio 中完成所有事情,而不是针对 WPF(VS 和 Blend 系列)的多个 IDE。另外,我认为 WPF 没有像 Winform 对应物(DataGridView..etc)那样丰富的数据绑定控件。AFAIK,微软仍将支持 Winforms 多年。

Try to convince someone like me to switch.

试着说服像我这样的人转换。

回答by Brad Leach

I know asp.net and winform development. I am not the type of developer who jumps into a new technology just because it's new. It needs to give me extra benefits like higher productivity.

我知道asp.net和winform开发。我不是那种仅仅因为新技术就跳入新技术的开发人员。它需要给我额外的好处,比如更高的生产力。

For my team, WPF has proven to be much faster than WinForms to develop applications with. We recently released a mid-sized app in 32 man days. We had the advantage of an experienced WPF developer on the team, and inexperienced guys who were eager to learn the technology. There was great morale, and productivity was impressive.

对于我的团队来说,WPF 已被证明比 WinForms 开发应用程序要快得多。我们最近在 32 个工作日内发布了一个中型应用程序。我们拥有团队中经验丰富的 WPF 开发人员以及渴望学习该技术的缺乏经验的人员的优势。士气高涨,生产力令人印象深刻。

WinForm is a mature proven technology and I like the fact I can do everything in Visual Studio vs multiple IDE's for WPF (VS & Blend family).

WinForm 是一种成熟的经过验证的技术,我喜欢这样一个事实,我可以在 Visual Studio 中完成所有事情,而不是针对 WPF(VS 和 Blend 系列)的多个 IDE。

Do you consider yourself a hand-coder, or a drag-and-drop coder? If you consider yourself a drag-and-dropper, than the current crop of WPF tooling may not be suitable for you. Maybe wait for Visual Studio 2010? I work almost exclusively in XAML. Most WPF'ers will probably agree that this is the most effective way of creating WPF applications at the moment. But then, I also craft my HTML by hand, so it feels natural to me...

您认为自己是手动编码员还是拖放编码员?如果您认为自己是一个拖放工具,那么当前的 WPF 工具可能不适合您。也许等待 Visual Studio 2010?我几乎只在 XAML 中工作。大多数 WPF 用户可能会同意,这是目前创建 WPF 应用程序的最有效方法。但是,我也手工制作了我的 HTML,所以对我来说感觉很自然......

What are the advantages of WPF over Winforms for pure business apps? I am not interested in the extra eye candy, animation, gradients, image display effects and so on which WPF provides.

对于纯业务应用程序,WPF 与 Winforms 相比有哪些优势?我对 WPF 提供的额外的眼睛糖果、动画、渐变、图像显示效果等不感兴趣。

I used to think this way, but I have recently developed a business application which has gradients, basic animation and effects. These fancy features were added to enhance the user experience. Why should business apps be Battleship Grey? Why should they be unusable? Granted, it isn't color, gradients, animation that makes a business app usable, but using these effects can help the user experience, and this is what is important to me. I could have done everything I did in the WPF app in WinForms - it just would have taken much longer.

我曾经是这样想的,但我最近开发了一个业务应用程序,它具有渐变、基本动画和效果。添加这些花哨的功能是为了增强用户体验。为什么商业应用应该是 Battleship Grey?为什么它们不能使用?当然,使商业应用程序可用的不是颜色、渐变、动画,而是使用这些效果可以帮助用户体验,这对我来说很重要。我本可以在 WinForms 中的 WPF 应用程序中完成我所做的一切 - 只是需要更长的时间。

Better richer data binding?

更好更丰富的数据绑定?

The databinding support truely is amazing. It is my single most-loved feature in the platform. Check out this wonderful Databinding Cheatsheet.

数据绑定支持真的很棒。这是我在平台中最喜欢的功能。查看这个精彩的数据绑定备忘单

Try to convince someone like me to switch.

试着说服像我这样的人转换。

I have decided that I am not going to try and convince anyone else to switch to WPF. The developers I have tried to "convince" (all experienced Winforms developers) usually have struggled with the platform. They are not invested in the technology. They don't "get it". I encourage people to check out the technology to see if it is right for them as a developer. The learning curve is huge. If you learn by books, check out this SO postfor some mini-reviews on WPF books. If you learn by videos, check out the windowsclient.net WPF videos. If you learn by example, check out thisor thispost. Forget everything you know about WinForms. WPF really seems closer to ASP than WinForms. Create some sample applications. See if it works for you and your team.

我已经决定我不会试图说服其他人切换到 WPF。我试图“说服”的开发人员(所有有经验的 Winforms 开发人员)通常都在与平台斗争。他们没有投资于技术。他们不“明白”。我鼓励人们检查这项技术,看看它是否适合作为开发人员的他们。学习曲线是巨大的。如果您通过书本学习,请查看这篇 SO 帖子,了解有关 WPF 书籍的一些小评论。如果您通过视频学习,请查看windowsclient.net WPF 视频。如果您通过示例学习,请查看邮政。忘记您对 WinForms 的所有了解。WPF 看起来确实比 WinForms 更接近 ASP。创建一些示例应用程序。看看它是否适合您和您的团队。

As you are multi-skilled (asp.net/winform skills), you may see the advantage of skilling-up in WPF as it is very closely related to Silverlight. Silverlight fills that gap between your rich client applications and web applications.

由于您是多技能(asp.net/winform 技能),您可能会看到 WPF 中技能提升的优势,因为它与 Silverlight 密切相关。Silverlight 填补了富客户端应用程序和 Web 应用程序之间的空白。

I personally feel WPF is the best client side technology available for the .NET framework, and will generally avoid developing in WinForms for future work. YMMV

我个人认为 WPF 是可用于 .NET 框架的最佳客户端技术,并且通常会避免在 WinForms 中进行开发以备将来使用。青年会

Good luck with your decision.

祝你的决定好运。

回答by Orion Edwards

I have quite a bit of winforms experience and have only played with WPF a little bit, but I'm sold.

我有相当多的 winforms 经验,只玩过一点 WPF,但我被卖了。

Why?

为什么?

  • MUCH more flexibility. If you want to do anything non-standard in winforms, pain and suffering ensues, but in WPF it's simple.

  • Much better databinding

  • Easier to develop (once you understand the core concepts, which unfortunately will take a while)

  • 更大的灵活性。如果你想在 winforms 中做任何非标准的事情,痛苦就会随之而来,但在 WPF 中它很简单。

  • 更好的数据绑定

  • 更容易开发(一旦你理解了核心概念,不幸的是这需要一段时间)

回答by geofftnz

When I started looking at WPF, I treated it as "Winforms with Vector Graphics" and ran straight into the side of the learning cliff. The proper way to transition from WinForms to WPF is to take a heroic dose of whatever narcotic you can lay your hands on in order to forget everything you know, then start from scratch.

当我开始研究 WPF 时,我将其视为“带有矢量图形的 Winforms”,并直接陷入了学习悬崖的一侧。从 WinForms 过渡到 WPF 的正确方法是大剂量使用任何你可以接触的麻醉剂,以便忘记你所知道的一切,然后从头开始。

Seriously though - it's a lot cleaner and easier if you use a pattern such as Model-View-ViewModel. Read more at The Orbifold, this Google Groups threadand Channel9

说真的 - 如果您使用诸如 Model-View-ViewModel 之类的模式,它会更清晰、更容易。在The Orbifold、此Google Groups 线程Channel9 上阅读更多信息

Then at some point you'll have an epiphany and start databinding everything. Your code-behind will become not much more than a call to InitializeComponent().

然后在某个时候你会有一个顿悟并开始数据绑定一切。您的代码隐藏将只不过是对 InitializeComponent() 的调用。

回答by Wayne H

Thanks for the post. My company has tons of time invested in WinForms. I can't imagine getting a medium sized application out in 32 man days; our certification periods are months on end and release cycles sometimes yearly or longer (despite sticking as close to an Agile development philosophy as we can), such is the nature of the applications we develop.

谢谢你的帖子。我的公司在 WinForms 上投入了大量时间。我无法想象在 32 个工作日内推出一个中等规模的应用程序;我们的认证周期是几个月,发布周期有时是一年或更长(尽管我们尽可能坚持敏捷开发理念),这就是我们开发的应用程序的性质。

I just played with WPF for the first time and found I can get some benefits of WPF in WinForms by using ElementHost. I extended a WPF TextBox, then wrapped my extended class in a Win Forms UserControl and now have a WinForms app using that WPF text box, complete with spell check support.

我只是第一次玩 WPF,发现使用 ElementHost 可以在 WinForms 中获得 WPF 的一些好处。我扩展了一个 WPF 文本框,然后将我的扩展类包装在一个 Win Forms UserControl 中,现在有一个使用该 WPF 文本框的 WinForms 应用程序,并带有拼写检查支持。

I'm impressed to see Microsoft thought of this (hosting WPF in WinForms and vice versa), since I really can't see my company moving to WPF unless we can transition over a long period of time; there's just too much invested in WinForms to start again. With my recent experience I may begin to talk to some other developers about my recent experience and see what their thoughts are. I think WPF will take some time getting used to and that seems consistent with other comments.

看到 Microsoft 想到这一点(在 WinForms 中托管 WPF,反之亦然),我印象深刻,因为除非我们能够在很长一段时间内进行过渡,否则我真的无法看到我的公司转向 WPF;对 WinForms 的投资太多了,无法重新开始。根据我最近的经历,我可能会开始与其他一些开发人员谈论我最近的经历,看看他们的想法。我认为 WPF 需要一些时间来适应,这似乎与其他评论一致。

回答by Andrew Grant

Not quite a duplicate but you may find this post helpful about the benefits of WPF aside from the new graphics bits.

不完全重复,但您可能会发现这篇文章对 WPF 除了新图形位之外的好处有所帮助。

WPF or WinForms for internal tools?

用于内部工具的 WPF 或 WinForms?

回答by Jobi Joy

Just check this search results right here in Stackoverflow to get numerous answers. https://stackoverflow.com/search?q=WPF+Winforms

只需在 Stackoverflow 中查看此搜索结果即可获得大量答案。 https://stackoverflow.com/search?q=WPF+Winforms

回答by Webjedi

Imagine if you could use the same UI(XAML) from your ASP.NET/(Silverlight) page with your desktop app. You'd only build it once but wire it to either....that's one of the intents of WPF/XAML...are we really there yet? Not yet but getting closer.

想象一下,如果您可以在桌面应用程序中使用来自 ASP.NET/(Silverlight) 页面的相同 UI(XAML)。您只需要构建一次,然后将其连接到任何一个......这是 WPF/XAML 的意图之一......我们真的到了吗?还没有,但越来越近了。