-
The best way to implement INotifyPropertyChanged in .NET Maui
This is the best way that I've discovered to implement INotifyPropertyChanged in a XAML based MVVM app without downloading any extra supporting code.It relies on the ref keyword to allow a method in the base class to modify the property that you wish to raise a property changed event for. The code is fairly concise and it doesn't add any unseen overhead.
In your view model all you need to do is:
namespace Nogginbox.MyApp.ViewModels;
public class MyViewModel : ObservableViewModelBase
{
public string Name
{
get => _name;
set => SetProperty(ref _name, value);
} …