Beispiel #1
0
        private void AppointmentDetails()
        {
            if (selectedAppointment == null)
            {
                selectedAppointment       = new Meeting();
                selectedAppointment.color = Color.FromHex("#5EDAF2");
            }
            if (eventNameText.Text != null)
            {
                selectedAppointment.EventName = eventNameText.Text.ToString();
                if (string.IsNullOrEmpty(selectedAppointment.EventName))
                {
                    selectedAppointment.EventName = "Untitled";
                }
            }
            if (organizerText.Text != null)
            {
                selectedAppointment.Organizer = organizerText.Text.ToString();
            }
            selectedAppointment.From     = startDate_picker.Date.Add(startTime_picker.Time);
            selectedAppointment.To       = endDate_picker.Date.Add(endTime_picker.Time);
            selectedAppointment.IsAllDay = switchAllDay.IsToggled;
            ScheduleAppointmentModifiedEventArgs args = new ScheduleAppointmentModifiedEventArgs();

            args.Appointment = selectedAppointment;
            args.IsModified  = true;
            (this.BindingContext as EditorLayoutViewModel).OnAppointmentModified(args);
        }
        public virtual void OnAppointmentModified(ScheduleAppointmentModifiedEventArgs e)
        {
            EventHandler <ScheduleAppointmentModifiedEventArgs> handler = AppointmentModified;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Beispiel #3
0
        private void CancelButton_Clicked(object sender, EventArgs e)
        {
            ScheduleAppointmentModifiedEventArgs args = new ScheduleAppointmentModifiedEventArgs();

            args.Appointment = null;
            args.IsModified  = false;
            (this.BindingContext as EditorLayoutViewModel).OnAppointmentModified(args);
            this.IsVisible = false;
        }
Beispiel #4
0
        private void EditorLayout_AppointmentModified(object sender, ScheduleAppointmentModifiedEventArgs e)
        {
            schedule.IsVisible = true;

            if (e.IsModified)
            {
                if (isNewAppointment)
                {
                    (schedule.DataSource as ObservableCollection <Meeting>).Add(e.Appointment);
                }
                else
                {
                    (schedule.DataSource as ObservableCollection <Meeting>).RemoveAt(indexOfAppointment);
                    (schedule.DataSource as ObservableCollection <Meeting>).Insert(indexOfAppointment, e.Appointment);
                }
            }
        }