Files
PowerToys/src/settings-ui/Settings.UI/ViewModels/DashboardListItem.cs
Shawn Yuan (from Dev Box) b3b99d6d11 move controls to lib
Signed-off-by: Shawn Yuan (from Dev Box) <shuaiyuan@microsoft.com>
2025-12-01 09:37:47 +08:00

60 lines
1.5 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.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using ManagedCommon;
using Microsoft.PowerToys.Settings.UI.Controls;
using Microsoft.UI;
using Windows.UI;
namespace Microsoft.PowerToys.Settings.UI.ViewModels
{
public partial class DashboardListItem : ModuleListItem
{
private bool _visible;
public string ToolTip { get; set; }
public new ModuleType Tag
{
get => (ModuleType)base.Tag!;
set => base.Tag = value;
}
public Action<DashboardListItem> EnabledChangedCallback { get; set; }
public override bool IsEnabled
{
get => base.IsEnabled;
set
{
if (base.IsEnabled != value)
{
base.IsEnabled = value;
EnabledChangedCallback?.Invoke(this);
}
}
}
public bool Visible
{
get => _visible;
set
{
if (_visible != value)
{
_visible = value;
OnPropertyChanged();
}
}
}
public ObservableCollection<DashboardModuleItem> DashboardModuleItems { get; set; } = new ObservableCollection<DashboardModuleItem>();
}
}