1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using System;
- using System.Collections.ObjectModel;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using InABox.WPF;
- using Syncfusion.UI.Xaml.Scheduler;
- namespace PRSDesktop
- {
-
- public interface ICalendarAppointment
- {
- // object Id { get; }
- // String? Subject { get; }
- // String? Notes { get; }
- // ObservableCollection<object> ResourceIdCollection { get; }
- // DateTime StartTime { get; }
- // DateTime EndTime { get; }
- // Brush Foreground { get; }
- // Brush AppointmentBackground { get; }
-
- BitmapImage? Image { get; }
- object Model { get; }
- }
-
- public interface ICalendarAppointment<T> : ICalendarAppointment
- {
- T Model { get; }
- }
-
- public abstract class CalendarAppointment<T> : ScheduleAppointment, ICalendarAppointment<T> where T : IModel
- {
- //public object Id { get; set; }
- // public ObservableCollection<object> 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<T?,Guid> employeeid, Func<T?,String> color)
- {
- Model = model;
- Id = model.ID;
- ResourceIdCollection = new ObservableCollection<object>() { 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<ICalendarAppointment> { }}
- {
- }
- }
|