This port allows for Uno Platform based apps to use Windows Community Toolkit version 7.x for WinUI 3 on Windows, iOS, macOS, Android, WebAssembly, and Linux.
Important
Note that this Uno Platform fork of the Windows Community Toolkit is for version 7.x only.
If you update to version 8.x, Uno Platform support is now available out of the box. You can remove the Uno Windows Community Toolkit references and all Condition statements around the packages.
For more details on how to use Windows Community Toolkit, complete details are available here.
Pick the package version that matches the Uno Platform version of your app:
| Packages | Uno Platform | Target frameworks | Branch |
|---|---|---|---|
| 7.2.x | 7.0 and later | net10.0, used by every Uno Platform head |
uno |
| 7.1.2xx | 5.x and 6.x | net7.0, net7.0-android, net7.0-ios, net7.0-maccatalyst, net7.0-macos |
servicing/7.1 for dev builds, unorel/winui/7.1.200 for stable releases |
| 7.1.1xx | 4.x | Xamarin and net6.0 targets |
unorel/winui/7.1 |
Until Uno Platform 7.0 is released, 7.2 is published to nuget.org as 7.2.0-dev.N prereleases. They depend on Uno.WinUI 7.0.0-dev.2347 or later, so the app needs an Uno.Sdk that ships at least that version: Uno.Sdk 7.0.0-dev.81 (Uno.WinUI 7.0.0-dev.2347) works, while 7.0.0-dev.67 (Uno.WinUI 7.0.0-dev.2100) fails to restore with NU1605.
- The packages are built against Uno Platform 7 and require .NET 10. Uno Platform 7 renders every target with Skia, so a single
net10.0build serves the desktop, WebAssembly, Android and iOS heads. Binaries built for Uno Platform 6 or earlier cannot be loaded by an Uno Platform 7 app. - The XAML Behaviors dependency is now
Uno.Microsoft.Xaml.Behaviors.Interactivity.WinUI4.x, the only line built for Uno Platform 7. Since XAML Behaviors 3.0, theMicrosoft.Xaml.Interactionsassembly is gone:EventTriggerBehavior,InvokeCommandAction,DataTriggerBehavior,ControlStoryboardActionand the rest ofMicrosoft.Xaml.Interactions.CoreandMicrosoft.Xaml.Interactions.Medialive inMicrosoft.Xaml.Interactivity. Point the existing prefixes at it, e.g.xmlns:core="using:Microsoft.Xaml.Interactivity", and the elements need no change. In C#, replaceusing Microsoft.Xaml.Interactions.Core;and.Mediawithusing Microsoft.Xaml.Interactivity;, including in files that declare their own behaviors or actions in those namespaces. A Windows head that shares the XAML needsMicrosoft.Xaml.Behaviors.WinUI.Managed3.x, because Microsoft's toolkit 7.1.2 brings 2.0.8. DataGridhonors[ReadOnly]on auto-generated columns, as it does on Windows.UserInteractionModeStateTriggernever activates on Uno Platform, becauseUIViewSettings.GetForCurrentView()is not implemented there. It used to throw and fail the page that used it.ScrollViewerExtensions.EnableMiddleClickScrollingdoes nothing on Uno Platform 7, because it tracks the pointer throughCoreWindow, which isnullfor Uno Platform 7 windows. It used to throw.CommunityToolkit.WinUI.Notificationsis not part of the Uno Platform build: it targets Windows only and was never published as an Uno package.- Windows (WinAppSDK) heads keep using the packages published by Microsoft, as before.
The following packages are available:
- Uno.CommunityToolkit.Common
- Uno.CommunityToolkit.WinUI
- Uno.CommunityToolkit.WinUI.Connectivity
- Uno.CommunityToolkit.WinUI.DeveloperTools
- Uno.CommunityToolkit.WinUI.UI
- Uno.CommunityToolkit.WinUI.UI.Animations
- Uno.CommunityToolkit.WinUI.UI.Behaviors
- Uno.CommunityToolkit.WinUI.UI.Controls
- Uno.CommunityToolkit.WinUI.UI.Controls.Core
- Uno.CommunityToolkit.WinUI.UI.Controls.DataGrid
- Uno.CommunityToolkit.WinUI.UI.Controls.Input
- Uno.CommunityToolkit.WinUI.UI.Controls.Layout
- Uno.CommunityToolkit.WinUI.UI.Controls.Markdown
- Uno.CommunityToolkit.WinUI.UI.Controls.Media
- Uno.CommunityToolkit.WinUI.UI.Controls.Primitives
- Uno.CommunityToolkit.WinUI.UI.Media
These package IDs are for Uno Platform (non-Windows) projects. For WinUI 3 projects, you should use the equivalent packages published by Microsoft (CommunityToolkit.WinUI, CommunityToolkit.WinUI.UI.Controls etc).
For how to use Windows Community Toolkit, complete details are available here.