MAUI CommunityToolkit differences #146
-
This library provides ValueTask support for commands via AsyncValueCommand, but the MAUI CommunityToolkit doesn't currently offer that. Is this the main difference? That is kind of a killer feature, but CommunityToolkit works across more products like Blazor, WPF, etc. Makes it hard to choose. The NotifyCanExecuteChanged events seem to take ages with the CommunityToolkit, and I'm starting to regret porting away. Since CommunityToolkit is the main competitor, it seems worthwhile to do a writeup about the advantages/disadvantages so that developers can be aware, and not make my mistake. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'm not sure if you are aware of the irony of calling the Community Toolkit a competitor to AsyncAwaitBestPractices. It's not a competitor, rather it's another of my open source projects. I'm the lead developer on the .NET MAUI Community Toolkit and I contributed AsyncAwaitBestPractices's AsyncValueCommand implementation to the Xamarin Community Toolkit. To answer your question, the path forward for .NET MAUI developers is to use CommunityToolkit.MVVM's RelayCommand: https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/generators/relaycommand It's the most performant implementation of an Async Command and its implementation using Source Generators will save you from writing much boiler plate code. Highly recommend it 💯 |
Beta Was this translation helpful? Give feedback.
I'm not sure if you are aware of the irony of calling the Community Toolkit a competitor to AsyncAwaitBestPractices. It's not a competitor, rather it's another of my open source projects.
I'm the lead developer on the .NET MAUI Community Toolkit and I contributed AsyncAwaitBestPractices's AsyncValueCommand implementation to the Xamarin Community Toolkit.
To answer your question, the path forward for .NET MAUI developers is to use CommunityToolkit.MVVM's RelayCommand: https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/generators/relaycommand
It's the most performant implementation of an Async Command and its implementation using Source Generators will save you from writing much…