using System.ComponentModel;
using System.Collections.ObjectModel;

namespace WPBinding4
{
    public class Persons : ObservableCollection<Person>
    {
    }
    public class Person:INotifyPropertyChanged
    {
        private string name;
        private string firstName;
        private int age;

        public string LastName {
            get
            {
                return name;
            }
            set
            {
                name = value;
                NotifyPropertyChanged("LastName");
            }
        }
        public string FirstName
        {
            get
            {
                return firstName;
            }
            set
            {
                firstName = value;
                NotifyPropertyChanged("FirstName");
            }
        }
        public int Age
        {
            get
            {
                return age;
            }
            set
            {
                age = value;
                NotifyPropertyChanged("Age");
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;


        private void NotifyPropertyChanged(string info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }

        public Order Order { get; set; }

    }
    public class Order
    {
        public int ID { get; set; }
        public string Name { get; set; }
    }
}
