protected virtual void OnAppointmentModified(ScheduleAppointmentModifiedEventArgs e) { EventHandler <ScheduleAppointmentModifiedEventArgs> handler = AppointmentModified; if (handler != null) { handler(this, e); } }
void CancelButton_Clicked(object sender, EventArgs e) { ScheduleAppointmentModifiedEventArgs args = new ScheduleAppointmentModifiedEventArgs(); args.Appointment = null; args.IsModified = false; OnAppointmentModified(args); this.IsVisible = false; }
void SaveButton_Clicked(object sender, EventArgs e) { if (selectedAppointment == null) { selectedAppointment = new ScheduleAppointment(); } selectedAppointment.Subject = subjectText.Text.ToString(); selectedAppointment.StartTime = startDate_picker.Date.Add(startTime_picker.Time); selectedAppointment.EndTime = endDate_picker.Date.Add(endTime_picker.Time); selectedAppointment.Location = locationText.Text.ToString(); ScheduleAppointmentModifiedEventArgs args = new ScheduleAppointmentModifiedEventArgs(); args.Appointment = selectedAppointment; args.IsModified = true; OnAppointmentModified(args); this.IsVisible = false; }