/ src / settings-ui / Settings.UI / SettingsXAML / Views / PeekPage.xaml.cs
PeekPage.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  using Microsoft.UI.Xaml.Controls;
 9  
10  namespace Microsoft.PowerToys.Settings.UI.Views
11  {
12      public sealed partial class PeekPage : NavigablePage, IRefreshablePage
13      {
14          private PeekViewModel ViewModel { get; set; }
15  
16          public PeekPage()
17          {
18              var settingsUtils = SettingsUtils.Default;
19              ViewModel = new PeekViewModel(
20                  settingsUtils,
21                  SettingsRepository<GeneralSettings>.GetInstance(settingsUtils),
22                  ShellPage.SendDefaultIPCMessage,
23                  DispatcherQueue);
24              DataContext = ViewModel;
25              InitializeComponent();
26              Loaded += (s, e) => ViewModel.OnPageLoaded();
27          }
28  
29          public void RefreshEnabledState()
30          {
31              ViewModel.RefreshEnabledState();
32          }
33      }
34  }