Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use UWP APIs in a WPF app?

One example would be the new notification APIs for Windows 10 universal platform. Can I use this set of APIs in a WPF app? If so are there any limitations?

Links to documentation regarding this would be much appreciated.

like image 757
disklosr Avatar asked Nov 13 '15 12:11

disklosr


2 Answers

It is possible to use UWP APIs in a WPF app. However not all UWP APIs can be used in a WPF app.

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.

For how to access the Windows 10 APIs from WPF, please refer to this answer and also see the blog Calling Windows 10 APIs From a Desktop Application (Please note the name of the references in the blog is not right, so I'd suggest you refer the answer in SO).

like image 139
ZORRO Avatar answered Sep 21 '22 20:09

ZORRO


No, You can't - at least for now - But there's a progress on a project called "Centennial" Which will enable you to do so.

More see "bridges".

Yes, you can now.
https://blogs.windows.com/buildingapps/2017/01/25/calling-windows-10-apis-desktop-application/

like image 44
Kinani Avatar answered Sep 22 '22 20:09

Kinani