Пример #1
0
        private static void OnValueChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            TimeControl control = obj as TimeControl;

            control.Hours   = ((TimeSpan)e.NewValue).Hours;
            control.Minutes = ((TimeSpan)e.NewValue).Minutes;
            control.Seconds = ((TimeSpan)e.NewValue).Seconds;
        }
Пример #2
0
        private static void OnTimeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            TimeControl control = obj as TimeControl;

            control.Hours   = GetMinMaxTimeValue(control.Hours, 23);
            control.Minutes = GetMinMaxTimeValue(control.Minutes, 59);
            control.Seconds = GetMinMaxTimeValue(control.Seconds, 59);

            control.Value = new TimeSpan(control.Hours,
                                         control.Minutes,
                                         control.Seconds);
        }