mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
44 lines
1.4 KiB
C#
44 lines
1.4 KiB
C#
// 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 Microsoft.PowerToys.Settings.UI.Helpers;
|
|
using Microsoft.PowerToys.Settings.UI.Library;
|
|
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
|
using CommunityToolkit.WinUI.Controls;
|
|
using Microsoft.UI.Xaml;
|
|
using System.Windows.Controls;
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Views
|
|
{
|
|
public sealed partial class PowerDisplayPage : NavigablePage, IRefreshablePage
|
|
{
|
|
private PowerDisplayViewModel ViewModel { get; set; }
|
|
|
|
|
|
public PowerDisplayPage()
|
|
{
|
|
var settingsUtils = new SettingsUtils();
|
|
ViewModel = new PowerDisplayViewModel(
|
|
SettingsRepository<GeneralSettings>.GetInstance(settingsUtils),
|
|
SettingsRepository<PowerDisplaySettings>.GetInstance(settingsUtils),
|
|
ShellPage.SendDefaultIPCMessage);
|
|
DataContext = ViewModel;
|
|
InitializeComponent();
|
|
}
|
|
|
|
public void RefreshEnabledState()
|
|
{
|
|
ViewModel.RefreshEnabledState();
|
|
}
|
|
|
|
private void ResetButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (sender is Button button && button.Tag is MonitorInfo monitor)
|
|
{
|
|
ViewModel.ResetMonitorSettings(monitor);
|
|
}
|
|
}
|
|
}
|
|
}
|