diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index d0876166f1..24ff597723 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -91,7 +91,6 @@ APPIDS appium Applets Applicationcan -applicationconfiguration applicationframehost appmanifest APPNAME @@ -158,7 +157,6 @@ BCB BCCE BCCEA bck -Bcl BDB BDBAD BDCC @@ -239,7 +237,6 @@ Cangjie CANRENAME CAPTUREBLT CAPTURECHANGED -CARRAY CAtl CBA CBB @@ -281,7 +278,6 @@ chdir CHILDACTIVATE CHILDWINDOW chrdavis -Chromakey Chrzan CHT cidl @@ -424,7 +420,6 @@ Dac dacl DAF damienleroy -DANGEROUSLYCOMMITMERELYTODISKCACHE DARKPURPLE DARKTEAL DARKYELLOW @@ -456,13 +451,11 @@ dcompi DComposition dcr dcs -Dct DDCDD DDCE DDEIf DDevice ddf -Dds DDxgi Deact debian @@ -494,8 +487,6 @@ depersist deprioritized depsfileslistspath deref -READOBJECTS -WRITEOBJECTS DESKTOPABSOLUTEEDITING DESKTOPABSOLUTEPARSING desktopshorcutinstalled @@ -623,6 +614,7 @@ Emoji ENABLEDELAYEDEXPANSION enabledisable ENABLEDPOPUP +encodedlaunch encryptor endpointvolume endregion @@ -663,8 +655,6 @@ exabyte examplehandler examplepowertoy EXAND -Excep -EXCEPINFO EXCLUDEFROMCAPTURE exdisp executionpolicy @@ -789,7 +779,6 @@ GETSTATE GETTEXT GETTEXTLENGTH GHND -Globbing GMEM GNumber google @@ -834,7 +823,6 @@ HCRYPTHASH HCRYPTPROV hcwhite hdc -HDR hdrop hdwwiz HEB @@ -916,17 +904,12 @@ HWNDPREV hyjiacan IBase IBeam -IBitmap -IBlock ICapture ICEBLUE IClass -IColor ICONERROR -IContext IData IDD -IDecoder IDesktop IDirect idl @@ -935,7 +918,6 @@ IDOn IDR idx IDXGI -IEncoder IEnum IExec IEXPLORE @@ -960,7 +942,6 @@ imageresizerinput imageresizersettings imagingdevices ime -IMetadata imeutil inetcpl Infobar @@ -998,8 +979,6 @@ Interlop INTRESOURCE INVALIDARG invalidoperatioexception -invalidkey -IPalette ipc ipcmanager IPlugin @@ -1008,8 +987,6 @@ IPREVIEW ipreviewhandlervisualssetfont IProperty IPublic -IQuery -IReader irprops isbi ISearch @@ -1017,9 +994,7 @@ ISettings isfinite IShell isocpp -ISource iss -ISurface ITask ith ITHUMBNAIL @@ -1130,8 +1105,6 @@ LOCALPACKAGE localport LOCALSYSTEM LOCATIONCHANGE -LOCKBYTES -LOCKTYPE LOGFONT LOGFONTW logon @@ -1153,12 +1126,12 @@ LPCWSTR lpdw lpfn LPINPUT -LPQUERY lpmi LPMINMAXINFO LPMONITORINFO LPOSVERSIONINFOEXW LPPOINT +LPQUERY lprc LPRECT LPSAFEARRAY @@ -1326,11 +1299,11 @@ Mul MULTIPLEUSE multizone mvvm +mwb +MWBEx myfile MYICON mysql -mwb -MWBEx NAMECHANGE nameof namespaceanddescendants @@ -1403,7 +1376,6 @@ NONCONVERT NONELEVATED NONINFRINGEMENT nonstd -NOOPEN NOOWNERZORDER NOPARENTNOTIFY NOREDIRECTIONBITMAP @@ -1466,8 +1438,6 @@ OLEDB OLIVEGREEN onebranch onenote -ONLYIFCURRENT -ONLYONCE onstd oobe OOBEPT @@ -1568,7 +1538,6 @@ pinvoke pipename PKBDLLHOOKSTRUCT pkey -PKEY plib PLK ploc @@ -1601,7 +1570,6 @@ ppidl ppmt pprm pproc -pprop ppshv ppsi ppsid @@ -1622,7 +1590,6 @@ previouscamera PREVIOUSINSTALLFOLDER PREVIOUSVERSIONSINSTALLED prevpane -PRGBA prgms pri PRINTCLIENT @@ -1639,9 +1606,7 @@ PROGRAMFILES projectname PROPBAG PROPERTYKEY -PROPERTYNOTFOUND propkey -PROPVARIANT propvarutil prvpane psapi @@ -1651,8 +1616,6 @@ psfgao Psr psrm psrree -pstatstg -pstm pstr pstream pstrm @@ -1666,7 +1629,6 @@ PToy ptstr pui PULONG -pvar pwa pwcs pwsh @@ -1706,6 +1668,7 @@ rclsid RCONTROL RCtrl READMODE +READOBJECTS READWRITE RECTDESTINATION RECTL @@ -1768,7 +1731,6 @@ resw resx retval rfc -RGBE RGBQUAD rgbs rgelt @@ -1811,7 +1773,6 @@ rungameid RUNLEVEL runsettings runtimeclass -runtimeconfig runtimedepsjsonpath runtimeobject runtimepack @@ -1827,7 +1788,6 @@ ryanbodrug saahmedm sachaple sacl -SAFEARRAY safeprojectname SAMEKEYPREVIOUSLYMAPPED SAMESHORTCUTPREVIOUSLYMAPPED @@ -1858,7 +1818,6 @@ sendvirtualinput Seperate Seraphima serverside -Ses SETCONTEXT setcursor setenv @@ -1947,7 +1906,6 @@ SMALLICON smartphone SMTO snd -sni snwprintf softline somil @@ -1975,7 +1933,6 @@ SRCPAINT sre SResize srf -SRGB srme srre srw @@ -2004,10 +1961,8 @@ STDMETHODCALLTYPE STDMETHODIMP stefan Stereolithography -STGC STGM STGMEDIUM -STGTY sticpl stl storelogo @@ -2081,8 +2036,8 @@ taskschd tchar tcl Tcollab -tcs tcp +tcs tcscpy TCustom tdbuild @@ -2165,6 +2120,7 @@ uipi UIs ULARGE ULONGLONG +unapply unassign uncompilable UNCPRIORITY @@ -2196,7 +2152,6 @@ Usb USEDEFAULT USEFILEATTRIBUTES USERDATA -USERDEFINED USERDOMAIN userprofile USESHOWWINDOW @@ -2213,7 +2168,6 @@ vabdq validmodulename Vanara variantassignment -VARTYPE vcamp vccorlib vcdl @@ -2233,7 +2187,6 @@ VERBSONLY VERBW VERIFYCONTEXT verrsrc -VERSIONED VERSIONINFO Versioning VFT @@ -2333,8 +2286,8 @@ winget wingetcreate Winhook winkey -winlogon WINL +winlogon winmd winmm WINNT @@ -2391,6 +2344,7 @@ wregex WReserved WResize writefile +WRITEOBJECTS Wrk wrl WSAEADDRINUSE @@ -2402,7 +2356,6 @@ wsh wsl wss wstr -wsystem wsz wtoi WTS @@ -2446,7 +2399,6 @@ yinyue YOffset YPels ypescript -YQuantized YResolution YStr YUY diff --git a/installer/PowerToysSetupCustomActions/CustomAction.cpp b/installer/PowerToysSetupCustomActions/CustomAction.cpp index c86eb40a00..deb79d756e 100644 --- a/installer/PowerToysSetupCustomActions/CustomAction.cpp +++ b/installer/PowerToysSetupCustomActions/CustomAction.cpp @@ -123,6 +123,8 @@ UINT __stdcall UnApplyModulesRegistryChangeSetsCA(MSIHANDLE hInstall) changeSet.unApply(); } + SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); + ExitOnFailure(hr, "Failed to extract msix"); LExit: diff --git a/installer/PowerToysSetupCustomActions/stdafx.h b/installer/PowerToysSetupCustomActions/stdafx.h index 2174541f00..ebfdd0c258 100644 --- a/installer/PowerToysSetupCustomActions/stdafx.h +++ b/installer/PowerToysSetupCustomActions/stdafx.h @@ -8,6 +8,7 @@ #include #include #include +#include // WiX Header Files: #include diff --git a/src/common/utils/modulesRegistry.h b/src/common/utils/modulesRegistry.h index 1f58ab55ca..72947fb4e4 100644 --- a/src/common/utils/modulesRegistry.h +++ b/src/common/utils/modulesRegistry.h @@ -192,6 +192,28 @@ inline registry::ChangeSet getStlThumbnailHandlerChangeSet(const std::wstring in NonLocalizable::ExtSTL); } +inline registry::ChangeSet getRegistryPreviewSetDefaultAppChangeSet(const std::wstring installationDir, const bool perUser) +{ + const HKEY scope = perUser ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; + + using vec_t = std::vector; + vec_t changes; + + std::wstring appName = L"Registry Preview"; + std::wstring fullAppName = L"PowerToys.RegistryPreview"; + std::wstring registryKeyPrefix = L"Software\\Classes\\"; + + std::wstring appPath = installationDir + L"\\modules\\RegistryPreview\\PowerToys.RegistryPreview.exe"; + std::wstring command = appPath + L" \"----ms-protocol:ms-encodedlaunch:App?ContractId=Windows.File&Verb=open&File=%1\""; + + changes.push_back({ scope, registryKeyPrefix + fullAppName + L"\\" + L"Application", L"ApplicationName", appName }); + changes.push_back({ scope, registryKeyPrefix + fullAppName + L"\\" + L"DefaultIcon", std::nullopt, appPath }); + changes.push_back({ scope, registryKeyPrefix + fullAppName + L"\\" + L"shell\\open\\command", std::nullopt, command }); + changes.push_back({ scope, registryKeyPrefix + L".reg\\OpenWithProgIDs", fullAppName, L"" }); + + return { changes }; +} + inline registry::ChangeSet getRegistryPreviewChangeSet(const std::wstring installationDir,const bool perUser) { const HKEY scope = perUser ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; @@ -235,5 +257,6 @@ inline std::vector getAllModulesChangeSets(const std::wstri getPdfThumbnailHandlerChangeSet(installationDir, PER_USER), getGcodeThumbnailHandlerChangeSet(installationDir, PER_USER), getStlThumbnailHandlerChangeSet(installationDir, PER_USER), - getRegistryPreviewChangeSet(installationDir, PER_USER) }; + getRegistryPreviewChangeSet(installationDir, PER_USER), + getRegistryPreviewSetDefaultAppChangeSet(installationDir, PER_USER) }; } diff --git a/src/modules/registrypreview/RegistryPreviewExt/dllmain.cpp b/src/modules/registrypreview/RegistryPreviewExt/dllmain.cpp index 4ddac84299..9c89f324bb 100644 --- a/src/modules/registrypreview/RegistryPreviewExt/dllmain.cpp +++ b/src/modules/registrypreview/RegistryPreviewExt/dllmain.cpp @@ -37,11 +37,19 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lp const static wchar_t* MODULE_NAME = L"RegistryPreview"; const static wchar_t* MODULE_DESC = L"A quick little utility to visualize and edit complex Windows Registry files."; +namespace +{ + const wchar_t JSON_KEY_PROPERTIES[] = L"properties"; + const wchar_t JSON_KEY_ENABLED[] = L"enabled"; + const wchar_t JSON_KEY_DEFAULT_APP[] = L"default_reg_app"; +} + class RegistryPreviewModule : public PowertoyModuleIface { private: bool m_enabled = false; + bool m_default_app = false; //Hotkey m_hotkey; HANDLE m_hProcess; @@ -87,23 +95,70 @@ private: TerminateProcess(m_hProcess, 1); } + void parse_default_app_settings(PowerToysSettings::PowerToyValues settings) + { + const std::wstring installationDir = get_module_folderpath(); + auto changeSet = getRegistryPreviewSetDefaultAppChangeSet(installationDir, true); + + auto settingsObject = settings.get_raw_json(); + if (settingsObject.GetView().Size()) + { + auto default_app = settingsObject.GetNamedObject(JSON_KEY_PROPERTIES).GetNamedBoolean(JSON_KEY_DEFAULT_APP); + + if (default_app != m_default_app) + { + m_default_app = default_app; + auto result = default_app ? changeSet.apply() : changeSet.unApply(); + + if (!result) + { + Logger::error(L"Failed to {} default app registry change set.", default_app ? L"apply" : L"unapply"); + } + + SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); + } + } + else + { + Logger::info("Registry Preview settings are empty"); + } + } + + // Load the settings file. + void init_settings() + { + try + { + // Load and parse the settings file for this PowerToy. + PowerToysSettings::PowerToyValues settings = + PowerToysSettings::PowerToyValues::load_from_settings_file(get_key()); + + auto enabled = settings.get_bool_value(JSON_KEY_ENABLED); + auto result = true; + const std::wstring installationDir = get_module_folderpath(); + auto enabledChangeSet = getRegistryPreviewChangeSet(installationDir, true); + + result = enabled ? enabledChangeSet.apply() : enabledChangeSet.unApply(); + if (!result) + { + Logger::error(L"Failed to {} enabled registry change set.", enabled ? L"apply" : L"unapply"); + } + + parse_default_app_settings(settings); + } + catch (std::exception&) + { + Logger::error("Invalid json when trying to load the Registry Preview settings json from file."); + } + } + public: RegistryPreviewModule() { LoggerHelpers::init_logger(GET_RESOURCE_STRING(IDS_REGISTRYPREVIEW_NAME), L"ModuleInterface", "RegistryPreview"); Logger::info("Registry Preview object is constructing"); - if (!m_enabled) - { - const std::wstring installationDir = get_module_folderpath(); - - auto regChanges = getRegistryPreviewChangeSet(installationDir, true); - - if (!regChanges.unApply()) - { - Logger::error(L"Unapplying registry changes failed"); - } - } + init_settings(); triggerEvent = CreateEvent(nullptr, false, false, CommonSharedConstants::REGISTRY_PREVIEW_TRIGGER_EVENT); triggerEventWaiter = EventWaiter(CommonSharedConstants::REGISTRY_PREVIEW_TRIGGER_EVENT, [this](int) { @@ -184,13 +239,13 @@ public: // Parse the input JSON string. PowerToysSettings::PowerToyValues values = PowerToysSettings::PowerToyValues::from_json_string(config, get_key()); - // If you don't need to do any custom processing of the settings, proceed - // to persists the values. + parse_default_app_settings(values); + values.save_to_settings_file(); } catch (std::exception&) { - // Improper JSON. + Logger::error(L"Invalid json when trying to parse Registry Preview settings json."); } } @@ -226,6 +281,8 @@ public: { Logger::error(L"Unapplying registry changes failed"); } + + SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); } m_enabled = false; diff --git a/src/modules/registrypreview/RegistryPreviewUI/App.xaml.cs b/src/modules/registrypreview/RegistryPreviewUI/App.xaml.cs index 749a5bfcbe..d66e8d0ded 100644 --- a/src/modules/registrypreview/RegistryPreviewUI/App.xaml.cs +++ b/src/modules/registrypreview/RegistryPreviewUI/App.xaml.cs @@ -6,6 +6,7 @@ using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using Microsoft.UI.Xaml; +using Microsoft.Windows.AppLifecycle; using Windows.ApplicationModel.Activation; using LaunchActivatedEventArgs = Windows.ApplicationModel.Activation.LaunchActivatedEventArgs; @@ -31,23 +32,47 @@ namespace RegistryPreview /// Details about the launch request and process. protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) { - // Grab the command line parameters directly from the Environment since this is expected to be run - // via Context Menu of a REG file. - string[] cmdArgs = Environment.GetCommandLineArgs(); - if (cmdArgs == null) + // Keeping commented out but this is invaluable for protocol activation testing. + // #if DEBUG + // System.Diagnostics.Debugger.Launch(); + // #endif + + // Open With... handler - gets activation arguments if they are available. + AppActivationArguments activatedArgs = AppInstance.GetCurrent().GetActivatedEventArgs(); + if (activatedArgs.Kind == ExtendedActivationKind.File) { // Covers the double click exe scenario and treated as no file loaded AppFilename = string.Empty; - } - else if (cmdArgs.Length == 2) - { - // GetCommandLineArgs() send in the called EXE as 0 and the selected filename as 1 - AppFilename = cmdArgs[1]; + if (activatedArgs.Data != null) + { + IFileActivatedEventArgs eventArgs = (IFileActivatedEventArgs)activatedArgs.Data; + if (eventArgs.Files.Count > 0) + { + AppFilename = eventArgs.Files[0].Path; + } + } } else { - // Anything else should be treated as no file loaded - AppFilename = string.Empty; + // Right click on a REG file and selected Preview + // Grab the command line parameters directly from the Environment since this is expected to be run + // via Context Menu of a REG file. + string[] cmdArgs = Environment.GetCommandLineArgs(); + if (cmdArgs == null) + { + // Covers the double click exe scenario and treated as no file loaded + AppFilename = string.Empty; + } + else if (cmdArgs.Length == 2) + { + // GetCommandLineArgs() send in the called EXE as 0 and the selected filename as 1 + AppFilename = cmdArgs[1]; + } + else + { + // Anything else should be treated as no file loaded + AppFilename = string.Empty; + } } // Start the application diff --git a/src/settings-ui/Settings.UI.Library/RegistryPreviewProperties.cs b/src/settings-ui/Settings.UI.Library/RegistryPreviewProperties.cs new file mode 100644 index 0000000000..7777b1ee75 --- /dev/null +++ b/src/settings-ui/Settings.UI.Library/RegistryPreviewProperties.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Text.Json.Serialization; + +namespace Microsoft.PowerToys.Settings.UI.Library +{ + public class RegistryPreviewProperties + { + public RegistryPreviewProperties() + { + DefaultRegApp = false; + } + + [JsonPropertyName("default_reg_app")] + public bool DefaultRegApp { get; set; } + } +} diff --git a/src/settings-ui/Settings.UI.Library/RegistryPreviewSettings.cs b/src/settings-ui/Settings.UI.Library/RegistryPreviewSettings.cs index 92718d2e91..d7dab39ef5 100644 --- a/src/settings-ui/Settings.UI.Library/RegistryPreviewSettings.cs +++ b/src/settings-ui/Settings.UI.Library/RegistryPreviewSettings.cs @@ -11,8 +11,12 @@ namespace Microsoft.PowerToys.Settings.UI.Library { public const string ModuleName = "RegistryPreview"; + [JsonPropertyName("properties")] + public RegistryPreviewProperties Properties { get; set; } + public RegistryPreviewSettings() { + Properties = new RegistryPreviewProperties(); Version = "1"; Name = ModuleName; } diff --git a/src/settings-ui/Settings.UI.Library/SndRegistryPreviewSettings.cs b/src/settings-ui/Settings.UI.Library/SndRegistryPreviewSettings.cs new file mode 100644 index 0000000000..42717d3586 --- /dev/null +++ b/src/settings-ui/Settings.UI.Library/SndRegistryPreviewSettings.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Microsoft.PowerToys.Settings.UI.Library +{ + public class SndRegistryPreviewSettings + { + [JsonPropertyName("RegistryPreview")] + public RegistryPreviewSettings RegistryPreview { get; set; } + + public SndRegistryPreviewSettings() + { + } + + public SndRegistryPreviewSettings(RegistryPreviewSettings settings) + { + RegistryPreview = settings; + } + + public string ToJsonString() + { + return JsonSerializer.Serialize(this); + } + } +} diff --git a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw index 497b0ec207..3478ac28b0 100644 --- a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw +++ b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw @@ -3502,6 +3502,13 @@ Activate by holding the key for the character you want to add an accent to, then Launch Registry Preview + + Default app + + + Make Registry Preview default app for opening .reg files + Registry Preview is app name. Do not localize. + Using this shortcut may prevent non-text paste actions (e.g. images, files) or built-in paste plain text actions in other applications from functioning. diff --git a/src/settings-ui/Settings.UI/ViewModels/RegistryPreviewViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/RegistryPreviewViewModel.cs index 64f92c6efd..1b82f0adf3 100644 --- a/src/settings-ui/Settings.UI/ViewModels/RegistryPreviewViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/RegistryPreviewViewModel.cs @@ -3,6 +3,8 @@ // See the LICENSE file in the project root for more information. using System; +using System.Globalization; +using System.Text.Json; using global::PowerToys.GPOWrapper; using Microsoft.PowerToys.Settings.UI.Library; using Microsoft.PowerToys.Settings.UI.Library.Helpers; @@ -17,7 +19,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels public ButtonClickCommand LaunchEventHandler => new ButtonClickCommand(Launch); - public RegistryPreviewViewModel(ISettingsRepository settingsRepository, Func ipcMSGCallBackFunc) + public RegistryPreviewViewModel(ISettingsRepository settingsRepository, ISettingsRepository registryPreviewSettingsRepository, Func ipcMSGCallBackFunc) { // To obtain the general settings configurations of PowerToys Settings. if (settingsRepository == null) @@ -27,6 +29,8 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels GeneralSettingsConfig = settingsRepository.SettingsConfig; + _settings = registryPreviewSettingsRepository.SettingsConfig; + InitializeEnabledValue(); // set the callback functions value to hangle outgoing IPC message. @@ -71,6 +75,21 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels } } + public bool IsRegistryPreviewDefaultRegApp + { + get => _settings.Properties.DefaultRegApp; + set + { + if (_settings.Properties.DefaultRegApp != value) + { + _settings.Properties.DefaultRegApp = value; + OnPropertyChanged(nameof(IsRegistryPreviewDefaultRegApp)); + + NotifySettingsChanged(); + } + } + } + public bool IsEnabledGpoConfigured { get => _enabledStateIsGPOConfigured; @@ -88,11 +107,23 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels private GpoRuleConfigured _enabledGpoRuleConfiguration; private bool _enabledStateIsGPOConfigured; private bool _isRegistryPreviewEnabled; + private RegistryPreviewSettings _settings; public void RefreshEnabledState() { InitializeEnabledValue(); OnPropertyChanged(nameof(IsRegistryPreviewEnabled)); } + + private void NotifySettingsChanged() + { + // Using InvariantCulture as this is an IPC message + SendConfigMSG( + string.Format( + CultureInfo.InvariantCulture, + "{{ \"powertoys\": {{ \"{0}\": {1} }} }}", + RegistryPreviewSettings.ModuleName, + JsonSerializer.Serialize(_settings))); + } } } diff --git a/src/settings-ui/Settings.UI/Views/RegistryPreviewPage.xaml b/src/settings-ui/Settings.UI/Views/RegistryPreviewPage.xaml index 25961d5781..990e36270c 100644 --- a/src/settings-ui/Settings.UI/Views/RegistryPreviewPage.xaml +++ b/src/settings-ui/Settings.UI/Views/RegistryPreviewPage.xaml @@ -11,11 +11,9 @@ AutomationProperties.LandmarkType="Main" mc:Ignorable="d"> - + - + + + + + - + - + diff --git a/src/settings-ui/Settings.UI/Views/RegistryPreviewPage.xaml.cs b/src/settings-ui/Settings.UI/Views/RegistryPreviewPage.xaml.cs index 8f511269ba..fe53515bc9 100644 --- a/src/settings-ui/Settings.UI/Views/RegistryPreviewPage.xaml.cs +++ b/src/settings-ui/Settings.UI/Views/RegistryPreviewPage.xaml.cs @@ -16,7 +16,10 @@ namespace Microsoft.PowerToys.Settings.UI.Views public RegistryPreviewPage() { var settingsUtils = new SettingsUtils(); - ViewModel = new RegistryPreviewViewModel(SettingsRepository.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage); + ViewModel = new RegistryPreviewViewModel( + SettingsRepository.GetInstance(settingsUtils), + SettingsRepository.GetInstance(settingsUtils), + ShellPage.SendDefaultIPCMessage); DataContext = ViewModel; InitializeComponent(); }