示例#1
0
 private static decimal LimitValueByBounds(decimal newValue, SpinnerControl control)
 {
     newValue = Math.Max(control.Minimum, Math.Min(control.Maximum, newValue));
     //  then ensure the number of decimal places is correct.
     newValue = decimal.Round(newValue, control.DecimalPlaces);
     return(newValue);
 }
示例#2
0
 public static IObservable <double> SelectValueChanges(SpinnerControl spinnerControl)
 {
     return(Observable.FromEventPattern <
                RoutedPropertyChangedEventHandler <decimal>,
                RoutedPropertyChangedEventArgs <double> >(a => spinnerControl.ValueChanged += a, a => spinnerControl.ValueChanged += a)
            .Select(a => a.EventArgs.NewValue));
 }
示例#3
0
        protected static void OnIncreaseCommand(object sender, ExecutedRoutedEventArgs e)
        {
            SpinnerControl control = sender as SpinnerControl;

            if (control != null)
            {
                control.OnIncrease();
            }
        }