public AppointmentEditor(SfScheduler scheduler, ScheduleAppointment appointment, DateTime dateTime) { InitializeComponent(); GetTimeZone(); this.scheduler = scheduler; this.appointment = appointment; if (appointment != null) { this.Subject.Text = appointment.Subject; this.StartDatePicker.Value = appointment.StartTime.Date; this.EndDatePicker.Value = appointment.EndTime.Date; this.StartTimePicker.Value = appointment.StartTime; this.EndTimePicker.Value = appointment.EndTime; this.location.Text = appointment.Location; this.description.Text = appointment.Notes; this.allDay.IsChecked = appointment.IsAllDay; this.ReminderList.ItemsSource = (IList)appointment.Reminders; this.ReminderList.ItemContainerGenerator.StatusChanged += this.OnListViewItemGeneratorStatusChanged; this.timeZone.IsChecked = (appointment.StartTimeZone != null); if ((bool)this.timeZone.IsChecked) { this.TimeZoneMenu.Text = appointment.StartTimeZone.ToString(); } } else { this.StartDatePicker.Value = dateTime.Date; this.EndDatePicker.Value = dateTime.Date; this.StartTimePicker.Value = dateTime; this.EndTimePicker.Value = dateTime.AddHours(1); } }
protected override void OnDetaching() { this.AssociatedObject.ValueChanged -= AssociatedObject_ValueChanged; window = null; scheduler = null; startHourLabel = null; endHourLabel = null; }
protected override void OnAttached() { window = App.Current.MainWindow as MainWindow; scheduler = window.Schedule; startHourLabel = window.startHourLabel; endHourLabel = window.endHourLabel; this.AssociatedObject.ValueChanged += AssociatedObject_ValueChanged; }
protected override void OnClosing(CancelEventArgs e) { base.OnClosing(e); this.Save.Click -= this.OnSaveClicked; this.Cancel.Click -= this.OnCancelClicked; this.scheduler = null; this.appointment = null; }
private void AssociatedObject_Loaded(object sender, RoutedEventArgs e) { scheduler = AssociatedObject.Schedule; this.UpdateTimeRulerFormat(); this.AssociatedObject.showHeader.Click += AssociatedObject_showHeader_Click; this.AssociatedObject.timeRuler.Click += AssociatedObject_timeRuler_Click; this.AssociatedObject.timeFormat.Click += OnTimeFormatClick; }
protected override void OnDetaching() { AssociatedObject.Loaded -= new System.Windows.RoutedEventHandler(AssociatedObject_Loaded); this.AssociatedObject.showHeader.Click -= AssociatedObject_showHeader_Click; this.AssociatedObject.timeRuler.Click -= AssociatedObject_timeRuler_Click; this.AssociatedObject.showHeader = null; this.AssociatedObject.timeRuler = null; scheduler = null; }
protected override void OnDetaching() { this.AssociatedObject.Click -= AssociatedObject_Click; window = null; scheduler = null; }
protected override void OnAttached() { window = App.Current.MainWindow as MainWindow; scheduler = window.Schedule; this.AssociatedObject.Click += AssociatedObject_Click; }
protected override void OnDetaching() { base.OnDetaching(); this.UnWireEvents(); this.scheduler = null; }
protected override void OnAttached() { base.OnAttached(); scheduler = this.AssociatedObject.FindName("Schedule") as SfScheduler; this.OnWirEvents(); }