热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

WPF比winforms更“闪灵”吗?-AreWPFmore'flashy-like'thanwinforms?

Ijustinstalledvisio,andtheinstalleralmostseemedlikeitwasbuiltinflash.Thebuttonskind

I just installed visio, and the installer almost seemed like it was built in flash. The buttons kinda glowed when I hovered over them, and when I clicked on 'continue' the form phased out in a cool way.

我刚刚安装了visio,安装程序看起来就像是用flash构建的。当我在按钮上盘旋的时候,按钮就会发光,当我点击“继续”按钮时,表单就会以一种很酷的方式逐渐消失。

I'm assuming it was built in WPF.

我假设它是在WPF中构建的。

Anyhow, so are WPF more flash-like (visually speaking). Do they have new properties where you can make forms phase out nicely/smoothly compared to winforms?

无论如何,WPF也更像flash(视觉上)。与winforms相比,它们有新的属性可以让表单逐步退出吗?

4 个解决方案

#1


12  

Disclaimer: I work for Microsoft. However, I don't work on Visio, WPF, CLR or Silverlight team. So, the following is my personal take on these technologies. If you want to quote me, don't do it implying it's the official Microsoft position. :-))

免责声明:我在微软工作。然而,我并不在Visio、WPF、CLR或Silverlight团队工作。下面是我个人对这些技术的看法。如果你想引用我的话,不要暗示这是微软的官方立场。:-))

Update: Anything I say below about Flash/Flex/AIR might be wrong, as I have not worked with these technologies and what I know about them is based on what I read on the intertubes. :-) If you notice anything wrong, just shout in the comment and I'll correct it.

更新:关于Flash/Flex/AIR的任何内容可能都是错误的,因为我没有使用这些技术,而且我所了解的这些技术都是基于我在管道上读到的内容。如果你发现有什么问题,就大声说出来,我来纠正。

To the best of my knowledge, the Visio installer is not built with WPF. It's all unmanaged code; it's just people took a lot of care to make it really polished.

据我所知,Visio安装程序不是用WPF构建的。这是所有的非托管代码;只是人们花了很多功夫才把它擦得很漂亮。

WPF is the new UI platform for building standalone applications for the Windows OS. It supports a declarative UI language - XAML, and related CLR types to program against. WPF is a different platform than WinForms, although it is possible to build applications that mix UI built with both. WPF supports a lot of things that WinForms does not, like bitmap effects, animations, control styling and so on and exposes them both in XAML or through code. Also, WPF relies heavily on vector graphics, as opposed to the pixel graphics in WinForms. In short, WPF is quite powerfull and allows building very snazzy UI. (Don't take my word for it, though, as I am biased; go check around for what people are saying about it or buiding with it. :-))

WPF是为Windows OS构建独立应用程序的新UI平台。它支持声明式UI语言XAML和相关的CLR类型。WPF是与WinForms不同的平台,尽管可以构建将UI与WinForms结合在一起的应用程序。WPF支持很多WinForms不支持的东西,比如位图效果、动画、控件样式等等,并通过XAML或代码公开它们。此外,WPF严重依赖矢量图形,而不是WinForms中的像素图形。简单地说,WPF非常强大,允许构建非常时髦的UI。(不要相信我的话,因为我有偏见;去看看人们是怎么说的或者是怎么做的。:-))

WPF and WinForms do not compete with Flash/Flex. WPF and WinForms are both UI frameworks for building standalone client applications. As far as I know, Flash/Flex are frameworks for building rich internet applications - RIA (though lately people started interpreting this abbreviation as rich interactive applications).

WPF和WinForms不能与Flash/Flex竞争。WPF和WinForms都是用于构建独立客户端应用程序的UI框架。据我所知,Flash/Flex是构建富internet应用程序的框架——RIA(尽管最近人们开始将这个缩写解释为富交互式应用程序)。

Adobe did come up with AIR about half a year (or maybe a year) ago, which allows building standalone client applications, so you could say that Adobe is trying to position Flash/Flex/AIR to compete with WPF. Of course, that's my take on it and I doubt Adobe's official positiong is anything like that.

Adobe在大约半年前(或者可能是一年前)就推出了AIR,它允许构建独立的客户端应用程序,因此您可以说Adobe正试图部署Flash/Flex/AIR与WPF竞争。当然,这是我的看法,我怀疑Adobe的官方立场是不是真的。

If you want to compare particular MS technnologies with Flash/Flex, take a look at Silverlight - it's the MS RIA platform.

