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); } }
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); }