private static void OnValueChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { TimeControl control = obj as TimeControl; var newTime = (TimeSpan)e.NewValue; control.Hours = newTime.Hours; control.Minutes = newTime.Minutes; control.Seconds = newTime.Seconds; control.Milliseconds = newTime.Milliseconds; }
private static void OnTimeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { TimeControl control = obj as TimeControl; control.Value = new TimeSpan(0, control.Hours, control.Minutes, control.Seconds, control.Milliseconds); }