From df5daeeb75471baeb3c0f49b216c0698ed76d340 Mon Sep 17 00:00:00 2001
From: CJKmkp <2564608840@qq.com>
Date: Sun, 28 Dec 2025 08:48:09 +0800
Subject: [PATCH] =?UTF-8?q?add:=E6=96=B0=E8=AE=BE=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Ink Canvas/MainWindow_cs/MW_TouchEvents.cs | 63 +++++++++++++-
.../SettingsViews/AdvancedPanel.xaml | 15 ++++
.../SettingsViews/AdvancedPanel.xaml.cs | 34 ++++++++
.../SettingsViews/AutomationPanel.xaml | 15 ++++
.../SettingsViews/AutomationPanel.xaml.cs | 34 ++++++++
.../SettingsViews/CanvasAndInkPanel.xaml | 15 ++++
.../SettingsViews/CanvasAndInkPanel.xaml.cs | 38 ++++++++
.../SettingsViews/CrashActionPanel.xaml | 15 ++++
.../SettingsViews/CrashActionPanel.xaml.cs | 34 ++++++++
.../SettingsViews/GesturesPanel.xaml | 15 ++++
.../SettingsViews/GesturesPanel.xaml.cs | 34 ++++++++
.../SettingsViews/InkRecognitionPanel.xaml | 15 ++++
.../SettingsViews/InkRecognitionPanel.xaml.cs | 34 ++++++++
.../SettingsViews/LuckyRandomPanel.xaml | 15 ++++
.../SettingsViews/LuckyRandomPanel.xaml.cs | 34 ++++++++
.../SettingsViews/PowerPointPanel.xaml | 15 ++++
.../SettingsViews/PowerPointPanel.xaml.cs | 34 ++++++++
.../SettingsViews/ShortcutsPanel.xaml | 15 ++++
.../SettingsViews/ShortcutsPanel.xaml.cs | 34 ++++++++
.../SettingsViews/SnapshotPanel.xaml | 15 ++++
.../SettingsViews/SnapshotPanel.xaml.cs | 34 ++++++++
.../SettingsViews/StartupPanel.xaml | 15 ++++
.../SettingsViews/StartupPanel.xaml.cs | 34 ++++++++
.../SettingsViews/StoragePanel.xaml | 15 ++++
.../SettingsViews/StoragePanel.xaml.cs | 34 ++++++++
.../SettingsViews/ThemePanel.xaml | 15 ++++
.../SettingsViews/ThemePanel.xaml.cs | 34 ++++++++
.../Windows/SettingsViews/SettingsWindow.xaml | 87 +++----------------
.../SettingsViews/SettingsWindow.xaml.cs | 67 ++++++++------
29 files changed, 757 insertions(+), 101 deletions(-)
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/AdvancedPanel.xaml
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/AdvancedPanel.xaml.cs
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/AutomationPanel.xaml
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/AutomationPanel.xaml.cs
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/CanvasAndInkPanel.xaml
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/CanvasAndInkPanel.xaml.cs
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/CrashActionPanel.xaml
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/CrashActionPanel.xaml.cs
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/GesturesPanel.xaml
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/GesturesPanel.xaml.cs
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/InkRecognitionPanel.xaml
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/InkRecognitionPanel.xaml.cs
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/LuckyRandomPanel.xaml
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/LuckyRandomPanel.xaml.cs
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/PowerPointPanel.xaml
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/PowerPointPanel.xaml.cs
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/ShortcutsPanel.xaml
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/ShortcutsPanel.xaml.cs
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/SnapshotPanel.xaml
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/SnapshotPanel.xaml.cs
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/StartupPanel.xaml
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/StartupPanel.xaml.cs
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/StoragePanel.xaml
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/StoragePanel.xaml.cs
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/ThemePanel.xaml
create mode 100644 Ink Canvas/Windows/SettingsViews/SettingsViews/ThemePanel.xaml.cs
diff --git a/Ink Canvas/MainWindow_cs/MW_TouchEvents.cs b/Ink Canvas/MainWindow_cs/MW_TouchEvents.cs
index b9e4b278..51f27c3d 100644
--- a/Ink Canvas/MainWindow_cs/MW_TouchEvents.cs
+++ b/Ink Canvas/MainWindow_cs/MW_TouchEvents.cs
@@ -5,6 +5,7 @@ using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
+using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
@@ -223,8 +224,29 @@ namespace Ink_Canvas
}
if (inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint
- || inkCanvas.EditingMode == InkCanvasEditingMode.EraseByStroke
- || inkCanvas.EditingMode == InkCanvasEditingMode.Select) return;
+ || inkCanvas.EditingMode == InkCanvasEditingMode.EraseByStroke) return;
+
+ // 处理选择模式下的触摸事件:检查是否有选中的墨迹,如果有,检查触摸点是否在选中区域外
+ if (inkCanvas.EditingMode == InkCanvasEditingMode.Select)
+ {
+ if (inkCanvas.GetSelectedStrokes().Count > 0)
+ {
+ var touchPosition = e.GetTouchPoint(inkCanvas).Position;
+ var selectionBounds = inkCanvas.GetSelectionBounds();
+
+ // 检查触摸位置是否在选择框边界外
+ if (touchPosition.X < selectionBounds.Left ||
+ touchPosition.X > selectionBounds.Right ||
+ touchPosition.Y < selectionBounds.Top ||
+ touchPosition.Y > selectionBounds.Bottom)
+ {
+ // 触摸在选择框外,取消选择
+ inkCanvas.Select(new StrokeCollection());
+ GridInkCanvasSelectionCover.Visibility = Visibility.Collapsed;
+ }
+ }
+ return;
+ }
if (!isHidingSubPanelsWhenInking)
{
@@ -541,6 +563,25 @@ namespace Ink_Canvas
if (inkCanvas.EditingMode == InkCanvasEditingMode.Select)
{
dec.Add(e.TouchDevice.Id);
+
+ // 检查是否有选中的墨迹,如果有,检查触摸点是否在选中区域外
+ if (dec.Count == 1 && inkCanvas.GetSelectedStrokes().Count > 0)
+ {
+ var touchPosition = e.GetTouchPoint(inkCanvas).Position;
+ var selectionBounds = inkCanvas.GetSelectionBounds();
+
+ // 检查触摸位置是否在选择框边界外
+ if (touchPosition.X < selectionBounds.Left ||
+ touchPosition.X > selectionBounds.Right ||
+ touchPosition.Y < selectionBounds.Top ||
+ touchPosition.Y > selectionBounds.Bottom)
+ {
+ // 触摸在选择框外,取消选择
+ inkCanvas.Select(new StrokeCollection());
+ GridInkCanvasSelectionCover.Visibility = Visibility.Collapsed;
+ }
+ }
+
return;
}
if (inkCanvas.EditingMode == InkCanvasEditingMode.Ink)
@@ -581,6 +622,24 @@ namespace Ink_Canvas
var touchPoint = e.GetTouchPoint(inkCanvas);
centerPoint = touchPoint.Position;
+ // 检查是否有选中的墨迹,如果有,检查触摸点是否在选中区域外
+ if (inkCanvas.GetSelectedStrokes().Count > 0)
+ {
+ var touchPosition = touchPoint.Position;
+ var selectionBounds = inkCanvas.GetSelectionBounds();
+
+ // 检查触摸位置是否在选择框边界外
+ if (touchPosition.X < selectionBounds.Left ||
+ touchPosition.X > selectionBounds.Right ||
+ touchPosition.Y < selectionBounds.Top ||
+ touchPosition.Y > selectionBounds.Bottom)
+ {
+ // 触摸在选择框外,取消选择
+ inkCanvas.Select(new StrokeCollection());
+ GridInkCanvasSelectionCover.Visibility = Visibility.Collapsed;
+ }
+ }
+
//记录第一根手指点击时的 StrokeCollection
lastTouchDownStrokeCollection = inkCanvas.Strokes.Clone();
}
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/AdvancedPanel.xaml b/Ink Canvas/Windows/SettingsViews/SettingsViews/AdvancedPanel.xaml
new file mode 100644
index 00000000..618d3bae
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/AdvancedPanel.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/AdvancedPanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/AdvancedPanel.xaml.cs
new file mode 100644
index 00000000..1269c359
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/AdvancedPanel.xaml.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Ink_Canvas.Windows.SettingsViews
+{
+ ///
+ /// AdvancedPanel.xaml 的交互逻辑
+ ///
+ public partial class AdvancedPanel : UserControl
+ {
+ public AdvancedPanel()
+ {
+ 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());
+ }
+ }
+ }
+}
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/AutomationPanel.xaml b/Ink Canvas/Windows/SettingsViews/SettingsViews/AutomationPanel.xaml
new file mode 100644
index 00000000..10554da6
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/AutomationPanel.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/AutomationPanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/AutomationPanel.xaml.cs
new file mode 100644
index 00000000..fc0258e7
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/AutomationPanel.xaml.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Ink_Canvas.Windows.SettingsViews
+{
+ ///
+ /// AutomationPanel.xaml 的交互逻辑
+ ///
+ public partial class AutomationPanel : UserControl
+ {
+ public AutomationPanel()
+ {
+ 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());
+ }
+ }
+ }
+}
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/CanvasAndInkPanel.xaml b/Ink Canvas/Windows/SettingsViews/SettingsViews/CanvasAndInkPanel.xaml
new file mode 100644
index 00000000..85146e02
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/CanvasAndInkPanel.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/CanvasAndInkPanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/CanvasAndInkPanel.xaml.cs
new file mode 100644
index 00000000..ee6180c8
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/CanvasAndInkPanel.xaml.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Input;
+using System.Windows.Media;
+using iNKORE.UI.WPF.Helpers;
+
+namespace Ink_Canvas.Windows.SettingsViews
+{
+ ///
+ /// CanvasAndInkPanel.xaml 的交互逻辑
+ ///
+ public partial class CanvasAndInkPanel : UserControl
+ {
+ public CanvasAndInkPanel()
+ {
+ 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());
+ }
+ }
+ }
+}
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/CrashActionPanel.xaml b/Ink Canvas/Windows/SettingsViews/SettingsViews/CrashActionPanel.xaml
new file mode 100644
index 00000000..47dc5cbd
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/CrashActionPanel.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/CrashActionPanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/CrashActionPanel.xaml.cs
new file mode 100644
index 00000000..e7a52197
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/CrashActionPanel.xaml.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Ink_Canvas.Windows.SettingsViews
+{
+ ///
+ /// CrashActionPanel.xaml 的交互逻辑
+ ///
+ public partial class CrashActionPanel : UserControl
+ {
+ public CrashActionPanel()
+ {
+ 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());
+ }
+ }
+ }
+}
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/GesturesPanel.xaml b/Ink Canvas/Windows/SettingsViews/SettingsViews/GesturesPanel.xaml
new file mode 100644
index 00000000..efeee952
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/GesturesPanel.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/GesturesPanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/GesturesPanel.xaml.cs
new file mode 100644
index 00000000..d90fc785
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/GesturesPanel.xaml.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Ink_Canvas.Windows.SettingsViews
+{
+ ///
+ /// GesturesPanel.xaml 的交互逻辑
+ ///
+ public partial class GesturesPanel : UserControl
+ {
+ public GesturesPanel()
+ {
+ 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());
+ }
+ }
+ }
+}
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/InkRecognitionPanel.xaml b/Ink Canvas/Windows/SettingsViews/SettingsViews/InkRecognitionPanel.xaml
new file mode 100644
index 00000000..7e905fd4
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/InkRecognitionPanel.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/InkRecognitionPanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/InkRecognitionPanel.xaml.cs
new file mode 100644
index 00000000..ade1a9b5
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/InkRecognitionPanel.xaml.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Ink_Canvas.Windows.SettingsViews
+{
+ ///
+ /// InkRecognitionPanel.xaml 的交互逻辑
+ ///
+ public partial class InkRecognitionPanel : UserControl
+ {
+ public InkRecognitionPanel()
+ {
+ 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());
+ }
+ }
+ }
+}
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/LuckyRandomPanel.xaml b/Ink Canvas/Windows/SettingsViews/SettingsViews/LuckyRandomPanel.xaml
new file mode 100644
index 00000000..cdeea367
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/LuckyRandomPanel.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/LuckyRandomPanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/LuckyRandomPanel.xaml.cs
new file mode 100644
index 00000000..eca7d4c4
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/LuckyRandomPanel.xaml.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Ink_Canvas.Windows.SettingsViews
+{
+ ///
+ /// LuckyRandomPanel.xaml 的交互逻辑
+ ///
+ public partial class LuckyRandomPanel : UserControl
+ {
+ public LuckyRandomPanel()
+ {
+ 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());
+ }
+ }
+ }
+}
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/PowerPointPanel.xaml b/Ink Canvas/Windows/SettingsViews/SettingsViews/PowerPointPanel.xaml
new file mode 100644
index 00000000..ed90fe8b
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/PowerPointPanel.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/PowerPointPanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/PowerPointPanel.xaml.cs
new file mode 100644
index 00000000..0deccedd
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/PowerPointPanel.xaml.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Ink_Canvas.Windows.SettingsViews
+{
+ ///
+ /// PowerPointPanel.xaml 的交互逻辑
+ ///
+ public partial class PowerPointPanel : UserControl
+ {
+ public PowerPointPanel()
+ {
+ 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());
+ }
+ }
+ }
+}
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/ShortcutsPanel.xaml b/Ink Canvas/Windows/SettingsViews/SettingsViews/ShortcutsPanel.xaml
new file mode 100644
index 00000000..a61b7aaf
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/ShortcutsPanel.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/ShortcutsPanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/ShortcutsPanel.xaml.cs
new file mode 100644
index 00000000..6bb98663
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/ShortcutsPanel.xaml.cs
@@ -0,0 +1,34 @@
+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());
+ }
+ }
+ }
+}
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/SnapshotPanel.xaml b/Ink Canvas/Windows/SettingsViews/SettingsViews/SnapshotPanel.xaml
new file mode 100644
index 00000000..a0137dd9
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/SnapshotPanel.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/SnapshotPanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/SnapshotPanel.xaml.cs
new file mode 100644
index 00000000..bdf9eb91
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/SnapshotPanel.xaml.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Ink_Canvas.Windows.SettingsViews
+{
+ ///
+ /// SnapshotPanel.xaml 的交互逻辑
+ ///
+ public partial class SnapshotPanel : UserControl
+ {
+ public SnapshotPanel()
+ {
+ 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());
+ }
+ }
+ }
+}
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/StartupPanel.xaml b/Ink Canvas/Windows/SettingsViews/SettingsViews/StartupPanel.xaml
new file mode 100644
index 00000000..b30f1c31
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/StartupPanel.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/StartupPanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/StartupPanel.xaml.cs
new file mode 100644
index 00000000..af4f03f6
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/StartupPanel.xaml.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Ink_Canvas.Windows.SettingsViews
+{
+ ///
+ /// StartupPanel.xaml 的交互逻辑
+ ///
+ public partial class StartupPanel : UserControl
+ {
+ public StartupPanel()
+ {
+ 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());
+ }
+ }
+ }
+}
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/StoragePanel.xaml b/Ink Canvas/Windows/SettingsViews/SettingsViews/StoragePanel.xaml
new file mode 100644
index 00000000..8cea62de
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/StoragePanel.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/StoragePanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/StoragePanel.xaml.cs
new file mode 100644
index 00000000..f2fb47d8
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/StoragePanel.xaml.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Ink_Canvas.Windows.SettingsViews
+{
+ ///
+ /// StoragePanel.xaml 的交互逻辑
+ ///
+ public partial class StoragePanel : UserControl
+ {
+ public StoragePanel()
+ {
+ 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());
+ }
+ }
+ }
+}
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/ThemePanel.xaml b/Ink Canvas/Windows/SettingsViews/SettingsViews/ThemePanel.xaml
new file mode 100644
index 00000000..86d3a563
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/ThemePanel.xaml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsViews/ThemePanel.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsViews/ThemePanel.xaml.cs
new file mode 100644
index 00000000..6fdb7358
--- /dev/null
+++ b/Ink Canvas/Windows/SettingsViews/SettingsViews/ThemePanel.xaml.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace Ink_Canvas.Windows.SettingsViews
+{
+ ///
+ /// ThemePanel.xaml 的交互逻辑
+ ///
+ public partial class ThemePanel : UserControl
+ {
+ public ThemePanel()
+ {
+ 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());
+ }
+ }
+ }
+}
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml
index c1081d78..08a33133 100644
--- a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml
+++ b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml
@@ -560,125 +560,66 @@
-
-
-
-
-
+
-
-
-
-
-
+
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
-
-
-
-
-
+
-
-
-
-
-
+
-
-
-
-
-
+
-
-
-
-
-
+
-
-
-
-
-
+
-
-
-
-
-
+
-
-
-
-
-
+
-
-
-
-
-
+
-
-
-
-
-
+
-
-
-
-
-
+
diff --git a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs
index 583f1021..b6a99a59 100644
--- a/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs
+++ b/Ink Canvas/Windows/SettingsViews/SettingsWindow.xaml.cs
@@ -169,19 +169,19 @@ namespace Ink_Canvas.Windows
SettingsPaneScrollViewers = new ScrollViewer[] {
SettingsAboutPanel.AboutScrollViewerEx,
- CanvasAndInkScrollViewerEx,
- GesturesScrollViewerEx,
- StartupScrollViewerEx,
- ThemeScrollViewerEx,
- ShortcutsScrollViewerEx,
- CrashActionScrollViewerEx,
- InkRecognitionScrollViewerEx,
- AutomationScrollViewerEx,
- PowerPointScrollViewerEx,
- LuckyRandomScrollViewerEx,
- StorageScrollViewerEx,
- SnapshotScrollViewerEx,
- AdvancedScrollViewerEx
+ CanvasAndInkPanel.ScrollViewerEx,
+ GesturesPanel.ScrollViewerEx,
+ StartupPanel.ScrollViewerEx,
+ ThemePanel.ScrollViewerEx,
+ ShortcutsPanel.ScrollViewerEx,
+ CrashActionPanel.ScrollViewerEx,
+ InkRecognitionPanel.ScrollViewerEx,
+ AutomationPanel.ScrollViewerEx,
+ PowerPointPanel.ScrollViewerEx,
+ LuckyRandomPanel.ScrollViewerEx,
+ StoragePanel.ScrollViewerEx,
+ SnapshotPanel.ScrollViewerEx,
+ AdvancedPanel.ScrollViewerEx
};
SettingsPaneTitles = new string[] {
@@ -221,6 +221,34 @@ namespace Ink_Canvas.Windows
SettingsAboutPanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
SettingsAboutPanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
+ // 订阅所有UserControl的滚动事件
+ CanvasAndInkPanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
+ CanvasAndInkPanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
+ GesturesPanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
+ GesturesPanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
+ StartupPanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
+ StartupPanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
+ InkRecognitionPanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
+ InkRecognitionPanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
+ AutomationPanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
+ AutomationPanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
+ PowerPointPanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
+ PowerPointPanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
+ ThemePanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
+ ThemePanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
+ ShortcutsPanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
+ ShortcutsPanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
+ CrashActionPanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
+ CrashActionPanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
+ LuckyRandomPanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
+ LuckyRandomPanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
+ StoragePanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
+ StoragePanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
+ SnapshotPanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
+ SnapshotPanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
+ AdvancedPanel.IsTopBarNeedShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0.25;
+ AdvancedPanel.IsTopBarNeedNoShadowEffect += (o, s) => DropShadowEffectTopBar.Opacity = 0;
+
_selectedSidebarItemName = "CanvasAndInkItem";
UpdateSidebarItemsSelection();
@@ -306,19 +334,6 @@ namespace Ink_Canvas.Windows
}
}
- private void ScrollViewerEx_ScrollChanged(object sender, ScrollChangedEventArgs e)
- {
- var scrollViewer = (ScrollViewer)sender;
- if (scrollViewer.VerticalOffset >= 10)
- {
- DropShadowEffectTopBar.Opacity = 0.25;
- }
- else
- {
- DropShadowEffectTopBar.Opacity = 0;
- }
- }
-
private void ScrollBar_Scroll(object sender, RoutedEventArgs e)
{
var scrollbar = (ScrollBar)sender;