示例#1
0
        public static void OnLastPositionCommand(Object sender, ExecutedRoutedEventArgs e)
        {
            TimeSpanUpDown copy = sender as TimeSpanUpDown;

            if (copy != null)
            {
                copy.OnUpdatePostion(-1);
            }
        }
示例#2
0
        private static void OnUpdateMinMax(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TimeSpanUpDown copy = d as TimeSpanUpDown;

            if (copy != null)
            {
                copy.Position = 0;
            }
        }
示例#3
0
 private static object CoerceValue(DependencyObject obj, object value)
 {
     if (value.GetType() == typeof(int) && value != null)
     {
         TimeSpanUpDown copy = obj as TimeSpanUpDown;
         if (copy != null)
         {
             if ((int)value > (int)copy.Maximum)
             {
                 return((int)copy.Minimum);
             }
             else if ((int)value < (int)copy.Minimum)
             {
                 return((int)copy.Maximum);
             }
             return(value);
         }
     }
     return(0);
 }