using System; using System.ComponentModel; // ReSharper disable CheckNamespace namespace DTS.Common.Base { public abstract class BasePropertyChanged : IBasePropertyChanged { public virtual event PropertyChangedEventHandler PropertyChanged; public bool SetProperty(ref T storage, T value, String propertyName = null) { if (Equals(storage, value)) return false; storage = value; OnPropertyChanged(propertyName); return true; } public virtual void OnPropertyChanged(string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } }