using System.ComponentModel;
using MasaBlazorApp3.Pojo;

namespace MasaBlazorApp3
{
    public class GlobalStateService : INotifyPropertyChanged
    {
        private User _operator;
        private User _reviewer;

        public User Operator
        {
            get { return _operator; }
            set
            {
                _operator = value;
                //OnPropertyChanged();
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Operator"));
            }
        }

        public User Reviewer
        {
            get => _reviewer;
            set
            {
                _reviewer = value;
                //OnPropertyChanged();
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Reviewer"));
            }
        }

        public bool isInit { get; set; } = false;

        public event PropertyChangedEventHandler? PropertyChanged;

        //protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        //{

        //}
    }
}
