using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using System.ComponentModel;

namespace Samples.Shared
{
    public class Message : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private string subject;
        private string sender;
        private int size;
        private bool selected;

        public string Subject
        {
            get
            {
                return this.subject;
            }
            set
            {
                this.subject = value;
                this.OnPropertyChanged("Subject");
            }
        }

        public string Sender
        {
            get
            {
                return this.sender;
            }
            set
            {
                this.sender = value;
                this.OnPropertyChanged("Sender");
            }
        }

        public int Size
        {
            get
            {
                return this.size;
            }
            set
            {
                this.size = value;
                this.OnPropertyChanged("Size");
            }
        }

        public bool Selected
        {
            get
            {
                return this.selected;
            }
            set
            {
                this.selected = value;
                this.OnPropertyChanged("Selected");
            }
        }

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
