
using PropertyChanged;
using System.ComponentModel;

namespace VSview
{
    /// <summary>
    /// Base View model that fires property changed event
    /// </summary>
    [AddINotifyPropertyChangedInterface]
    public class BaseViewModel : INotifyPropertyChanged
    {
        /// <summary>
        /// Event that is fired when property is changed
        /// </summary>
        public event PropertyChangedEventHandler PropertyChanged = (sender, e) => { };

        /// <summary>
        /// Method for firing <see cref="PropertyChanged"/> event
        /// </summary>
        /// <param name="name"> name of the property which changed </param>
        public void OnPropertyChanged(string name)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(name));
        }
    }
}
