Exemplo n.º 1
0
        private static void OnRepeatDelayChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            InlineButton button = d as InlineButton;

            if (button.privatePropertyChange)
            {
                return;
            }

            int newValue = (int)e.NewValue;

            if (newValue < 0)
            {
                button.ChangePropertyPrivately(RepeatDelayProperty, 0);
            }
        }
Exemplo n.º 2
0
        private static void OnRepeatIntervalChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            InlineButton button = d as InlineButton;

            if (button.privatePropertyChange)
            {
                return;
            }

            int newValue = (int)e.NewValue;

            if (newValue < 0)
            {
                button.ChangePropertyPrivately(RepeatIntervalProperty, 0);
                newValue = 0;
            }

            button.repeatTimer.Interval = TimeSpan.FromMilliseconds(newValue);
        }