如果您想比较特定的MS技术和Flash/Flex,请查看Silverlight——它是MS RIA平台。

Silverlight is related to WPF in the sense that they share XAML and the corresponding CLR types. Silverlight supports only a subset of what WPF offers, though, as it is not targeting Windows OS only and thus is limited by the fact that it has to be portable.

Silverlight与WPF有关,因为它们共享XAML和相应的CLR类型。不过,Silverlight只支持WPF提供的一部分功能,因为它不仅针对Windows OS,而且由于它必须具有可移植性,因此受到限制。

Quick update to reflect the changes in the year since I've written the answer :-)

快速更新以反映自从我写了答案:-)

With Silverlight 3 shipped, SL and WPF are getting even closer and sharing bigger set of supported features. In addition, most of the new XAML controls are built for platform at the same time. Thus, SL/WPF are getting to a point of singularity...

随着Silverlight 3的发布,SL和WPF之间的距离越来越近,并且共享了更多的支持特性。此外,大多数新的XAML控件都是同时为平台构建的。因此,SL/WPF正接近奇点……

Also, SL 3 supports out-of-browser applications. In that sense, SL is not only starting to compete with Flash/Flex, but it is also encroaching on AIR's turf.

此外,SL 3还支持浏览器外的应用程序。从这个意义上说,SL不仅开始与Flash/Flex竞争,而且还在蚕食AIR的地盘。

And no, I still don't work on the WPF or Silverlight team. :-)

不,我还没有在WPF或Silverlight团队工作。:-)

#2


5  

WPF is being used as a replacement for WinForms, and as a competitor to Flash in the form of Silverlight. WPF consists of an entirely new object model that sits on top of DirectX (at least the desktop version). You can create WPF windows, controls, etc, entirely using C# or another .Net language just like you can render WinForms. However, Microsoft has also created a markup language called XAML (eXensible Application Markup Language). Nodes in an XAML document (XML) map to objects in a similar fashion to the way ASP.Net maps to web controls. XAML typically exists in a .Net project alongside a code-behind style C# file (or VB.Net or whatever). The C# file interacts with the objects generated by the XAML. This is fairly consistent with the "graphics via markup, logic via code" model that Microsoft and others are pushing.

WPF被用作WinForms的替代品,作为Flash的竞争对手,以Silverlight的形式出现。WPF由一个位于DirectX之上的全新对象模型(至少是桌面版本)组成。您可以创建WPF窗口、控件等,完全使用c#或其他。net语言,就像您可以呈现WinForms一样。然而,微软也创建了一种名为XAML (exenable Application markup language)的标记语言。XAML文档(XML)中的节点以类似于ASP的方式映射到对象。Net映射到web控件。XAML通常存在于一个。net项目中,旁边还有一个代码支持的c#文件(或者VB)。净之类的)。c#文件与XAML生成的对象交互。这与微软和其他公司正在推动的“通过标记、逻辑、代码”的模式相当一致。

One of the overlooked features when discussing WPF is the completely awesome data-binding that Microsoft wrote for WPF. The new data binding framework is a quantum leap beyond Windows Forms 2.0 data-binding. Microsoft added a couple of new interfaces that make it much easier to make an object or collection emit data-biding events properly. They also provided a very rich set of data-binding classes. You can bind anything to just about anything else. You can bind one-way data to control, control to data, two-way control to data and back, control to control, etc.

在讨论WPF时,一个被忽视的特性是Microsoft为WPF编写的完全出色的数据绑定。新的数据绑定框架超越了Windows Forms 2.0的数据绑定。微软增加了一些新的接口,使对象或集合能够更容易地正确地发出数据等待事件。它们还提供了一组非常丰富的数据绑定类。你可以把任何东西绑定到任何东西上。您可以将单向数据绑定到控件,控件绑定到数据,双向控件绑定到数据和数据,控件绑定到控件,等等。

Back on the graphics side of the house, WPF makes it fairly easy to make an existing control look like anything. WP lets you compose your own template for what a class of buttons should look like, or one button, or all buttons. Or radio buttons. Or labels. You get my drift. Imagine if CSS included the ability to define what an input button would look like using other HTML controls.

回到房子的图形方面,WPF使现有控件看起来非常简单。WP允许您为一个按钮类、一个按钮或所有按钮组成自己的模板。或单选按钮。或标签。你明白我的意思的。想象一下,如果CSS包含了使用其他HTML控件定义输入按钮的功能。

