XAML、WPF 和 Windows 8

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13093294/
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-13 05:57:44  来源:igfitidea点击:

XAML, WPF and Windows 8

wpfwindowsxamlxbap

提问by Omar Mir

I'm hoping someone here can explain to me the difference between WPF and XAML exactly in this context:

我希望这里有人可以在这种情况下向我解释 WPF 和 XAML 之间的区别:

I have an application (an XBAP specifically) written in VB.NET using MVVM & Repository Pattern, implementing the the usual INotifyPropertyChanged, OLEDB etc etc.

我有一个使用 MVVM 和存储库模式在 VB.NET 中编写的应用程序(特别是 XBAP),实现了通常的 INotifyPropertyChanged、OLEDB 等。

The front end of the application is written in XAML.

应用程序的前端是用 XAML 编写的。

From what I understand there is nothing specifically "WPF" about this application. In my view its XAML + VB.NET; where does the WPF come in? Given windows 8 and the "death of Silverlight/WPF" that I keep hearing about, what should I be doing to "upgrade" my application to ensure its future?

据我所知,这个应用程序没有什么特别的“WPF”。在我看来它的 XAML + VB.NET;WPF从哪里进来?鉴于 Windows 8 和我不断听到的“Silverlight/WPF 之死”,我应该如何“升级”我的应用程序以确保其未来?

I would greatly appreciate someone clearing up this confusion for me.

我将不胜感激有人为我解决了这个困惑。

回答by Matt Burland

XAML + your code behind is WPF. You are using WPF. XAML is the markup used for defining the interface in WPF.

XAML + 你背后的代码是 WPF。您正在使用 WPF。XAML 是用于在 WPF 中定义接口的标记。

And I wouldn't worry too much at this point about "the death of Silverlight/WPF". Just because Windows 8 supports HTML5/JavaScript doesn't mean WPF has gone away. At least, not yet.

在这一点上我不会太担心“Silverlight/WPF 的死亡”。仅仅因为 Windows 8 支持 HTML5/JavaScript 并不意味着 WPF 已经消失。至少,目前还没有。

See also.

另见

回答by BoltClock

An XBAP(XAML Browser Application) is a kind of WPF XAML application, that runs in the browser. Nothing more, nothing less.

一个XBAP(XAML浏览器应用程序)是一种WPF XAML应用程序,在浏览器运行。不多也不少。

WPF isn't going away anytime soon; in fact, it received a number of enhancements in .NET 4.5. Windows 8 will continue supporting WPF whether it's run on the desktop or as an XBAP. There's no need to "upgrade" your app, but if you want to take advantage of the Windows Store and the new user interface, it's not difficult to port your WPF XAMLto WinRT XAML.

WPF 不会很快消失;事实上,它在 .NET 4.5 中得到了许多增强。无论是在桌面上运行还是作为 XBAP 运行,Windows 8 都将继续支持 WPF。无需“升级”您的应用程序,但如果您想利用 Windows 应用商店和新的用户界面,将 WPF XAML 移植到 WinRT XAML并不困难。

回答by Apoorv Kumar Upadhyay

See, WPF can be called as the Successor of WinForms . In WPF WE have this XAML that is simply XML but Is more powerful and has greater properties . WPF isn't dead ! Talking about Windows Store Apps, Silverlight has lots to do with WPF and XAML

看,WPF 可以称为 WinForms 的继承者。在 WPF 中,我们有这个 XAML,它只是简单的 XML,但功能更强大且具有更多属性。WPF没有死!说到 Windows Store Apps,Silverlight 与 WPF 和 XAML 有很大关系

回答by Stephane Halimi

Your XBAP application uses WPF : XAML for the UI and VB.NET for the code behind. If you want to be sure, check if the namespaces you use in the code begin with "System.Windows".

您的 XBAP 应用程序使用 WPF:XAML 作为 UI 和 VB.NET 作为背后的代码。如果您想确定,请检查您在代码中使用的命名空间是否以“System.Windows”开头。

Your XBAP is just a kind of project you can create with the WPF technology. (that's an application which shows several web pages as its UI).

您的 XBAP 只是一种您可以使用 WPF 技术创建的项目。(这是一个显示多个网页作为其 UI 的应用程序)。