示例#1
0
        private static void minChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SpinnerBase <T> control = (SpinnerBase <T>)d;
            Nullable <T>    min     = (Nullable <T>)e.NewValue;

            control.Value = coerceValue(control.Value, control.Max, min);
        }
示例#2
0
        protected virtual void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SpinnerBase <T> control = (SpinnerBase <T>)d;

            Nullable <T> value = (Nullable <T>)e.NewValue;

            control.valueTextBoxBase.Text = value == null ? "" : value.Value.ToString();
        }
示例#3
0
        private static void isReadOnlyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SpinnerBase <T> control    = (SpinnerBase <T>)d;
            bool            isReadOnly = (bool)e.NewValue;

            control.valueTextBoxBase.IsReadOnly = isReadOnly;
            control.upButtonBase.IsEnabled      = !isReadOnly;
            control.downButtonBase.IsEnabled    = !isReadOnly;
        }
示例#4
0
        static void timer_Tick(Object sender, EventArgs e)
        {
            SpinnerBase <T> spinner = (SpinnerBase <T>)(sender as VideoPlayerControl.Timers.DefaultTimer).Tag;

            spinner.Dispatcher.BeginInvoke(new Action(() =>
            {
                if (spinner.downButtonBase.IsPressed == true)
                {
                    spinner.subtractValue();
                }
                else if (spinner.upButtonBase.IsPressed == true)
                {
                    spinner.addValue();
                }
            }));

            timer.Interval = repeatDelayMS;
        }
示例#5
0
        private static void textAlignment_PropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SpinnerBase <T> control = (SpinnerBase <T>)d;

            control.valueTextBoxBase.TextAlignment = (TextAlignment)e.NewValue;
        }
示例#6
0
        private static void valueChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SpinnerBase <T> control = (SpinnerBase <T>)d;

            control.OnValueChanged(d, e);
        }