gpt4 book ai didi

c# - 是否可以在 WPF 应用程序中使用 UWP API?

转载 作者:太空狗 更新时间:2023-10-29 19:59:29 24 4
gpt4 key购买 nike

一个例子是适用于 Windows 10 通用平台的新通知 API。我可以在 WPF 应用程序中使用这组 API 吗?如果可以,有什么限制吗?

非常感谢与此相关的文档链接。

最佳答案

可以在 WPF 应用中使用 UWP API。但是,并非所有 UWP API 都可以在 WPF 应用中使用。

There are exceptions to the rule that Windows 10 APIs are accessible from PC software. The first big exception concerns XAML UI APIs. The XAML framework in UWP is different from the one in WPF and you really don’t want to be mixing them up, anyways.

The second set of APIs that you can’t use are ones that depend on an app’s package identity. UWP apps have package identities while PC software does not. Package identity information can be found in the app manifest file.

How do you determine which Windows 10 APIs require a package identity and which do not? The easiest way is to refer to this MSDN topic.

有关如何从 WPF 访问 Windows 10 API,请参阅 this answer还可以查看博客 Calling Windows 10 APIs From a Desktop Application (请注意博客中引用的名称不正确,所以我建议您引用 SO 中的答案)。

关于c# - 是否可以在 WPF 应用程序中使用 UWP API?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33692898/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com