Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WinUI3] Windows Community Toolkit 7.0.1 for Project Reunion 0.5 #3295

Closed
michael-hawker opened this issue May 19, 2020 · 49 comments
Closed
Labels
documentation 📃 for-review 📖 To evaluate and validate the Issues or PR improvements ✨ WinUI 💠 Related to WinUI 3 Version or when paired with External can mean requires fix in WinUI 2/3.
Milestone

Comments

@michael-hawker
Copy link
Member

michael-hawker commented May 19, 2020

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

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

  1. Open your VS 2019 Preview and Create a New Project.

  2. Pick the "Blank App, Packaged (WinUI in Desktop) C#" template.

  3. 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.

  4. (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.

  5. Right-click your other application "Project Name" project, and select "Manage NuGet Packages..."

  6. Click the gear in the top-right of the page to configure your NuGet settings.

  7. 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.

  8. Select the "DevOps" package source from the drop-down menu next to the Settings icon.

  9. Click on Browse, find a Toolkit package you'd like to add like "Microsoft.Toolkit.Uwp.UI.Controls"

  10. Make sure to select the 8.0.0-preview5 version from the Version drop-down and click "Install"!

  11. 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>
  1. Go to your MainWindow.xaml and paste in some Toolkit code, like our UniformGrid example 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!)

  1. 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 TabbedCommandBar control 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 CoreWindow and Cursor property internal issue.

  • Be sure to also read the Project Reunion 0.5 Preview Known Issue List.

@michael-hawker michael-hawker added documentation 📃 improvements ✨ for-review 📖 To evaluate and validate the Issues or PR WinUI 💠 Related to WinUI 3 Version or when paired with External can mean requires fix in WinUI 2/3. labels May 19, 2020
@michael-hawker michael-hawker added this to the WinUI3 milestone May 19, 2020
@ghost ghost added the needs triage 🔍 label May 19, 2020
@michael-hawker michael-hawker pinned this issue May 19, 2020
@liquidboy
Copy link

liquidboy commented 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
Copy link
Contributor

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
Copy link

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.17763

can someone help me here ?

@alvinashcraft
Copy link
Contributor

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.17763

can someone help me here ?

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
Copy link

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
Copy link
Contributor

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.

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
Copy link

Interesting. I had thought it was related to this change which I wasn't seeing until preview 6.

@michael-hawker
Copy link
Member Author

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?

@alvinashcraft to support UWP currently with WinUI, the packages need to support the .NET Native toolchain. To support both Desktop and UWP, we'd need to multi-target our packages. Since this wouldn't make sense as the end-result, we just moved over early for the Desktop support, and are waiting on the .NET 5 support from the platform for UWP.

Before the move, we had done testing with the UWP side, so those should be working in the future. If WinUI 3/.NET 5 work is delayed for a while, then we'll re-evaluate doing multi-targeting as a stop-gap based on the feedback in this thread.

FYI @azchohfi

@michael-hawker
Copy link
Member Author

@jtbrower I know the base WinUI 3 packages have issues with the new .NET 5 previews. I believe this should be all resolved in the upcoming Preview 2, we'll also refresh this Toolkit package at that time as well. But yes, for now you have to use .NET 5 Preview 4.

@jtbrower
Copy link

Hello @michael-hawker, I have been able to begin evaluation of WinUI with .Net 5 Preview 6 by adding a direct reference to the NuGet package below. This is the same workaround that I needed to apply to use the PointOfService namespaces with .Net5.0 preview 6. Although I am sure I might run into additional issues regarding version mismatches (what do you think) it has given me what I need to try out WinUI since I have already rolled past the required .Net version.

<PackageReference Include="Microsoft.Windows.CsWinRT" Version="0.1.0-prerelease.200623.5" />

I built a sample desktop application targeting .Net 5.0 preview 6 along with the latest public WinUI and am intrigued enough to attempt a conversion to WinUI 3 from WPF. This isn't a trivial effort for me but I have been praying for a UI solution since Microsoft first released the sandboxed UWP back in 2012. Stuck in limbo for 8 years, I cannot emphasize enough how excited I am to modernize a large enterprise app.

@alvinashcraft
Copy link
Contributor

Thanks, @michael-hawker. I was working on the WCT chapter in my WinUI 3 book last week and over the weekend. I decided to write a simple sample app with WinUI on Desktop for the chapter. My original plan was to integrate some WCT controls into the WinUI on UWP sample app that spans multiple chapters.

Even with desktop/.NET5, I ran into some issues. No compile-time or runtime errors, but I couldn't get the DataGrid to render at all. The dropshadow panel was being flakey also (shadow rendering far from the child element). The same code on pure UWP works fine.

@michael-hawker
Copy link
Member Author

