[OOBE]Fix not shortcut not updating (#21175)

* [OOBE]Fix not shortcut not updating

Fix for issue #20953.
Activation key update in the OOBE window
when the user changes it in the settings window.
Add settings repository reference to the ViewModel
constructor to use the repository settings object
(and not create a second instance of it).

* Fix for issue #20953.

Unit test fixed.
This commit is contained in:
Laszlo Nemeth
2022-10-13 09:46:30 +02:00
committed by GitHub
parent ee904ae1b1
commit ab41b61e84
10 changed files with 79 additions and 39 deletions

View File

@@ -175,13 +175,15 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
if (Settings.Properties.ActivationShortcut != value)
{
Settings.Properties.ActivationShortcut = value;
NotifyPropertyChanged();
SendConfigMSG(
string.Format(
CultureInfo.InvariantCulture,
"{{ \"powertoys\": {{ \"{0}\": {1} }} }}",
MeasureToolSettings.ModuleName,
JsonSerializer.Serialize(Settings)));
string.Format(
CultureInfo.InvariantCulture,
"{{ \"powertoys\": {{ \"{0}\": {1} }} }}",
MeasureToolSettings.ModuleName,
JsonSerializer.Serialize(Settings)));
}
}
}
@@ -189,7 +191,6 @@ 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.