private static void TimePropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (d != null & d is ClockUserCtrl) { ClockUserCtrl clock = d as ClockUserCtrl; clock.OnTimeUpdated((DateTime)e.OldValue, (DateTime)e.NewValue); } }
private static void ExecuteSpeak(object sender, ExecutedRoutedEventArgs arg) { ClockUserCtrl clock = sender as ClockUserCtrl; if (clock != null) { clock.SpeakTheTime(); } }
private static void CanExecuteSpeak(object sender, CanExecuteRoutedEventArgs arg) { ClockUserCtrl clock = sender as ClockUserCtrl; arg.CanExecute = (clock != null); }