using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HelloXaml.Models
{
    public class Person: INotifyPropertyChanged
    {
        public string Name { get; set { 
            if(field!= value)
                {
                    field = value;
                    INotifyPropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Name)));
                }
            } 
        }
        public int Age { get; set {
                if (field != value) { field = value;
                    INotifyPropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Age)));
                }
                    
            }
        }

        public event PropertyChangedEventHandler INotifyPropertyChanged;
    }
}
