Exemple #1
0
        /// <summary>
        /// Method for appointment details.
        /// </summary>
        private void AppointmentDetails()
        {
            if (this.selectedAppointment == null)
            {
                this.selectedAppointment       = new Meeting();
                this.selectedAppointment.Color = Color.FromHex("#5EDAF2");
            }

            if (this.eventNameText.Text != null)
            {
                this.selectedAppointment.EventName = this.eventNameText.Text.ToString();
                if (string.IsNullOrEmpty(this.selectedAppointment.EventName))
                {
                    this.selectedAppointment.EventName = "Untitled";
                }
            }

            if (this.organizerText.Text != null)
            {
                this.selectedAppointment.Organizer = this.organizerText.Text.ToString();
            }

            this.selectedAppointment.From          = this.startDatePicker.Date.Add(this.startTimePicker.Time);
            this.selectedAppointment.To            = this.endDatePicker.Date.Add(this.endTimePicker.Time);
            this.selectedAppointment.IsAllDay      = this.switchAllDay.IsToggled;
            this.selectedAppointment.StartTimeZone = this.startTimeZone;
            this.selectedAppointment.EndTimeZone   = this.endTimeZone;

            ScheduleAppointmentModifiedEventArgs args = new ScheduleAppointmentModifiedEventArgs();

            args.Appointment = this.selectedAppointment;
            args.IsModified  = true;
            (this.editorLayout.BindingContext as EditorLayoutViewModel).OnAppointmentModified(args);
        }
Exemple #2
0
        /// <summary>
        /// Method for cancel.
        /// </summary>
        /// <param name="sender">Return the object</param>
        /// <param name="e">Event Args</param>
        private void CancelButton_Clicked(object sender, EventArgs e)
        {
            ScheduleAppointmentModifiedEventArgs args = new ScheduleAppointmentModifiedEventArgs();

            args.Appointment = null;
            args.IsModified  = false;
            (this.editorLayout.BindingContext as EditorLayoutViewModel).OnAppointmentModified(args);
            this.editorLayout.IsVisible = false;
        }
        /// <summary>
        /// method for appointment modified
        /// </summary>
        /// <param name="e">Schedule Appointment Modified Event Args</param>
        public virtual void OnAppointmentModified(ScheduleAppointmentModifiedEventArgs e)
        {
            EventHandler <ScheduleAppointmentModifiedEventArgs> handler = this.AppointmentModified;

            if (handler != null)
            {
                handler(this, e);
            }
        }
 /// <summary>
 /// editor layout
 /// </summary>
 /// <param name="sender">return the object</param>
 /// <param name="e">Schedule Appointment Modified Event args</param>
 private void EditorLayout_AppointmentModified(object sender, ScheduleAppointmentModifiedEventArgs e)
 {
     this.editorLayout.IsVisible = false;
     if (e.IsModified)
     {
         if (this.isNewAppointment)
         {
             (this.schedule.DataSource as ObservableCollection <Meeting>).Add(e.Appointment);
         }
         else
         {
             (this.schedule.DataSource as ObservableCollection <Meeting>).RemoveAt(this.indexOfAppointment);
             (this.schedule.DataSource as ObservableCollection <Meeting>).Insert(this.indexOfAppointment, e.Appointment);
         }
     }
 }