diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs index b616bb2a..5a8282da 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Core/Primitives/UpDownBase.cs @@ -44,6 +44,17 @@ namespace Microsoft.Windows.Controls.Primitives #endregion //AllowSpin + #region MouseWheelActiveOnFocus + + public static readonly DependencyProperty MouseWheelActiveOnFocusProperty = DependencyProperty.Register("MouseWheelActiveOnFocus", typeof(bool), typeof(UpDownBase), new UIPropertyMetadata(true)); + public bool MouseWheelActiveOnFocus + { + get { return (bool)GetValue(MouseWheelActiveOnFocusProperty); } + set { SetValue(MouseWheelActiveOnFocusProperty, value); } + } + + #endregion //MouseWheelActiveOnFocus + #region ShowButtonSpinner public static readonly DependencyProperty ShowButtonSpinnerProperty = DependencyProperty.Register("ShowButtonSpinner", typeof(bool), typeof(UpDownBase), new UIPropertyMetadata(true)); @@ -155,7 +166,7 @@ namespace Microsoft.Windows.Controls.Primitives { base.OnMouseWheel(e); - if (!e.Handled && AllowSpin && TextBox.IsFocused) + if (!e.Handled && AllowSpin && ((TextBox.IsFocused && MouseWheelActiveOnFocus) || !MouseWheelActiveOnFocus)) { if (e.Delta < 0) { @@ -260,7 +271,7 @@ namespace Microsoft.Windows.Controls.Primitives } #region Abstract - + /// /// Coerces the value. ///