using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; namespace sikFtpClient.ViewModel { public abstract class BaseViewModel : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } protected virtual bool SetProperty(ref T storage, T value, [CallerMemberName] string propertyName = "") { if (EqualityComparer.Default.Equals(storage, value)) return false; storage = value; this.OnPropertyChanged(propertyName); return true; } } }