mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-25 04:34:13 +01:00
### Updated `KeyVisual` and `Shortcut` control - Refactoring `KeyVisual` to remove redundant properties and UI elements, and using Styles for better customization. - Shortcut control now shows a "Configure shortcut" label when there's no shortcut configured. ### Other changes - Consolidated converters that were used across pages in `App.xaml.cs` with consistent naming. - Renamed templated controls (from `.cs` to `.xaml.cs`) and moving those to the `Controls` root folder vs. individual folders for a better overview. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist Closes #39520 Closes #32944 --------- Co-authored-by: Jay <65828559+Jay-o-Way@users.noreply.github.com> Co-authored-by: Jaylyn Barbee <51131738+Jaylyn-Barbee@users.noreply.github.com>
63 lines
1.9 KiB
C#
63 lines
1.9 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.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Library;
|
|
using Microsoft.UI.Xaml;
|
|
using Windows.UI;
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
|
{
|
|
#pragma warning disable SA1402 // File may only contain a single type
|
|
#pragma warning disable SA1649 // File name should match first type name
|
|
public partial class DashboardModuleTextItem : DashboardModuleItem
|
|
{
|
|
}
|
|
|
|
public partial class DashboardModuleButtonItem : DashboardModuleItem
|
|
{
|
|
public string ButtonTitle { get; set; }
|
|
|
|
public bool IsButtonDescriptionVisible { get; set; }
|
|
|
|
public string ButtonDescription { get; set; }
|
|
|
|
public string ButtonGlyph { get; set; }
|
|
|
|
public RoutedEventHandler ButtonClickHandler { get; set; }
|
|
}
|
|
|
|
public partial class DashboardModuleShortcutItem : DashboardModuleItem
|
|
{
|
|
public List<object> Shortcut { get; set; }
|
|
}
|
|
|
|
public partial class DashboardModuleActivationItem : DashboardModuleItem
|
|
{
|
|
public string Activation { get; set; }
|
|
}
|
|
|
|
public partial class DashboardModuleItem : INotifyPropertyChanged
|
|
{
|
|
public string Label { get; set; }
|
|
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
internal void NotifyPropertyChanged(string propertyName)
|
|
{
|
|
OnPropertyChanged(propertyName);
|
|
}
|
|
|
|
private void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
|
{
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
}
|
|
}
|
|
#pragma warning restore SA1402 // File may only contain a single type
|
|
#pragma warning restore SA1649 // File name should match first type name
|