private static void OnSelectedTimePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { RadClock radClock = d as RadClock; if (!radClock.IsReadOnly) { if (radClock != null) { radClock.OnSelectedTimeChanged(); } } }
private static void OnStartTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { RadClock clock = d as RadClock; if (clock == null) { return; } if (clock.ItemsSource != null) { clock.ItemsSource = clock.GenerateItemsSource(); } }
private static void OnTimeIntervalChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { RadClock clock = d as RadClock; if (clock == null) { return; } // NOTE: This cannot be true! TimeInterval is of type TimeSpan which is not nullable! if (clock.TimeInterval != null) { clock.TimeInterval = clock.ValidateTimeSpan(clock.TimeInterval); } if (clock.ItemsSource != null) { clock.ItemsSource = clock.GenerateItemsSource(); } }
private void RadClock_KeyDown(object sender, KeyEventArgs e) { RadClock clock = sender as RadClock; TimeSpan?selectedItem; if (this.SelectedTime != null) { selectedItem = clock.SelectedTime; } else { selectedItem = this.SelectedTime; } int index = this.Items.IndexOf(selectedItem); switch (e.Key) { case System.Windows.Input.Key.Right: this.ProcessKey(index + 1); e.Handled = true; break; case System.Windows.Input.Key.Left: this.ProcessKey(index - 1); e.Handled = true; break; case System.Windows.Input.Key.Home: this.ProcessKey(0); e.Handled = true; break; case System.Windows.Input.Key.End: this.ProcessKey(this.Items.Count - 1); e.Handled = true; break; default: break; } }