是否可以在 WPF 应用程序中使用 UWP API?
Is it possible to use UWP APIs in a WPF app?
一个例子是 Windows 10 通用平台的新通知 API。我可以在 WPF 应用程序中使用这组 API 吗?如果可以,有什么限制吗?
非常感谢与此相关的文档链接。
不,你不能 - 至少现在 -
但是名为“Centennial”的项目取得了进展,这将使您能够这样做。
更多见“bridges”。
是的,你现在可以了。
https://blogs.windows.com/buildingapps/2017/01/25/calling-windows-10-apis-desktop-application/
可以在 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 and also see the blog Calling Windows 10 APIs From a Desktop Application(请注意博客中引用的名称不正确,建议您参考SO 中的答案)。
一个例子是 Windows 10 通用平台的新通知 API。我可以在 WPF 应用程序中使用这组 API 吗?如果可以,有什么限制吗?
非常感谢与此相关的文档链接。
不,你不能 - 至少现在 -
但是名为“Centennial”的项目取得了进展,这将使您能够这样做。
更多见“bridges”。
是的,你现在可以了。
https://blogs.windows.com/buildingapps/2017/01/25/calling-windows-10-apis-desktop-application/
可以在 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 and also see the blog Calling Windows 10 APIs From a Desktop Application(请注意博客中引用的名称不正确,建议您参考SO 中的答案)。