|
|
@@ -1,5 +1,7 @@
|
|
|
using System;
|
|
|
using System.Collections.ObjectModel;
|
|
|
+using System.ComponentModel;
|
|
|
+using System.Runtime.CompilerServices;
|
|
|
using System.Windows.Media;
|
|
|
using System.Windows.Media.Imaging;
|
|
|
using Comal.Classes;
|
|
|
@@ -26,7 +28,7 @@ namespace PRSDesktop
|
|
|
BitmapImage? Image { get; }
|
|
|
object Model { get; }
|
|
|
|
|
|
- Employee Employee { get; }
|
|
|
+ Employee? Employee { get; }
|
|
|
|
|
|
TimeSpan StartTime { get; }
|
|
|
TimeSpan EndTime { get; }
|
|
|
@@ -41,10 +43,19 @@ namespace PRSDesktop
|
|
|
}
|
|
|
|
|
|
[DoNotNotify]
|
|
|
- public abstract class CalendarAppointment<T> : ICalendarAppointment<T>
|
|
|
+ public abstract class CalendarAppointment<T> : ICalendarAppointment<T>, INotifyPropertyChanged
|
|
|
where T : notnull
|
|
|
{
|
|
|
- public Employee Employee { get; set; }
|
|
|
+ private Employee? _employee;
|
|
|
+ public Employee? Employee
|
|
|
+ {
|
|
|
+ get => _employee;
|
|
|
+ set
|
|
|
+ {
|
|
|
+ _employee = value;
|
|
|
+ OnPropertyChanged();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
public BitmapImage? Image { get; set; }
|
|
|
|
|
|
@@ -74,6 +85,13 @@ namespace PRSDesktop
|
|
|
Background = new SolidColorBrush(c2);
|
|
|
Foreground = new SolidColorBrush(ImageUtils.GetForegroundColor(c2));
|
|
|
}
|
|
|
+
|
|
|
+ public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
+
|
|
|
+ protected void OnPropertyChanged([CallerMemberName] string? propertyName = null)
|
|
|
+ {
|
|
|
+ PropertyChanged?.Invoke(this, new(propertyName));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public class CalendarAppointments : ScheduleAppointmentCollection //ObservableCollection<ICalendarAppointment> { }}
|