diff --git a/src/settings-ui/Settings.UI.Library/ViewModels/MeasureToolViewModel.cs b/src/settings-ui/Settings.UI.Library/ViewModels/MeasureToolViewModel.cs index beaf571a73..2f94853e39 100644 --- a/src/settings-ui/Settings.UI.Library/ViewModels/MeasureToolViewModel.cs +++ b/src/settings-ui/Settings.UI.Library/ViewModels/MeasureToolViewModel.cs @@ -52,6 +52,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels SendConfigMSG(outgoing.ToString()); NotifyPropertyChanged(); + NotifyPropertyChanged(nameof(ShowContinuousCaptureWarning)); } } } @@ -69,6 +70,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels { Settings.Properties.ContinuousCapture = value; NotifyPropertyChanged(); + NotifyPropertyChanged(nameof(ShowContinuousCaptureWarning)); } } } @@ -162,9 +164,21 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels public void NotifyPropertyChanged([CallerMemberName] string propertyName = null) { OnPropertyChanged(propertyName); + + if (propertyName == nameof(ShowContinuousCaptureWarning)) + { + // Don't trigger a settings update if the changed property is for visual notification. + return; + } + SettingsUtils.SaveSettings(Settings.ToJsonString(), MeasureToolSettings.ModuleName); } + public bool ShowContinuousCaptureWarning + { + get => IsEnabled && ContinuousCapture; + } + private Func SendConfigMSG { get; } } } diff --git a/src/settings-ui/Settings.UI/Views/MeasureToolPage.xaml b/src/settings-ui/Settings.UI/Views/MeasureToolPage.xaml index 8f01fc36f2..49c5ad068c 100644 --- a/src/settings-ui/Settings.UI/Views/MeasureToolPage.xaml +++ b/src/settings-ui/Settings.UI/Views/MeasureToolPage.xaml @@ -46,10 +46,9 @@ + IsOpen="{x:Bind Mode=OneWay, Path=ViewModel.ShowContinuousCaptureWarning}" + IsTabStop="{x:Bind Mode=OneWay, Path=ViewModel.ShowContinuousCaptureWarning}" + IsClosable="False" />