Thanks @alvinashcraft for the feedback. The DataGrid should be working, but there is an issue tracking that over here, I'm not too sure what's causing the problem there, but @RBrid is taking a look, FYI @azchohfi.

As for the DropShadowPanel, it should mostly be using the composition APIs, so if there's a problem there too, it'd be good to probably file an issue on WinUI as well.

@Wigmund
Copy link

Wigmund commented Jun 30, 2020

ItemsRepeater within the Expander control doesn't seem to work, ListView does though :)

@michael-hawker
Copy link
Member Author

@Wigmund do you have a repro you could share and more details about what you're not seeing working? Feel free to file a new issue specifically for your scenario. Thanks!

@michael-hawker michael-hawker changed the title [WinUI3] Windows Community Toolkit 8.0.0-preview1 for WinUI 3 Preview 1 [WinUI3] Windows Community Toolkit 8.0.0-preview1 for WinUI 3 Preview 2 Jul 15, 2020
@michael-hawker michael-hawker changed the title [WinUI3] Windows Community Toolkit 8.0.0-preview1 for WinUI 3 Preview 2 [WinUI3] Windows Community Toolkit 8.0.0-preview2 for WinUI 3 Preview 2 Jul 15, 2020
@alvinashcraft
Copy link
Contributor

alvinashcraft commented Jul 18, 2020

Regarding the workaround to add Generic.xaml to App.xaml to get DataGrid to work, is <Library_Name> a placeholder for the the name of my project's name or for the name of the WCT library we're referencing?

EDIT: Sorry, should have done some experimenting on my own before asking. I got DataGrid to display property by adding this to my App.xaml:

<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.DataGrid/Themes/Generic.xaml"/>

@michael-hawker
Copy link
Member Author

@azchohfi noticed on stream that the EnumValues Markup Extension was crashing in WinUI 3 Preview 2 with a pretty cryptic error when binding to a ComboBox?

<ComboBox ItemsSource="{ex:EnumValues Type=model:Purpose}"/>

This would probably be something we report to the WinUI team? I can share a sample.

@azchohfi
Copy link
Contributor

I think this is a CSWinRT issue. @stevenbrix , is this being tracked?

@Marv51
Copy link
Contributor

Marv51 commented Jan 21, 2021

@Noemata Disagree on the community call point strongly. Having a fun, short, higher level stream is much appreciated. An in-depth, technical and github-issue based discussion would be a very different format and a different show (that might be interesting, but not a replacement).

@Noemata
Copy link

Noemata commented Jan 21, 2021

@Marv51, fun times are what I might expect in high school. These meetings should be all business. Sorry to say. Wearing a tie to work was never about curtailing personal attire freedoms, as some may have assumed. It was about setting a marker of seriousness and coherence. Something we need way more of. I would love to indulge in a feel good vibe about WinUI. Microsoft stopped making that easy with Silverlight. Not forgetting, or forgiving or letting a repeat happen without a big noise.

It's probably time I shut up about my qualms. Let's see what happens by December. Time to be part of the solution.

@Marv51
Copy link
Contributor

Marv51 commented Jan 21, 2021

@Noemata Point taken, but please be respectful to these people. They put themselves out in public on the internet, they deserve our best manners. We all can do better than comparing them to 'high school' children.

@Noemata
Copy link

Noemata commented Jan 21, 2021

Part of the solution:

Set a meeting agenda, list attendees in advance with descriptions that include titles and areas of expertise, have a mechanism in place to notify of dates and times, have minutes taken, at the end of each meeting identify what questions will be answered and what questions cannot be for a given reason, establish milestones for the next meeting, with issues and deliverables communicated the next day as outcomes. I'm sure there's a Word Doc form for this. Perhaps someone needs to write a UWP App if we want to be more modern.

@Marv51
Copy link
Contributor

Marv51 commented Jan 21, 2021

@Noemata I think you might have to post your ideas/wishes for the call, on the issue for the call: microsoft/microsoft-ui-xaml#3942

Not sure people will see it here

@Noemata
Copy link

Noemata commented Jan 21, 2021

I have a lot of respect for @michael-hawker. I've noticed he tends to get the word out. It's actually the main reason I posted some of this here. Best for squirmy remarks to have less visibility.

@SavoySchuler
Copy link

SavoySchuler commented Jan 21, 2021

@Noemata Hi Mario, Savoy, here - I'm glad you tuned in yesterday and appreciate the passion you brought with your feedback here. I wanted to confirm for you that I am a relatively junior member (about 2.5 years at Microsoft) on our large and storied team - that's why my role is to be a moderator for your questions rather than one of the people answering them. 🙂

Perspective on OSS + WinUI Community Call

