diff --git a/Massmailer.Shared/Model/MassmailerProject.cs b/Massmailer.Shared/Model/MassmailerProject.cs index 1532521..63f896a 100644 --- a/Massmailer.Shared/Model/MassmailerProject.cs +++ b/Massmailer.Shared/Model/MassmailerProject.cs @@ -1,18 +1,22 @@ using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; namespace Massmailer.Shared.Model { - public class MassmailerProject + public class MassmailerProject : INotifyPropertyChanged { public MassmailerProject() { - this.Recipients = new List(); + this.Recipients = new ObservableCollection(); } - public List Recipients { get; set; } + public ObservableCollection Recipients { get; set; } public string Subject { get; set; } public string Body { get; set; } + + public event PropertyChangedEventHandler PropertyChanged; } } diff --git a/Massmailer.Shared/Model/MassmailerRecipient.cs b/Massmailer.Shared/Model/MassmailerRecipient.cs index bece288..94a2ec8 100644 --- a/Massmailer.Shared/Model/MassmailerRecipient.cs +++ b/Massmailer.Shared/Model/MassmailerRecipient.cs @@ -1,13 +1,44 @@ using System; +using System.ComponentModel; namespace Massmailer.Shared.Model { - public class MassmailerRecipient + public class MassmailerRecipient : INotifyPropertyChanged { - public string Address { get; set; } + private string address; + private bool isSent; + private DateTime sentDate; - public bool IsSent { get; set; } + public string Address + { + get { return this.address; } + set + { + this.address = value; + this.PropertyChanged(this, new PropertyChangedEventArgs(nameof(this.Address))); + } + } - public DateTime SentDate { get; set; } + public bool IsSent + { + get { return this.isSent; } + set + { + this.isSent = value; + this.PropertyChanged(this, new PropertyChangedEventArgs(nameof(this.IsSent))); + } + } + + public DateTime SentDate + { + get { return this.sentDate; } + set + { + this.sentDate = value; + this.PropertyChanged(this, new PropertyChangedEventArgs(nameof(this.SentDate))); + } + } + + public event PropertyChangedEventHandler PropertyChanged; } } diff --git a/Massmailer.UI/Views/MainView.xaml b/Massmailer.UI/Views/MainView.xaml index 7836fe0..3137152 100644 --- a/Massmailer.UI/Views/MainView.xaml +++ b/Massmailer.UI/Views/MainView.xaml @@ -5,8 +5,74 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Massmailer.UI" mc:Ignorable="d" - Title="MainWindow" Height="450" Width="800" Loaded="Window_Loaded"> + Title="Massmailer" Height="450" Width="800" Loaded="Window_Loaded"> -