什么是WPF和它如何比较的WinForms? [英] What is WPF and how does it compare to WinForms?

查看:151
本文介绍了什么是WPF和它如何比较的WinForms?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直期待在WPF,但我从来没有真正在它的工作(除15分钟,促使这个问题)。我看着这个帖子,但其真正了解的闪光一个WPF。因此,Windows窗体应用程序和WPF应用程序之间的区别是什么呢?

I've been looking at WPF, but I've never really worked in it (except for 15 minutes, which prompted this question). I looked at this post but its really about the "Flash" of a WPF. So what is the difference between a Windows Forms application and a WPF application?

推荐答案

WPF是基于矢量图形用户界面表现层的WinForms不是。这是为什么重要/有趣吗?由是基于矢量的,它允许表示层顺利地缩放UI元素到任何尺寸不失真。

WPF is a vector graphics based UI presentation layer where WinForms is not. Why is that important/interesting? By being vector based, it allows the presentation layer to smoothly scale UI elements to any size without distortion.

WPF也是组合的演示系统,这意味着几乎任何UI元素可以由任何其他用户界面元素组成。这使您可以轻松地建立从简单的那些复杂的UI元素。

WPF is also a composable presentation system, which means that pretty much any UI element can be made up of any other UI element. This allows you to easily build up complex UI elements from simpler ones.

WPF也完全绑定知道,这意味着你可以在UI元素的任何属性绑定到.NET对象(或对象的属性/方法),另一种UI元素,或数据的一个属性。是的,的WinForms支持数据绑定,但在一个更有限的方式。

WPF is also fully databinding aware, which means that you can bind any property of a UI element to a .NET object (or a property/method of an object), a property of another UI element, or data. Yes, WinForms supports databinding but in a much more limited way.

最后,WPF是更换皮肤或主题化,这意味着,作为一个开发者可以使用列表框,因为这些都是你所需要的行为,但有人能皮肤它看起来像完全不同的东西。

Finally, WPF is "skinable" or "themeable", which means that as a developer you can use a list box because those are the behaviors you need but someone can "skin" it to look like something completely different.

想想图像列表框。你想要的内容实际上是形象,但你仍然希望列表框的行为。这完全是微不足道的,只需使用一个列表框和更改内容呈现到包含一个图像,而不是文字在WPF做。

Think of a list box of images. You want the content to actually be the image but you still want list box behaviors. This is completely trivial to do in WPF by simply using a listbox and changing the content presentation to contain an image rather than text.

这篇关于什么是WPF和它如何比较的WinForms?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