They also provide a number of layout controls. You can continue to use exact positioning like in WinForms, or you can leverage of variety of techniques to make your window act more like a web page that grows and shrinks with resizing, etc.

它们还提供一些布局控件。您可以继续使用准确的位置,比如WinForms,或者您可以利用各种技术,使您的窗口更像一个随着大小变化而增大或减小的web页面,等等。

The downsides: It is too easy to create spectacular effects that crawl on slower machines. Some of the graphics do not take advantage of hardware of graphics cards, though Microsoft has incrementally improved support for this. I believe when 3.0 first came out drop shadows were rendered purely using software. I think 3.5 or 3.5 SP1 changed it so that WPF would utilize graphics hardware for the task. Microsoft has said they will continue to enhance WPF in this fashion.

缺点:在速度较慢的机器上创建引人注目的效果太容易了。有些图形并没有利用显卡的硬件,尽管微软已经逐步改进了对它的支持。我相信当3.0首先出现的时候,阴影是纯粹用软件渲染出来的。我想是3。5或3。5 SP1改变了它,这样WPF就可以在任务中使用图形硬件了。微软表示,他们将继续以这种方式提高WPF。

WPF is .Net 3.0 and above, which runs on XP SP2, Vista, and Servers 03 & 08. So don't plan on deploying WPF to a customer with Win2k desktops.

WPF是。net 3.0及以上版本,运行于XP SP2、Vista和服务器03和08上。因此,不要计划将WPF部署到使用Win2k桌面的客户。

Summary: If you are doing desktop programming in .Net, you should be doing it in WPF unless you are targeting Win2k. You can avoid the downsides of WPF, and there are many upsides. Microsoft will probably throw away WinForms in some future release, or at very least you will stop seeing new features, etc.

总结:如果你在。net中做桌面编程,你应该在WPF中做,除非你的目标是Win2k。你可以避免WPF的缺点,它有很多优点。微软可能会在未来的某个版本中抛弃WinForms,或者至少你不会再看到新的特性,等等。

As far as Silverlight goes, the betas for SL 2.0 look good. I think that Silverlight will require some wide-spread adoption. Microsoft has already tried to get this going. The NBC Olypmics site used Silverlight, and Major League Baseball uses it for its MLB.tv product. As soon as Silverlight gets a good install base I think you will see the Microsoft side of the development world starting swinging away from Flash and to Silverlight.

就Silverlight而言,SL 2.0的beta版看起来不错。我认为Silverlight需要广泛采用。微软已经试图让这一切顺利进行。NBC的奥林匹克运动会网站使用了Silverlight,而美国职业棒球大联盟使用它作为其MLB。电视产品。只要Silverlight得到了一个好的安装基础,我想你就会看到,开发世界的微软方面开始从Flash转向Silverlight。


Edit after using Silverlight 3 and MVVM:

使用Silverlight 3和MVVM进行编辑:

I have moved away from WPF and am doing a lot of Silverlight 3 development. But I think my comments here will still apply to the WPF developer.

我已经离开了WPF,并且正在做很多Silverlight 3开发。但是我认为我在这里的评论仍然适用于WPF开发人员。

I have been using the MVVM pattern in my app (think MVC with a twist). The Microsoft Patterns and Practices team has released a set of libraries known as Prism that supports various aspects of MVVM. There are WPF and Silverlight versions. Take a look at MVVM and Prism if you are going to be doing WPF or Silverlight development.

我一直在我的应用程序中使用MVVM模式(想想MVC和扭转)。微软模式和实践团队发布了一组名为Prism的库,支持MVVM的各个方面。有WPF和Silverlight版本。如果您要进行WPF或Silverlight开发,请查看MVVM和Prism。

#3


2  

You can do a lot of flash w/ Winforms, or with custom components. But if you want out-of-the-box bang-whizz availability, WPF is the way to go.

你可以做很多flash w/ Winforms,或者使用定制组件。但是如果您想要开箱即用的可用性,WPF是一个不错的选择。

Yeah, I think the intention is to be flash-like, it seems to me that MS has set its sights on taking down Adobe.

是的,我认为他们的目的是要像flash一样,在我看来,MS已经把目标对准了摧毁Adobe。

#4


0  

The way I see it: WPF is to Flash as WinForms is to Flex. WPF has more emphasis on vectors and states than on programming.

我的理解是:WPF是Flash,就像WinForms是Flex一样。WPF更强调向量和状态,而不是编程。


