Add files

This commit is contained in:
qhy040404
2023-11-06 12:32:22 +08:00
parent 075d92f754
commit 0c7ce7a72f

View File

@@ -0,0 +1,21 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using CommunityToolkit.WinUI.Controls;
using Microsoft.UI.Xaml;
namespace Snap.Hutao.Control.Helper;
[SuppressMessage("", "SH001")]
[DependencyProperty("IsItemsEnabled", typeof(bool), true, nameof(OnIsItemsEnabledChanged), IsAttached = true, AttachedType = typeof(SettingsExpander))]
public sealed partial class SettingsExpanderHelper
{
private static void OnIsItemsEnabledChanged(DependencyObject dp, DependencyPropertyChangedEventArgs e)
{
SettingsExpander expander = (SettingsExpander)dp;
foreach (SettingsCard item in expander.Items.Cast<SettingsCard>())
{
item.IsEnabled = (bool)e.NewValue;
}
}
}