Exemplo n.º 1
0
        private static void OnFractionalSecondsDigitsCountChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            TimeSpanUpDown timeSpanUpDown = o as TimeSpanUpDown;

            if (timeSpanUpDown != null)
            {
                timeSpanUpDown.OnFractionalSecondsDigitsCountChanged(( int )e.OldValue, ( int )e.NewValue);
            }
        }
Exemplo n.º 2
0
        private static object OnCoerceFractionalSecondsDigitsCount(DependencyObject o, object value)
        {
            TimeSpanUpDown timeSpanUpDown = o as TimeSpanUpDown;

            if (timeSpanUpDown != null)
            {
                int digitsCount = (int)value;
                if (digitsCount < 0 || digitsCount > 3)
                {
                    throw new ArgumentException("Fractional seconds digits count must be between 0 and 3.");
                }
            }
            return(value);
        }