Search code examples
c#wpfwindows-community-toolkitxaml-islands

What is the true minimum supported version of Windows 10 for hosting UWP controls in a WPF application using XAML Islands?


I will be working on a C#/WPF application for release in February 2020, and I would like it to have a modern user interface. The term "modern user interface" can be taken to mean a user interface that is made up of views (i.e. custom controls) containing first-party UWP controls or Windows Community Toolkit controls from Microsoft.

To achieve this, the best approach that I am aware of is to use the recently released XAML Islands.

I believe that the prerequisites for using XAML Islands are that I must:

  • Write the new application targeting .NET Core 3.0
  • Follow the additional steps here to set up my project/solution
  • Use the WindowsXamlHost control to wrap my UWP views (preferable to wrapping individual Microsoft controls placed in normal WPF views)
  • Target a minimum version of Windows 10

The first three prerequisites I believe I will be able to meet. What I am not clear on is the specific version of Windows 10 that is required.

In the documentation here, the minimum supported Windows 10 version for using the WindowsXamlHost control is listed as being version 1903. However, that page makes several references to XAML Islands being a developer preview, which is no longer the case, and so I have hope that this requirement is out of date.

If you instead look at the GitHub page here, the minimum supported Windows 10 version is listed as being version 1809.

For me, that difference is going to be the deciding factor of whether or not I can use this approach. The minimum version of Windows 10 that I will be able to guarantee users will have is 1809.

So, which of the documentation pages is correct? Can a WPF application, targeting .NET Core 3, make use of XAML Islands when running on Windows 10 1809?


Solution

  • The support for XAML Islands was initially added in a preview version of Windows 1809.

    1903 is however the first stable and officially supported version of Windows where you can use XAML islands to host UWP controls in non-UWP desktop applications, i.e. the official docs are accurate.

    You may also want to take a look at WinUI 3. It's a major update to the Windows 10 native UI platform that is currently under active development by the Microsoft developer platform team and planned for release in 2020.

    It will decouple the existing UWP Xaml APIs from the SDK and the operating system and ship them in a separate NuGet package that you can consume from any type of Windows deskop app including WPF and Windows Forms.

    The alpha version should be compatible with Windows 10 version 1803 and higher. Note that this version is intended for early evaluation only and should NOT be used for production apps.