using System; using System.Collections.ObjectModel; using System.Windows.Media; using System.Windows.Media.Imaging; using InABox.WPF; using PropertyChanged; using Syncfusion.UI.Xaml.Scheduler; namespace PRSDesktop { public interface ICalendarAppointment { // object Id { get; } // String? Subject { get; } // String? Notes { get; } // ObservableCollection ResourceIdCollection { get; } // DateTime StartTime { get; } // DateTime EndTime { get; } // Brush Foreground { get; } // Brush AppointmentBackground { get; } BitmapImage? Image { get; } object Model { get; } } public interface ICalendarAppointment : ICalendarAppointment { T Model { get; } } [DoNotNotify] public abstract class CalendarAppointment : ScheduleAppointment, ICalendarAppointment where T : IModel { //public object Id { get; set; } // public ObservableCollection ResourceIdCollection { get; set; } //public Brush Foreground { get; set; } // public Brush AppointmentBackground { get; set; } // // public abstract DateTime StartTime { get; set; } // public abstract DateTime EndTime { get; set; } // public abstract string? Subject { get; set; } // public abstract string? Notes { get; set; } public BitmapImage? Image { get; set; } public T Model { get; } object ICalendarAppointment.Model => Model; public CalendarAppointment(T model, Func employeeid, Func color) { Model = model; Id = model.ID; ResourceIdCollection = new ObservableCollection() { employeeid(model).ToString() }; String c = color(model); Color c2 = string.IsNullOrWhiteSpace(c) ? Colors.White : (Color)ColorConverter.ConvertFromString(c); AppointmentBackground = new SolidColorBrush(c2); Foreground = new SolidColorBrush(ImageUtils.GetForegroundColor(c2)); } } public class CalendarAppointments : ScheduleAppointmentCollection //ObservableCollection { }} { } }