namespace TeamViewerApi.ViewModels
{
    using System;
    using System.ComponentModel;
    using System.Linq.Expressions;

    public class BasicViewModel : INotifyPropertyChanged
    {
        private string header;

        public BasicViewModel()
        {
            this.header = string.Empty;
        }

        /// <summary>
        /// Tab header
        /// </summary>
        public string Header
        {
            get { return this.header; }
            set
            {
                this.header = value;

                this.RaisePropertyChanged(() => this.Header);
            }
        }

        #region INotifyPropertyChanged
        public event PropertyChangedEventHandler PropertyChanged = delegate { };

        internal void RaisePropertyChanged<T>(Expression<Func<T>> propertyExpression)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(propertyExpression.Name));
        }

        internal void RaisePropertyChanged(string propertyName)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
        #endregion
    }
}
