Ejemplo n.º 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);//更新前后的值
     }
 }
Ejemplo n.º 2
0
        private static void ExecuteSpeak(object sender, ExecutedRoutedEventArgs arg)
        {
            ClockUserCtrl clock = sender as ClockUserCtrl;

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

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