MeasureToolPage.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 MeasureToolPage : NavigablePage, IRefreshablePage 13 { 14 private MeasureToolViewModel ViewModel { get; set; } 15 16 private const string ModuleName = "Measure Tool"; 17 18 public MeasureToolPage() 19 { 20 var settingsUtils = SettingsUtils.Default; 21 ViewModel = new MeasureToolViewModel( 22 settingsUtils, 23 SettingsRepository<GeneralSettings>.GetInstance(settingsUtils), 24 SettingsRepository<MeasureToolSettings>.GetInstance(settingsUtils), 25 ShellPage.SendDefaultIPCMessage); 26 27 DataContext = ViewModel; 28 InitializeComponent(); 29 30 Loaded += (s, e) => ViewModel.OnPageLoaded(); 31 } 32 33 public void RefreshEnabledState() 34 { 35 ViewModel.RefreshEnabledState(); 36 } 37 } 38 }