private static void UseValidTimesChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { TimeCtrl tc = d as TimeCtrl; if (tc != null && e.NewValue is bool) { tc.SetIsValidTime(); } }
private static void ValueChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) { TimeCtrl tc = d as TimeCtrl; if (tc != null && e.NewValue is DateTime) { foreach (UIElement ele in tc.TimeCtrls.Children) { var ctrl = ele as FrameworkElement; HMSType hmsType = ctrl.get_HMSType(); if (hmsType != HMSType.unknown) { var tb = ctrl as TextBox; if (tb != null) { tb.set_HMSText((DateTime)e.NewValue); } } } tc.SetIsValidTime(); } }