/ src / settings-ui / Settings.UI / SettingsXAML / Views / RegistryPreviewPage.xaml.cs
RegistryPreviewPage.xaml.cs
 1  // Copyright (c) Microsoft Corporation
 2  // The Microsoft Corporation licenses this file to you under the MIT license.
 3  // See the LICENSE file in the project root for more information.
 4  
 5  using Microsoft.PowerToys.Settings.UI.Helpers;
 6  using Microsoft.PowerToys.Settings.UI.Library;
 7  using Microsoft.PowerToys.Settings.UI.ViewModels;
 8  
 9  namespace Microsoft.PowerToys.Settings.UI.Views
10  {
11      public sealed partial class RegistryPreviewPage : NavigablePage, IRefreshablePage
12      {
13          private RegistryPreviewViewModel ViewModel { get; set; }
14  
15          public RegistryPreviewPage()
16          {
17              var settingsUtils = SettingsUtils.Default;
18              ViewModel = new RegistryPreviewViewModel(
19                  SettingsRepository<GeneralSettings>.GetInstance(settingsUtils),
20                  SettingsRepository<RegistryPreviewSettings>.GetInstance(settingsUtils),
21                  ShellPage.SendDefaultIPCMessage);
22              DataContext = ViewModel;
23              InitializeComponent();
24          }
25  
26          public void RefreshEnabledState()
27          {
28              ViewModel.RefreshEnabledState();
29          }
30      }
31  }