Repository navigation
[WinUI3] Windows Community Toolkit 7.0.1 for Project Reunion 0.5 #3295
Description
Please read our blog for the latest info on our Project Reunion 0.5 release here: https://devblogs.microsoft.com/ifdef-windows/windows-community-toolkit-for-project-reunion-0-5/
👉 Latest Discussion thread is here. 👈
Original Discussion thread is here: #3912
Windows Community Toolkit 8.0.0 Preview 5 💗 Project Reunion 0.5 Preview [Historical]
Originally, at //Build, WinUI 3 Preview 1 was released to showcase improvements to WinUI 3 and the first release of the Desktop development story on .NET 5. 🎉🎉🎉 Now they've shipped Project Reunion 0.5 Preview!
The Windows Community Toolkit has been working alongside the WinUI team to also make sure the Toolkit works on WinUI 3! We're happy to announce that we're also shipping a preview of the toolkit that works on top of this WinUI 3 Preview 5 the next day! 🎉🎉🎉
This pre-release showcases the majority of the toolkit working on top of WinUI 3 for Desktop developers in .NET 5! If you find any new issues specific to this preview (or do something awesome), please let us know by commenting below!
⚠ Important Note ⚠
When Project Reunion 0.5 releases, we will ship packages to NuGet for the Toolkit, compatible with it like these previews. However, they will be under a different namespace/package identity of CommunityToolkit.WinUI.*. There'll be corresponding packages for each Microsoft.Toolkit.Uwp.* package. The version of the WinUI packages will align to the same version of the current UWP packages that contain the same features. Therefore when we ship 7.1 of the UWP packages, there'll be an equivalent set of 7.1 packages for WinUI 3 as well. This will continue until a time in the future we feel the community can move to WinUI 3 in full, at which point we will deprecate our UWP packages and move to WinUI 3 only.
Requirements
- Visual Studio 2019 16.10 Preview (.NET and UWP Workloads)
- .NET 5 - (should be included in VS download)
- Uninstall the WinUI 3 Preview 4 Project Templates VSIX
You can follow the initial getting started guidance for Project Reunion here: https://docs.microsoft.com/windows/apps/project-reunion/#set-up-your-development-environment
Getting Started
-
Open your VS 2019 Preview and Create a New Project.
-
Pick the "Blank App, Packaged (WinUI in Desktop) C#" template.
-
Setup your project directories and options as guided by the WinUI 3 Preview docs, we'll refer to "Project Name" generically from here on to be whatever you named your project.
-
(Optional) You should be able to run the "Project Name (Package)" project and see the blank starting app if your WinUI 3 environment is setup correctly.
-
Right-click your other application "Project Name" project, and select "Manage NuGet Packages..."
-
Click the gear in the top-right of the page to configure your NuGet settings.
-
Add a new Package source to our DevOps feed:
https://pkgs.dev.azure.com/dotnet/WindowsCommunityToolkit/_packaging/WindowsCommunityToolkit-WinUI3/nuget/v3/index.json, be sure to hit the Update button after changing the textboxes, and click OK. Read more on our Preview Packages here. -
Select the "DevOps" package source from the drop-down menu next to the Settings icon.
-
Click on Browse, find a Toolkit package you'd like to add like "Microsoft.Toolkit.Uwp.UI.Controls"
-
Make sure to select the
8.0.0-preview5version from the Version drop-down and click "Install"! -
Modify your project with the following based on your target framework: (See .NET SDK 5.0.200 and 5.0.104 can't load default styles of custom controls - Issue .NET SDK 5.0.200 and 5.0.104 can't load default styles of custom control microsoft/microsoft-ui-xaml#4414)
<ItemGroup>
<!-- If you are targeting 18362 -->
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.18362.13" />
</ItemGroup>OR
<ItemGroup>
<!-- If you are targeting 19041 -->
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.19041.13" />
</ItemGroup>- Go to your
MainWindow.xamland paste in some Toolkit code, like ourUniformGridexample from our Sample App:
<controls:UniformGrid
FirstColumn="1"
Orientation="Horizontal"
Rows="0"
Columns="0">
<Border Background="AliceBlue"
Grid.Row="1" Grid.Column="1"
Grid.RowSpan="2"
Grid.ColumnSpan="2">
<TextBlock Text="1"/>
</Border>
<Border Background="Cornsilk">
<TextBlock Text="2"/>
</Border>
<Border Background="DarkSalmon">
<TextBlock Text="3"/>
</Border>
<Border Background="Gainsboro">
<TextBlock Text="4"/>
</Border>
<Border Background="LightBlue">
<TextBlock Text="5"/>
</Border>
<Border Background="MediumAquamarine">
<TextBlock Text="6"/>
</Border>
<Border Background="MistyRose">
<TextBlock Text="7"/>
</Border>
<Border Background="LightCyan">
<TextBlock Text="8"/>
</Border>
<Border Background="Salmon">
<TextBlock Text="9"/>
</Border>
<Border Background="Goldenrod">
<TextBlock Text="10"/>
</Border>
<Border Background="Pink">
<TextBlock Text="11"/>
</Border>
</controls:UniformGrid>Don't forget the xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" in your Page tag!
(And if you replace the existing template's XAML remove the event handler in the code-behind!)
- Hit F5 and Voila! 🎉🎉🎉
Known Issues/Limitations
-
⚠ See .NET SDK 5.0.200 and 5.0.104 can't load default styles of custom controls - Issue .NET SDK 5.0.200 and 5.0.104 can't load default styles of custom control microsoft/microsoft-ui-xaml#4414
-
The Windows Community Toolkit 8.x previews are currently only geared towards .NET 5 Desktop development. The toolkit has been tested against the 'UWP' sandboxed versions of WinUI as well, but won't ship a public package until .NET 5 tooling is supported for that environment. (See tracking on dotnet and Project Reunion.)
-
Any component relying on Win2D as a dependency will not function or throw an exception. (See their WinUI tracking issue here.)
-
The new
TabbedCommandBarcontrol hasn't been updated yet. -
ThemeListener is not working due to APIs being removed in WinUI Preview 4, see their known issue list in link below.
-
GridSplitter cursor doesn't change discussed here because of changes to
CoreWindowandCursorproperty internal issue. -
Be sure to also read the Project Reunion 0.5 Preview Known Issue List.
Activity
liquidboy commentedon Jun 4, 2020
Just want to mention that i lost some time when i newed up a new WinUI3 + UWP project in VS2019 preview .. And then nuget referenced the windows toolkit 7.x ..
It all appeared fine BUT when i started using the TabView, which is why i wanted to use the toolkit as the TabView in WinUI wasnt working, it threw up errors..
Didnt read any doco ahead of newing up the project .. BUT after the fact after going to the github issues for the toolkit i found that WinUI3+UWP wasnt supported for the toolkit yet..
No biggie, just wasted cycles for me :)
[and at the time after being so productive hacking on the early bits, and hitting this wall , was sort of deflating ... BUT i understand its a beta]
alvinashcraft commentedon Jun 25, 2020
The timeline for WinUI on UWP sandboxed apps running on .NET 5 is sometime in 2021, correct? Are there any 'non-public' packages for UWP/WinUI that can be shared?
RaoHammas commentedon Jun 28, 2020
It's not working with WinUI ! i followed exact steps and it gives followinf error (so nuget isn't installing).
Microsoft.Toolkit.Uwp.UI.Controls 8.0.0-preview1 is not compatible with uap10.0.17763can someone help me here ?
alvinashcraft commentedon Jun 28, 2020
Are you using it with a "WinUI on Desktop" project? The current preview only works with the .NET 5 projects, not the WinUI on UWP projects.
jtbrower commentedon Jun 29, 2020
For anyone who lands on this page and decides to give the above a shot, the tutorial will not work past .Net5.0 preview 5. At the time I am writing this comment, .Net5.0 preview 6 is out and it has breaking changes that require you to add a direct reference to the following NuGet package.
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="0.1.0-prerelease.200623.5" />If you don't, you will hit the following exception.
System.MissingMethodException: 'Method not found: 'Void System.Runtime.InteropServices.ComWrappers.RegisterAsGlobalInstance()'.'alvinashcraft commentedon Jun 29, 2020
I was getting the same error with .Net5.0 preview 5 today. I had to roll back to preview 4 to get WinUI on Desktop projects that use WCT compiling with .Net 5.
jtbrower commentedon Jun 29, 2020
Interesting. I had thought it was related to this change which I wasn't seeing until preview 6.
36 remaining items
curia-damiano commentedon Mar 11, 2021
I await for the update to Project Reunion 0.5, thanks in advance!
[-][WinUI3] Windows Community Toolkit 8.0.0-preview4 for WinUI 3 Preview 4[/-][+][WinUI3] Windows Community Toolkit 8.0.0-preview5 for Project Reunion 0.5 Preview[/+]michael-hawker commentedon Mar 12, 2021
@curia-damiano sorry for the delay, it's available now!
curia-damiano commentedon Mar 12, 2021
Thank you @michael-hawker , super fast!!!
wbokkers commentedon Mar 12, 2021
Where can I find the Mouse.Cursor extension? It does not work anymore after swithing from Preview 4 to preview 5.
Marv51 commentedon Mar 12, 2021
@wbokkers Looks like it was moved to the "Microsoft.Toolkit.Uwp.UI" nuget and renamed to
ui:FrameworkElementExtensions.Cursor="Hand"wbokkers commentedon Mar 12, 2021
@Marv51 Thanks!
michael-hawker commentedon Mar 12, 2021
@wbokkers yeah, we cleaned up the Extensions namespace among other things, so be sure to go through the 7.0.0 release notes if you encounter anything. Most things are still around just in a different spot, though there have been a few things which have been removed or need a bit more migration (like the Storage Helpers).
Marv51 commentedon Mar 31, 2021
Is a new preview of the toolkit needed for the Reunion 0.5 stable? HeaderedContent and Expander are very broken for me but other than that it seems to work.
azchohfi commentedon Mar 31, 2021
The 0.5.0-Prerelease version should work quite ok with the 0.5.0 GA, but this doesn't mean that we are not working on shipping a new version. We should ship it very soon!
[-][WinUI3] Windows Community Toolkit 8.0.0-preview5 for Project Reunion 0.5 Preview[/-][+][WinUI3] Windows Community Toolkit 7.0.1 for Project Reunion 0.5[/+]michael-hawker commentedon Apr 1, 2021
Closing this issue now, if you have an issue with our WinUI bits, please let us know on this discussion.