Files
community/Ink Canvas/Windows/SettingsViews/SettingsViews/ShortcutsPanel.xaml.cs
T

50 lines
1.3 KiB
C#
Raw Normal View History

2026-01-10 17:31:55 +08:00
using System;
2025-12-28 08:48:09 +08:00
using System.Windows;
using System.Windows.Controls;
namespace Ink_Canvas.Windows.SettingsViews
{
2026-01-10 17:31:55 +08:00
/// <summary>
/// ShortcutsPanel.xaml 的交互逻辑
/// </summary>
2025-12-28 08:48:09 +08:00
public partial class ShortcutsPanel : UserControl
{
public ShortcutsPanel()
{
InitializeComponent();
}
public event EventHandler<RoutedEventArgs> IsTopBarNeedShadowEffect;
public event EventHandler<RoutedEventArgs> IsTopBarNeedNoShadowEffect;
private void ScrollViewerEx_ScrollChanged(object sender, ScrollChangedEventArgs e)
{
var scrollViewer = (ScrollViewer)sender;
if (scrollViewer.VerticalOffset >= 10)
{
IsTopBarNeedShadowEffect?.Invoke(this, new RoutedEventArgs());
}
else
{
IsTopBarNeedNoShadowEffect?.Invoke(this, new RoutedEventArgs());
}
}
2026-01-10 17:31:55 +08:00
/// <summary>
/// 应用主题
/// </summary>
2026-01-02 01:35:22 +08:00
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
}
catch (Exception ex)
{
2026-01-10 17:31:55 +08:00
System.Diagnostics.Debug.WriteLine($"ShortcutsPanel 应用主题时出错: {ex.Message}");
2026-01-02 01:35:22 +08:00
}
}
2025-12-28 08:48:09 +08:00
}
}