using System.ComponentModel; using System.Runtime.CompilerServices; namespace VersOne.Epub.WpfDemo.ViewModels { /// /// The base class for all view models in this application. /// public abstract class ViewModel : INotifyPropertyChanged { /// /// Occurs when a property value changes. /// public event PropertyChangedEventHandler PropertyChanged; /// /// Triggers the event. /// /// /// Property name to be supplied for the event. /// If this parameter is not set, then the property name of the caller is used. /// protected void NotifyPropertyChanged([CallerMemberName]string propertyName = "") { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } }