Closed Qws closed 2 years ago
Maybe use MvvmToolKit is a optional way https://github.com/CommunityToolkit/MVVM-Samples/blob/master/samples/MvvmSample.Core/ViewModels/Widgets/ValidationFormWidgetViewModel.cs
MAUI needs out of the box x:Bind support.
Use this library:
https://github.com/levitali/CompiledBindings
This library provides {x:Bind} Markup Extension for WPF, MAUI and Xamarin Forms. You can read about {x:Bind} Markup Extension for UWP here. The whole functionality of {x:Bind} for UWP and also many other features are supported.
At XAML compile time, {x:Bind} is converted into C# code.
Thanks for the suggestion! It seems that we have attempted something like this in the past, but it wasn't received very well. So I think, before we do anything of the sorts, we might probably be better of starting a discussion where we test the waters and see how people feel about it and explore different ways to solve this issue. Feel free to open a discussion with all the arguments you have for this and maybe tag some of the people in the linked thread to get it going.
In the meanwhile there are alternatives like suggested.
Thanks!
Description
I have to constantly write ICommand properties .. everything works, but after using UWP and WASDK for a while, I think writing Commands is honestly annoying and also doesn't make ViewModel readable and managable.
Public API Changes
MAUI/WPF/Silverlight version:
And now UWP version:
Look at the differences, this is just 1 ICommand... It makes viewmodels unnecessarily verbose the more commands you add.
Intended Use-Case
Both ways work, but obviously writing less code leads to cleaner ViewModels...
MAUI needs out of the box x:Bind support. I don't really mind the lack of web/Linux support, I much rather want the best (enhanced) C#/XAML multiplatform coding experience that just works on the platforms that's supported.
We really need to move on from 2006 XP/Vista/WPF/Silverlight era Bindings and commands...