コード例 #1
0
        public async Task <AppointmentChangeRequestNotification> PublishAppointmentChangeRequestNotification(AppointmentChangeRequest appointmentChangeRequest, DateTime timestamp, string message)
        {
            var notification = new AppointmentChangeRequestNotification();

            await Create(notification);

            notification.IsActive = true;
            notification.AppointmentChangeRequest = appointmentChangeRequest;
            notification.Timestamp = timestamp;
            notification.Status    = NotificationStatus.Unread;
            notification.Message   = message;

            return(await Update(notification) as AppointmentChangeRequestNotification);
        }
コード例 #2
0
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            var selectedTemplate = SurgeryNotificationTemplate;

            var notification = item as Notification;

            selectedTemplate = notification switch
            {
                SurgeryNotification _ => SurgeryNotificationTemplate,
                SurgeryRequestNotification _ => SurgeryRequestNotificationTemplate,
                AppointmentRequestNotification _ => AppointmentRequestNotificationTemplate,
                AppointmentChangeRequestNotification _ => AppointmentChangeRequestNotificationTemplate,
                                    _ => selectedTemplate
            };
            return(selectedTemplate);
        }
    }