using System; using System.Windows; using System.Windows.Controls; namespace Ink_Canvas.Windows.SettingsViews { /// /// ShortcutsPanel.xaml 的交互逻辑 /// public partial class ShortcutsPanel : UserControl { public ShortcutsPanel() { InitializeComponent(); } public event EventHandler IsTopBarNeedShadowEffect; public event EventHandler 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()); } } /// /// 应用主题 /// public void ApplyTheme() { try { ThemeHelper.ApplyThemeToControl(this); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine($"ShortcutsPanel 应用主题时出错: {ex.Message}"); } } } }