To me, the purpose of open source is increase transparency, collaboration, and community with our customers by exposing to you how WinUI gets made and by inviting you to be a part of that process. Before going open source, all the learning & growing (especially for junior team members) would still happen. But now as an artifact of being open source, we have to do all that learning and growing openly. Frankly, it can be easy for anyone to feel vulnerable in this position when they come across something they don't know or make a mistake, but I think it's its precisely moments like this that keeps us accountable to living a principle we practice at Microsoft: "It's better to be a learn-it-all, than a know-it-all." Leaning into this attitude is what has allowed junior team members room engage deeply and meaningfully with our community members in building some of our most headlining recent features like like InfoBar, PagerControl, DataGrid, and NumberBox. I imagine if we were "know-it-alls" all the time, that wouldn't leave much meaningful room to learn from our community members like yourself.

If you want to tune into just our most polished content, we often have high-production sessions at Microsoft conferences throughout the year. Between those, the WinUI Community Call is where we continue to engage with our community on a more conversational level. (This is not entirely unlike shipping our stable builds a couple times a year with Previews shipping monthly in between - this kind of cadence keeps us agile and ready to respond to your feedback.)

For the suits & ties business, the repo's Issues tab is the right place to engage our experts in a medium where responses can be thoughtful and thorough + engage our team decision makers. I'll assert there's nowhere more productive you can take your feedback than straight to the team you'd like to act on it. For what it's worth, @michael-hawker already deeply connected with our team in addition to being a regular guest of the community call. 🙂

Planned improvements to the WinUI Community Call

All that being said, you have called out something @anawishnoff and I have thought for a while now - the questions on the Community Call are getting more and more specific/technical and have not been coming through as cleanly with our current behind-the-scenes process. We met today and discussed slowing down the pace of Q&A so that our on-call guests and experts have time to join in on processing our incoming questions list with us, screen for which questions would be broadly valuable to be asked & addressed live, and paraphrase a crisp way to ask the question that (and maybe ensure its acronym free 😉). My hope is here is that this results in a better audience experience where you aren't having to wait through us figuring out what the question/how to respond. We'll see how it works.

Does this sound like we might have a few good steps to improving the call that you would look forward to?

All the rest...

For all your product focused feedback, I see you're also writing to the team here - that's definitely the right spot for ensuring you're heard by all our experts who might have answers and all our decision makers who value the feedback. I'll join the discussion there rather than writing a forked response here.

P.S. @Marv51 - Love your positivity, thanks for the support! We're working hard to make make everything happen, but are trying our best to stay accessible through the repo, the Community Call, and Twitter in between! 🙂

@michael-hawker michael-hawker changed the title [WinUI3] Windows Community Toolkit 8.0.0-preview3 for WinUI 3 Preview 3 [WinUI3] Windows Community Toolkit 8.0.0-preview4 for WinUI 3 Preview 4 Feb 11, 2021
@wbokkers
Copy link

ScrollHeader is not longer in the latest preview. Why is that? Is there an alternative?

@azchohfi
Copy link
Contributor

@curia-damiano
Copy link

I await for the update to Project Reunion 0.5, thanks in advance!

@michael-hawker michael-hawker changed the title [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 Mar 12, 2021
@michael-hawker
Copy link
Member Author

@curia-damiano sorry for the delay, it's available now!

@curia-damiano
Copy link

Thank you @michael-hawker , super fast!!!

@wbokkers
Copy link

Where can I find the Mouse.Cursor extension? It does not work anymore after swithing from Preview 4 to preview 5.

@Marv51
Copy link
Contributor

Marv51 commented Mar 12, 2021

Where can I find the Mouse.Cursor extension? It does not work anymore after swithing from Preview 4 to preview 5.

@wbokkers Looks like it was moved to the "Microsoft.Toolkit.Uwp.UI" nuget and renamed to
ui:FrameworkElementExtensions.Cursor="Hand"

@wbokkers
Copy link

@Marv51 Thanks!

@michael-hawker
Copy link
Member Author

michael-hawker commented 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
Copy link
Contributor

Marv51 commented 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
Copy link
Contributor

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!

@michael-hawker michael-hawker changed the title [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 Apr 1, 2021
@michael-hawker
Copy link
Member Author

Closing this issue now, if you have an issue with our WinUI bits, please let us know on this discussion.

@CommunityToolkit CommunityToolkit locked as resolved and limited conversation to collaborators Apr 1, 2021
@Sergio0694 Sergio0694 unpinned this issue May 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation 📃 for-review 📖 To evaluate and validate the Issues or PR improvements ✨ WinUI 💠 Related to WinUI 3 Version or when paired with External can mean requires fix in WinUI 2/3.
Projects
None yet
Development

No branches or pull requests