using System.ComponentModel; using System.Runtime.CompilerServices; namespace StabilityMatrix.Avalonia.Diagnostics.LogViewer.Core.ViewModels; public class ObservableObject : INotifyPropertyChanged { protected bool Set( ref TValue field, TValue newValue, [CallerMemberName] string? propertyName = null ) { if (EqualityComparer.Default.Equals(field, newValue)) return false; field = newValue; OnPropertyChanged(propertyName); return true; } public event PropertyChangedEventHandler? PropertyChanged; protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); }