How to use WinRT in Avalonia? #15799
-
Hello, Avalonia community! Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 20 replies
-
|
Beta Was this translation helpful? Give feedback.
-
To add to @timunie comment, to access WinRT APIs you can use CsWinRT library. |
Beta Was this translation helpful? Give feedback.
-
If you mean by WinUI3 UI, you have to use FluentAvaloniaTheme. It's available in Nuget Packages and has majority of all WinUI3 controls. |
Beta Was this translation helpful? Give feedback.
You can use Xamarin essentials for that. It already implements the share dialogue for most platforms.
https://learn.microsoft.com/en-us/previous-versions/xamarin/essentials/share?tabs=uwp
With that said, that is not the way you multi target. Instead you do:
When you build the project, it will output assemblies for both targets. The problem with multi targeting (at least with platform specific TFMs) is that you can't have any reference to a platform specific API in your shared code. If you do, every project but the build output for the platform that implements the API will fail. So to get around that you have to use pre…