예제 #1
0
 private static void TimePropertyChangedCallback(DependencyObject sender, DependencyPropertyChangedEventArgs arg)
 {
     if (sender != null && sender is ClockUserCtrl)
     {
         ClockUserCtrl clock = sender as ClockUserCtrl;
         clock.OnTimeUpdated((DateTime)arg.OldValue, (DateTime)arg.NewValue);//更新前后的值
     }
 }
예제 #2
0
        private static void ExecuteSpeak(object sender, ExecutedRoutedEventArgs arg)
        {
            ClockUserCtrl clock = sender as ClockUserCtrl;

            if (clock != null)
            {
                clock.SpeakTheTime();
            }
        }
예제 #3
0
        private static void CanExecuteSpeak(object sender, CanExecuteRoutedEventArgs arg)
        {
            ClockUserCtrl clock = sender as ClockUserCtrl;

            arg.CanExecute = (clock != null);
        }