diff --git a/src/Avalonia.Diagnostics/ViewModels/ViewModelBase.cs b/src/Avalonia.Diagnostics/ViewModels/ViewModelBase.cs index a451b30efa..349404603a 100644 --- a/src/Avalonia.Diagnostics/ViewModels/ViewModelBase.cs +++ b/src/Avalonia.Diagnostics/ViewModels/ViewModelBase.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Runtime.CompilerServices; +using JetBrains.Annotations; namespace Avalonia.Diagnostics.ViewModels { @@ -9,6 +10,7 @@ namespace Avalonia.Diagnostics.ViewModels { public event PropertyChangedEventHandler PropertyChanged; + [NotifyPropertyChangedInvocator] protected bool RaiseAndSetIfChanged(ref T field, T value, [CallerMemberName] string propertyName = null) { if (!EqualityComparer.Default.Equals(field, value)) @@ -21,6 +23,7 @@ namespace Avalonia.Diagnostics.ViewModels return false; } + [NotifyPropertyChangedInvocator] protected void RaisePropertyChanged([CallerMemberName] string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));