You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
749 B
21 lines
749 B
using System.ComponentModel; |
|
using System.Runtime.CompilerServices; |
|
|
|
namespace StabilityMatrix.Avalonia.Diagnostics.LogViewer.Core.ViewModels; |
|
|
|
public class ObservableObject : INotifyPropertyChanged |
|
{ |
|
protected bool Set<TValue>(ref TValue field, TValue newValue, [CallerMemberName] string? propertyName = null) |
|
{ |
|
if (EqualityComparer<TValue>.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)); |
|
}
|
|
|