Files
PowerToys/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml.cs
Laszlo Nemeth 9620d265ae [Settings][Dashboard]Switch to settings page on module clicked (#29554)
* Settings Dashboard: Adding feature switch to settings page if module panel clicked.

* fixing xaml styling

* Refactoring, creating common methods GetModuleAccentColor and GetModulePageType

* Correct button style to be invisible. Add the same functionality to the disabled modules.

* fixing XAML styling
2023-11-09 14:43:28 +00:00

59 lines
1.8 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 System;
using System.Threading;
using System.Threading.Tasks;
using ManagedCommon;
using Microsoft.PowerToys.Settings.UI.Helpers;
using Microsoft.PowerToys.Settings.UI.Library;
using Microsoft.PowerToys.Settings.UI.OOBE.Views;
using Microsoft.PowerToys.Settings.UI.ViewModels;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Windows.Storage.Pickers;
namespace Microsoft.PowerToys.Settings.UI.Views
{
/// <summary>
/// Dashboard Settings Page.
/// </summary>
public sealed partial class DashboardPage : Page, IRefreshablePage
{
/// <summary>
/// Gets or sets view model.
/// </summary>
public DashboardViewModel ViewModel { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="DashboardPage"/> class.
/// Dashboard Settings page constructor.
/// </summary>
public DashboardPage()
{
InitializeComponent();
var settingsUtils = new SettingsUtils();
ViewModel = new DashboardViewModel(
SettingsRepository<GeneralSettings>.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage);
DataContext = ViewModel;
}
public void RefreshEnabledState()
{
ViewModel.ModuleEnabledChangedOnSettingsPage();
}
private void SWVersionButtonClicked(object sender, RoutedEventArgs e)
{
ViewModel.SWVersionButtonClicked();
}
private void DashboardListItemClick(object sender, RoutedEventArgs e)
{
ViewModel.DashboardListItemClick(sender);
}
}
}