diff --git a/DPackRx/Features/Miscellaneous/MouseWheelZoomListener.cs b/DPackRx/Features/Miscellaneous/MouseWheelZoomListener.cs index f9c903e..7c48fc5 100644 --- a/DPackRx/Features/Miscellaneous/MouseWheelZoomListener.cs +++ b/DPackRx/Features/Miscellaneous/MouseWheelZoomListener.cs @@ -1,6 +1,8 @@ using System.ComponentModel.Composition; +using DPackRx.Options; using DPackRx.Services; +using DPackRx.Extensions; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Utilities; @@ -21,7 +23,10 @@ internal class MouseWheelZoomListener : IWpfTextViewCreationListener public void TextViewCreated(IWpfTextView textView) { - textView.Options.SetOptionValue(DefaultWpfViewOptions.EnableMouseWheelZoomId, false); + var optionsService = _serviceProvider?.GetService(false); + var mouseWheelZoom = optionsService != null && optionsService.GetBoolOption(KnownFeature.Miscellaneous, "MouseWheelZoom", false); + + textView.Options.SetOptionValue(DefaultWpfViewOptions.EnableMouseWheelZoomId, mouseWheelZoom); } #endregion diff --git a/DPackRx/Options/OptionsGeneral.cs b/DPackRx/Options/OptionsGeneral.cs index 8db21fa..3037bb7 100644 --- a/DPackRx/Options/OptionsGeneral.cs +++ b/DPackRx/Options/OptionsGeneral.cs @@ -26,6 +26,7 @@ public class OptionsGeneral : OptionsBase #region Fields private bool _logging; + private bool _mouseWheelZoom; private ICommand _assignShortcutsCommand; private ICommand _loggingCommand; private ICommand _logFolderCommand; @@ -61,6 +62,16 @@ public bool Logging } } + public bool MouseWheelZoom + { + get { return _mouseWheelZoom; } + set + { + _mouseWheelZoom = value; + RaisePropertyChanged(nameof(this.MouseWheelZoom)); + } + } + #endregion #region Commands @@ -132,6 +143,7 @@ protected override void OnLoad() if (!this.Logging) _logging = true; #endif + _mouseWheelZoom = this.OptionsService.GetBoolOption(KnownFeature.Miscellaneous, "MouseWheelZoom", false); Refresh(); } @@ -145,6 +157,8 @@ protected override void OnSave() var log = this.ServiceProvider.GetService(); log.Enabled = _logging; + + this.OptionsService.SetBoolOption(KnownFeature.Miscellaneous, "MouseWheelZoom", _mouseWheelZoom); } #endregion @@ -154,6 +168,7 @@ protected override void OnSave() private void Refresh() { RaisePropertyChanged(nameof(this.Logging)); + RaisePropertyChanged(nameof(this.MouseWheelZoom)); } private void OnAssignShortcuts(object parameter) diff --git a/DPackRx/Options/OptionsGeneralControl.xaml b/DPackRx/Options/OptionsGeneralControl.xaml index 4b659bf..8caa275 100644 --- a/DPackRx/Options/OptionsGeneralControl.xaml +++ b/DPackRx/Options/OptionsGeneralControl.xaml @@ -6,7 +6,7 @@ xmlns:local="clr-namespace:DPackRx.Options" xmlns:ui="clr-namespace:DPackRx.UI" mc:Ignorable="d" - d:DesignHeight="200" d:DesignWidth="400"> + d:DesignHeight="260" d:DesignWidth="400"> @@ -17,24 +17,36 @@ - - - -