推荐阅读
  • 本文介绍了一个在线急等问题解决方法,即如何统计数据库中某个字段下的所有数据,并将结果显示在文本框里。作者提到了自己是一个菜鸟,希望能够得到帮助。作者使用的是ACCESS数据库,并且给出了一个例子,希望得到的结果是560。作者还提到自己已经尝试了使用"select sum(字段2) from 表名"的语句,得到的结果是650,但不知道如何得到560。希望能够得到解决方案。 ... [详细]
  • 3.223.28周学习总结中的贪心作业收获及困惑
    本文是对3.223.28周学习总结中的贪心作业进行总结,作者在解题过程中参考了他人的代码,但前提是要先理解题目并有解题思路。作者分享了自己在贪心作业中的收获,同时提到了一道让他困惑的题目,即input details部分引发的疑惑。 ... [详细]
  • This article discusses the efficiency of using char str[] and char *str and whether there is any reason to prefer one over the other. It explains the difference between the two and provides an example to illustrate their usage. ... [详细]
  • Forexperiencedcryptoinvestors,thereareseveralsectorsthatseemedpromisingbutdidn’tlive ... [详细]
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • IB 物理真题解析:比潜热、理想气体的应用
    本文是对2017年IB物理试卷paper 2中一道涉及比潜热、理想气体和功率的大题进行解析。题目涉及液氧蒸发成氧气的过程,讲解了液氧和氧气分子的结构以及蒸发后分子之间的作用力变化。同时,文章也给出了解题技巧,建议根据得分点的数量来合理分配答题时间。最后,文章提供了答案解析,标注了每个得分点的位置。 ... [详细]
  • 本文主要解析了Open judge C16H问题中涉及到的Magical Balls的快速幂和逆元算法,并给出了问题的解析和解决方法。详细介绍了问题的背景和规则,并给出了相应的算法解析和实现步骤。通过本文的解析,读者可以更好地理解和解决Open judge C16H问题中的Magical Balls部分。 ... [详细]
  • 本文介绍了P1651题目的描述和要求,以及计算能搭建的塔的最大高度的方法。通过动态规划和状压技术,将问题转化为求解差值的问题,并定义了相应的状态。最终得出了计算最大高度的解法。 ... [详细]
  • Oracle分析函数first_value()和last_value()的用法及原理
    本文介绍了Oracle分析函数first_value()和last_value()的用法和原理,以及在查询销售记录日期和部门中的应用。通过示例和解释,详细说明了first_value()和last_value()的功能和不同之处。同时,对于last_value()的结果出现不一样的情况进行了解释,并提供了理解last_value()默认统计范围的方法。该文对于使用Oracle分析函数的开发人员和数据库管理员具有参考价值。 ... [详细]
  • 拥抱Android Design Support Library新变化(导航视图、悬浮ActionBar)
    转载请注明明桑AndroidAndroid5.0Loollipop作为Android最重要的版本之一,为我们带来了全新的界面风格和设计语言。看起来很受欢迎࿰ ... [详细]
  • 也就是|小窗_卷积的特征提取与参数计算
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了卷积的特征提取与参数计算相关的知识,希望对你有一定的参考价值。Dense和Conv2D根本区别在于,Den ... [详细]
  • FeatureRequestIsyourfeaturerequestrelatedtoaproblem?Please ... [详细]
  • Android自定义控件绘图篇之Paint函数大汇总
    本文介绍了Android自定义控件绘图篇中的Paint函数大汇总,包括重置画笔、设置颜色、设置透明度、设置样式、设置宽度、设置抗锯齿等功能。通过学习这些函数,可以更好地掌握Paint的用法。 ... [详细]
  • 本文介绍了使用Spark实现低配版高斯朴素贝叶斯模型的原因和原理。随着数据量的增大,单机上运行高斯朴素贝叶斯模型会变得很慢,因此考虑使用Spark来加速运行。然而,Spark的MLlib并没有实现高斯朴素贝叶斯模型,因此需要自己动手实现。文章还介绍了朴素贝叶斯的原理和公式,并对具有多个特征和类别的模型进行了讨论。最后,作者总结了实现低配版高斯朴素贝叶斯模型的步骤。 ... [详细]
  • 近来有一个需求,是需要在androidjava基础库中插入一些log信息,完成这个工作需要的前置条件有编译好的android源码具体android源码如何编译,这 ... [详细]
author-avatar
GRcoder
弱者,为何而战!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有