remove:旧的新设置

This commit is contained in:
PrefacedCorg
2026-04-05 17:58:57 +08:00
parent 77dd83c2d6
commit fa38d3d664
51 changed files with 30 additions and 16857 deletions
+4 -7
View File
@@ -643,17 +643,14 @@
</ikw:SimpleStackPanel>
</GroupBox>
<GroupBox Name="GroupBoxNewSettings">
<GroupBox Name="GroupBoxSettings">
<GroupBox.Header>
<TextBlock Margin="0,12,0,0" Text="{i18n:I18n Key=Settings_NewWindow}" FontWeight="Bold" Foreground="#fafafa"
<TextBlock Margin="0,12,0,0" Text="设置" FontWeight="Bold" Foreground="#fafafa"
FontSize="26" />
</GroupBox.Header>
<ikw:SimpleStackPanel Spacing="6" Margin="0,10,0,0">
<TextBlock TextWrapping="Wrap" Margin="0,0,0,10" Foreground="#fafafa" Text="{i18n:I18n Key=Settings_NewWindowDesc}"/>
<Button x:Name="BtnOpenNewSettings" Content="{i18n:I18n Key=Btn_OpenNewSettings}"
HorizontalAlignment="Left" Click="BtnOpenNewSettings_Click"
Padding="15,5" Margin="0,10,0,0"/>
<Button x:Name="BtnOpenNewNewSettings" Content="打开新新设置"
<TextBlock TextWrapping="Wrap" Margin="0,0,0,10" Foreground="#fafafa" Text="打开设置窗口"/>
<Button x:Name="BtnOpenSettings" Content="打开设置"
HorizontalAlignment="Left" Click="BtnOpenNewNewSettings_Click"
Padding="15,5" Margin="0,10,0,0"/>
</ikw:SimpleStackPanel>
-33
View File
@@ -2812,39 +2812,6 @@ namespace Ink_Canvas
#endregion Navigation Sidebar Methods
#region
/// <summary>
/// 在隐藏子面板后打开新的设置窗口;若需要则先提示并验证安全密码,并在正在打开或隐藏设置面板时不执行任何操作。
/// </summary>
/// <remarks>
/// 在验证密码失败或发生异常时会中止操作。成功通过验证后以模式窗口方式显示设置窗口并将当前窗口设为其所有者。
/// </remarks>
private async void BtnOpenNewSettings_Click(object sender, RoutedEventArgs e)
{
if (isOpeningOrHidingSettingsPane) return;
HideSubPanels();
{
try
{
if (SecurityManager.IsPasswordRequiredForEnterSettings(Settings))
{
bool ok = await SecurityManager.PromptAndVerifyAsync(Settings, this, "进入设置", "请输入安全密码以进入设置。");
if (!ok) return;
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"安全密码校验失败: {ex}", LogHelper.LogType.Error);
return;
}
var settingsWindow = new SettingsWindow();
settingsWindow.Owner = this;
settingsWindow.ShowDialog();
}
}
private async void BtnOpenNewNewSettings_Click(object sender, RoutedEventArgs e)
{
if (isOpeningOrHidingSettingsPane) return;
@@ -1,191 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.AboutPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<UserControl.Resources>
<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="IsTabStop" Value="false"/>
<EventSetter Event="PreviewMouseDown" Handler="ScrollbarThumb_MouseDown"/>
<EventSetter Event="PreviewMouseUp" Handler="ScrollbarThumb_MouseUp"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border Name="ScrollbarThumbEx"
SnapsToDevicePixels="True"
Background="#c3c3c3"
Opacity="0.5"
CornerRadius="1.5"
Height="{TemplateBinding Height}"
Width="3" HorizontalAlignment="Center"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type ScrollBar}">
<EventSetter Event="Scroll" Handler="ScrollBar_Scroll"/>
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
<Setter Property="Width" Value="8"/>
<Setter Property="Margin" Value="-6 3 0 0" />
<Setter Property="MinWidth" Value="{Binding Height, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollBar}">
<Grid x:Name="ScrollbarGrid" SnapsToDevicePixels="true">
<Border Width="3" CornerRadius="1.5" Background="#e0e0e0" Opacity="0" IsHitTestVisible="False" Margin="0 4 -2 4" x:Name="ScrollBarBorderTrackBackground"/>
<Border Padding="0 4" Background="Transparent" MouseEnter="ScrollBarTrack_MouseEnter"
MouseLeave="ScrollBarTrack_MouseLeave">
<Track x:Name="PART_Track"
IsDirectionReversed="true"
IsEnabled="True"
Width="6"
Margin="0,0,0,0"
HorizontalAlignment="Right">
<Track.DecreaseRepeatButton>
<RepeatButton Opacity="0" Command="{x:Static ScrollBar.PageUpCommand}" />
</Track.DecreaseRepeatButton>
<Track.IncreaseRepeatButton>
<RepeatButton Opacity="0" Command="{x:Static ScrollBar.PageDownCommand}" />
</Track.IncreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource ScrollBarThumb }" />
</Track.Thumb>
</Track>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="AboutScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="0,12,0,24" HorizontalAlignment="Center" Width="524">
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<Image Name="CopyrightBannerImage"/>
</Border>
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#9a9996" FontSize="12" Margin="0,0,0,3" Text="设备ID" HorizontalAlignment="Left"/>
<TextBlock Name="AboutDeviceID" Foreground="#2e3436" FontSize="14.5" Text="正在获取..." HorizontalAlignment="Left"/>
</StackPanel>
</Grid>
</StackPanel>
</Border>
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<Grid Height="54">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="软件版本" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="18,0,0,0"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,18,0">
<TextBlock Name="AboutAppVersion" Foreground="#878787" FontSize="14.5" Text="InkCanvasForClass v1.7.18.4" VerticalAlignment="Center" />
<Image Name="UpdateAvailableIcon" Margin="12,0,0,0" Width="18" Height="18" VerticalAlignment="Center" Visibility="Collapsed">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<DrawingGroup.Transform>
<TranslateTransform X="6.1023980379104614E-05" Y="0" />
</DrawingGroup.Transform>
<GeometryDrawing Brush="#FFFF7800" Geometry="F1 M16,16z M0,0z M8.00493,0C7.74518,0,7.49541,0.0999063,7.2956,0.289728L5.5872,1.99813 2.99963,1.99813C2.45014,1.99813,2.00056,2.44771,2.00056,2.99719L2.00056,5.58476 0.292165,7.29316C-0.0974697,7.6828,-0.0974697,8.31221,0.292165,8.70184L2.00056,10.4102 2.00056,12.9978C2.00056,13.5473,2.45014,13.9969,2.99963,13.9969L5.5872,13.9969 7.2956,15.7053C7.68523,16.0949,8.31464,16.0949,8.70428,15.7053L10.4127,13.9969 13.0003,13.9969C13.5497,13.9969,13.9993,13.5473,13.9993,12.9978L13.9993,10.4102 15.7077,8.70184C16.0973,8.31221,16.0973,7.6828,15.7077,7.29316L13.9993,5.58476 13.9993,2.99719C13.9993,2.44771,13.5497,1.99813,13.0003,1.99813L10.4127,1.99813 8.70428,0.289728C8.50447,0.0899157,8.2547,0,7.99494,0L8.00493,0z M8.00493,4.99532C8.26469,4.99532,8.51446,5.09522,8.71427,5.28505L10.7124,7.28317C10.9022,7.47299,11.0021,7.72276,11.0021,7.99251L11.0021,8.99157 9.004,8.99157 9.004,10.9897 7.00587,10.9897 7.00587,8.99157 5.00774,8.99157 5.00774,7.99251C5.00774,7.73275,5.10765,7.47299,5.29747,7.28317L7.2956,5.28505C7.49541,5.08523,7.74518,4.99532,8.00493,4.99532z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="系统版本" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="18,0,0,0"/>
<TextBlock Name="AboutSystemVersion" Foreground="#878787" FontSize="14.5" Text="Windows 10 专业版 19045.3758" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,18,0"/>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="触摸设备" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="18,0,0,0"/>
<TextBlock Name="AboutTouchTabletText" Foreground="#878787" FontSize="14.5" Text="无触摸支持" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,18,0"/>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="构建时间" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="18,0,0,0"/>
<TextBlock Name="AboutBuildTime" Foreground="#878787" FontSize="14.5" Text="2024.8.22" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,18,0"/>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="版权信息" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="18,0,0,0"/>
<TextBlock Name="AboutCopyright" Foreground="#878787" FontSize="14.5" Text="正在获取..." VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,18,0"/>
</Grid>
</StackPanel>
</Border>
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<Grid Height="54">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="ICC 官方网站" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="18,0,0,0"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,18,0">
<TextBlock Name="LinkOfficialWebsite" Foreground="#1d4ed8" TextDecorations="Underline" FontSize="14.5" Text="inkcanvasforclass.github.io" VerticalAlignment="Center" HorizontalAlignment="Right" Cursor="Hand" MouseLeftButtonDown="LinkOfficialWebsite_MouseLeftButtonDown"/>
<Image Margin="12,0,0,0" Width="16" Height="16" VerticalAlignment="Center">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,16z M0,0z M3,2C1.338,2,0,3.338,0,5L0,13C0,14.662,1.338,16,3,16L11,16C12.662,16,14,14.662,14,13L14,9C13.9998,8.4477 13.5522,8 13,8 12.4478,8 12.0002,8.4477 12,9L12,13C12,13.554,11.554,14,11,14L3,14C2.446,14,2,13.554,2,13L2,5C2,4.446,2.446,4,3,4L7,4C7.5523,4 8,3.5523 8,3 8,2.4477 7.5523,2 7,2L3,2z M10,0C9.4477,0 9,0.4477 9,1 9,1.5523 9.4477,2 10,2L12.584,2 7.29303,7.29102C6.90133,7.68172 6.90133,8.31627 7.29303,8.70697 7.68353,9.09737 8.31659,9.09737 8.70709,8.70697L14,3.41412 14,6C14,6.5523 14.4477,7 15,7 15.5523,7 16,6.5523 16,6L16,1C15.9996,0.913 15.988,0.826187 15.965,0.742188 15.942,0.657187 15.909,0.576 15.865,0.5 15.822,0.424 15.768,0.35483 15.7068,0.29303 15.6918,0.28103 15.6758,0.268996 15.6598,0.257996 15.6048,0.207996 15.5433,0.164989 15.4782,0.129089 15.4412,0.110089 15.4022,0.0940781 15.363,0.0800781 15.312,0.0590781 15.2601,0.0431279 15.2067,0.0311279 15.1667,0.0211279 15.1267,0.0171226 15.0856,0.0131226 15.0566,0.00312256 15.0286,0.00309863 14.9996,0.00109863L10,0z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="Github 仓库" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="18,0,0,0"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,18,0">
<TextBlock Name="LinkGithubRepo" Foreground="#1d4ed8" TextDecorations="Underline" FontSize="14.5" Text="github.com/InkCanvasForClass/community" VerticalAlignment="Center" HorizontalAlignment="Right" Cursor="Hand" MouseLeftButtonDown="LinkGithubRepo_MouseLeftButtonDown"/>
<Image Margin="12,0,0,0" Width="16" Height="16" VerticalAlignment="Center">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,16z M0,0z M3,2C1.338,2,0,3.338,0,5L0,13C0,14.662,1.338,16,3,16L11,16C12.662,16,14,14.662,14,13L14,9C13.9998,8.4477 13.5522,8 13,8 12.4478,8 12.0002,8.4477 12,9L12,13C12,13.554,11.554,14,11,14L3,14C2.446,14,2,13.554,2,13L2,5C2,4.446,2.446,4,3,4L7,4C7.5523,4 8,3.5523 8,3 8,2.4477 7.5523,2 7,2L3,2z M10,0C9.4477,0 9,0.4477 9,1 9,1.5523 9.4477,2 10,2L12.584,2 7.29303,7.29102C6.90133,7.68172 6.90133,8.31627 7.29303,8.70697 7.68353,9.09737 8.31659,9.09737 8.70709,8.70697L14,3.41412 14,6C14,6.5523 14.4477,7 15,7 15.5523,7 16,6.5523 16,6L16,1C15.9996,0.913 15.988,0.826187 15.965,0.742188 15.942,0.657187 15.909,0.576 15.865,0.5 15.822,0.424 15.768,0.35483 15.7068,0.29303 15.6918,0.28103 15.6758,0.268996 15.6598,0.257996 15.6048,0.207996 15.5433,0.164989 15.4782,0.129089 15.4412,0.110089 15.4022,0.0940781 15.363,0.0800781 15.312,0.0590781 15.2601,0.0431279 15.2067,0.0311279 15.1667,0.0211279 15.1267,0.0171226 15.0856,0.0131226 15.0566,0.00312256 15.0286,0.00309863 14.9996,0.00109863L10,0z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="贡献者名单" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="18,0,0,0"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,18,0">
<TextBlock Name="LinkContributors" Foreground="#1d4ed8" TextDecorations="Underline" FontSize="14.5" Text="github.com/InkCanvasForClass/community#贡献者" VerticalAlignment="Center" HorizontalAlignment="Right" Cursor="Hand" MouseLeftButtonDown="LinkContributors_MouseLeftButtonDown"/>
<Image Margin="12,0,0,0" Width="16" Height="16" VerticalAlignment="Center">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,16z M0,0z M3,2C1.338,2,0,3.338,0,5L0,13C0,14.662,1.338,16,3,16L11,16C12.662,16,14,14.662,14,13L14,9C13.9998,8.4477 13.5522,8 13,8 12.4478,8 12.0002,8.4477 12,9L12,13C12,13.554,11.554,14,11,14L3,14C2.446,14,2,13.554,2,13L2,5C2,4.446,2.446,4,3,4L7,4C7.5523,4 8,3.5523 8,3 8,2.4477 7.5523,2 7,2L3,2z M10,0C9.4477,0 9,0.4477 9,1 9,1.5523 9.4477,2 10,2L12.584,2 7.29303,7.29102C6.90133,7.68172 6.90133,8.31627 7.29303,8.70697 7.68353,9.09737 8.31659,9.09737 8.70709,8.70697L14,3.41412 14,6C14,6.5523 14.4477,7 15,7 15.5523,7 16,6.5523 16,6L16,1C15.9996,0.913 15.988,0.826187 15.965,0.742188 15.942,0.657187 15.909,0.576 15.865,0.5 15.822,0.424 15.768,0.35483 15.7068,0.29303 15.6918,0.28103 15.6758,0.268996 15.6598,0.257996 15.6048,0.207996 15.5433,0.164989 15.4782,0.129089 15.4412,0.110089 15.4022,0.0940781 15.363,0.0800781 15.312,0.0590781 15.2601,0.0431279 15.2067,0.0311279 15.1667,0.0211279 15.1267,0.0171226 15.0856,0.0131226 15.0566,0.00312256 15.0286,0.00309863 14.9996,0.00109863L10,0z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</StackPanel>
</Grid>
</StackPanel>
</Border>
<StackPanel Orientation="Vertical" Margin="0,16,0,0">
<TextBlock Name="AboutBottomCopyright" Foreground="#2e3436" FontWeight="Bold" FontSize="12" Text="正在获取..." VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,15,0"/>
<TextBlock Foreground="#878787" Width="356" FlowDirection="RightToLeft" TextWrapping="Wrap" FontSize="12" Text="ICC 的部分元素设计参考来源于:© iNKORE! 名下产品 Inkways,已经过授权使用,最终解释权归 Yoojun Zhou 所有" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,6,15,0"/>
<TextBlock Foreground="#878787" FontWeight="Bold" Width="276" FlowDirection="RightToLeft" TextWrapping="Wrap" FontSize="12" Text="ICC 使用了 iNKORE! 开发的 UI 组件库:iNKORE.UI.WPF.Modern" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,6,15,0"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
</UserControl>
@@ -1,478 +0,0 @@
using Ink_Canvas.Helpers;
using iNKORE.UI.WPF.Helpers;
using OSVersionExtension;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Management;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// AboutPanel.xaml 的交互逻辑
/// </summary>
public partial class AboutPanel : UserControl
{
public AboutPanel()
{
InitializeComponent();
// 关于页面图片横幅
if (File.Exists(App.RootPath + "icc-about-illustrations.png"))
{
try
{
CopyrightBannerImage.Visibility = Visibility.Visible;
CopyrightBannerImage.Source =
new BitmapImage(new Uri($"file://{App.RootPath + "icc-about-illustrations.png"}"));
}
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
}
else
{
CopyrightBannerImage.Visibility = Visibility.Collapsed;
}
try
{
var version = Assembly.GetExecutingAssembly().GetName().Version;
AboutAppVersion.Text = $"InkCanvasForClass v{version}";
}
catch (Exception ex)
{
AboutAppVersion.Text = "InkCanvasForClass v未知";
System.Diagnostics.Debug.WriteLine($"获取软件版本失败: {ex.Message}");
}
try
{
string deviceId = DeviceIdentifier.GetDeviceId();
AboutDeviceID.Text = deviceId;
}
catch (Exception ex)
{
AboutDeviceID.Text = "获取失败";
System.Diagnostics.Debug.WriteLine($"获取设备ID失败: {ex.Message}");
}
try
{
var copyright = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyCopyrightAttribute>();
if (copyright != null && !string.IsNullOrEmpty(copyright.Copyright))
{
var copyrightText = copyright.Copyright;
AboutCopyright.Text = copyrightText;
AboutBottomCopyright.Text = copyrightText.Replace("Copyright ©", "© Copyright") + " 所有";
}
else
{
AboutCopyright.Text = "© Copyright 2025-2026 CJK_mkp 所有";
AboutBottomCopyright.Text = "© Copyright 2025-2026 CJK_mkp 所有";
}
}
catch (Exception ex)
{
AboutCopyright.Text = "© Copyright 2025-2026 CJK_mkp 所有";
AboutBottomCopyright.Text = "© Copyright 2025-2026 CJK_mkp 所有";
System.Diagnostics.Debug.WriteLine($"获取版权信息失败: {ex.Message}");
}
try
{
var assembly = Assembly.GetExecutingAssembly();
var filePath = assembly.Location;
if (File.Exists(filePath))
{
var bt = File.GetCreationTime(filePath);
var m = bt.Month.ToString().PadLeft(2, '0');
var d = bt.Day.ToString().PadLeft(2, '0');
var h = bt.Hour.ToString().PadLeft(2, '0');
var min = bt.Minute.ToString().PadLeft(2, '0');
var s = bt.Second.ToString().PadLeft(2, '0');
AboutBuildTime.Text = $"{bt.Year}-{m}-{d} {h}:{min}:{s}";
}
else
{
AboutBuildTime.Text = "获取失败";
}
}
catch (Exception ex)
{
AboutBuildTime.Text = "获取失败";
System.Diagnostics.Debug.WriteLine($"获取构建时间失败: {ex.Message}");
}
AboutSystemVersion.Text = $"{OSVersion.GetOperatingSystem()} {OSVersion.GetOSVersion().Version}";
var _t_touch = new Thread(() =>
{
try
{
var support = TouchTabletDetectHelper.IsTouchEnabled();
var touchcount = TouchTabletDetectHelper.GetTouchTabletDevices().Count;
Dispatcher.BeginInvoke(() =>
{
if (support)
{
if (touchcount > 0)
{
AboutTouchTabletText.Text = $"{touchcount}个设备,支持触摸设备";
}
else
{
AboutTouchTabletText.Text = "支持触摸设备";
}
}
else
{
AboutTouchTabletText.Text = "无触摸支持";
}
});
}
catch (Exception ex)
{
Dispatcher.BeginInvoke(() =>
AboutTouchTabletText.Text = "检测失败");
System.Diagnostics.Debug.WriteLine($"检测触摸设备失败: {ex.Message}");
}
});
_t_touch.Start();
CheckUpdateStatus();
}
private void CheckUpdateStatus()
{
try
{
var mainWindow = Application.Current.MainWindow as MainWindow;
if (mainWindow != null)
{
var field = typeof(MainWindow).GetField("AvailableLatestVersion", BindingFlags.NonPublic | BindingFlags.Instance);
if (field != null)
{
var availableVersion = field.GetValue(mainWindow) as string;
if (!string.IsNullOrEmpty(availableVersion))
{
UpdateAvailableIcon.Visibility = Visibility.Visible;
}
}
}
}
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
}
public static class TouchTabletDetectHelper
{
[DllImport("user32.dll")]
public static extern int GetSystemMetrics(int nIndex);
public static bool IsTouchEnabled()
{
const int MAXTOUCHES_INDEX = 95;
int maxTouches = GetSystemMetrics(MAXTOUCHES_INDEX);
return maxTouches > 0;
}
public class USBDeviceInfo
{
public USBDeviceInfo(string deviceID, string pnpDeviceID, string description)
{
DeviceID = deviceID;
PnpDeviceID = pnpDeviceID;
Description = description;
}
public string DeviceID { get; private set; }
public string PnpDeviceID { get; private set; }
public string Description { get; private set; }
}
public static List<USBDeviceInfo> GetTouchTabletDevices()
{
List<USBDeviceInfo> devices = new List<USBDeviceInfo>();
try
{
ManagementObjectCollection collection;
using (var searcher = new ManagementObjectSearcher(@"Select * From Win32_PnPEntity"))
collection = searcher.Get();
foreach (var device in collection)
{
try
{
var name = device.GetPropertyValue("Name")?.ToString() ?? "";
var description = device.GetPropertyValue("Description")?.ToString() ?? "";
if (string.IsNullOrEmpty(name)) continue;
var nameLower = name.ToLower();
var descLower = description.ToLower();
if (nameLower.Contains("pentablet") ||
nameLower.Contains("tablet") ||
nameLower.Contains("touch") ||
nameLower.Contains("digitizer") ||
descLower.Contains("touch") ||
descLower.Contains("digitizer"))
{
devices.Add(new USBDeviceInfo(
device.GetPropertyValue("DeviceID")?.ToString() ?? "",
device.GetPropertyValue("PNPDeviceID")?.ToString() ?? "",
description
));
}
}
catch
{
continue;
}
}
collection.Dispose();
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"获取触摸设备列表失败: {ex.Message}");
}
return devices;
}
}
public static class FileBuildTimeHelper
{
public struct _IMAGE_FILE_HEADER
{
public ushort Machine;
public ushort NumberOfSections;
public uint TimeDateStamp;
public uint PointerToSymbolTable;
public uint NumberOfSymbols;
public ushort SizeOfOptionalHeader;
public ushort Characteristics;
};
public static DateTimeOffset? GetBuildDateTime(Assembly assembly)
{
try
{
var path = assembly.Location;
if (string.IsNullOrEmpty(path) || !File.Exists(path))
{
return null;
}
using (var fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
var peHeader = new byte[4];
fileStream.Position = 0x3C;
fileStream.Read(peHeader, 0, 4);
var peHeaderOffset = BitConverter.ToUInt32(peHeader, 0);
fileStream.Position = peHeaderOffset;
var signature = new byte[4];
fileStream.Read(signature, 0, 4);
if (signature[0] != 0x50 || signature[1] != 0x45 || signature[2] != 0x00 || signature[3] != 0x00)
{
return null;
}
var fileHeader = new byte[Marshal.SizeOf(typeof(_IMAGE_FILE_HEADER))];
fileStream.Read(fileHeader, 0, fileHeader.Length);
var pinnedBuffer = GCHandle.Alloc(fileHeader, GCHandleType.Pinned);
try
{
var coffHeader = (_IMAGE_FILE_HEADER)Marshal.PtrToStructure(pinnedBuffer.AddrOfPinnedObject(), typeof(_IMAGE_FILE_HEADER));
var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
var buildTime = epoch.AddSeconds(coffHeader.TimeDateStamp);
return new DateTimeOffset(buildTime.ToLocalTime());
}
finally
{
pinnedBuffer.Free();
}
}
}
catch
{
return null;
}
}
}
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());
}
}
private void ScrollBar_Scroll(object sender, RoutedEventArgs e)
{
var scrollbar = (ScrollBar)sender;
var scrollviewer = scrollbar.FindAscendant<ScrollViewer>();
if (scrollviewer != null) scrollviewer.ScrollToVerticalOffset(scrollbar.Track.Value);
}
private void ScrollBarTrack_MouseEnter(object sender, MouseEventArgs e)
{
var border = (Border)sender;
if (border.Child is Track track)
{
track.Width = 16;
track.Margin = new Thickness(0, 0, -2, 0);
var scrollbar = track.FindAscendant<ScrollBar>();
if (scrollbar != null) scrollbar.Width = 16;
var grid = track.FindAscendant<Grid>();
if (grid.FindDescendantByName("ScrollBarBorderTrackBackground") is Border backgroundBorder)
{
backgroundBorder.Width = 8;
backgroundBorder.CornerRadius = new CornerRadius(4);
backgroundBorder.Opacity = 1;
}
var thumb = track.Thumb.Template.FindName("ScrollbarThumbEx", track.Thumb);
if (thumb != null)
{
var _thumb = thumb as Border;
_thumb.CornerRadius = new CornerRadius(4);
_thumb.Width = 8;
_thumb.Margin = new Thickness(-0.75, 0, 1, 0);
_thumb.Background = new SolidColorBrush(Color.FromRgb(138, 138, 138));
}
}
}
private void ScrollBarTrack_MouseLeave(object sender, MouseEventArgs e)
{
var border = (Border)sender;
border.Background = new SolidColorBrush(Colors.Transparent);
border.CornerRadius = new CornerRadius(0);
if (border.Child is Track track)
{
track.Width = 6;
track.Margin = new Thickness(0, 0, 0, 0);
var scrollbar = track.FindAscendant<ScrollBar>();
if (scrollbar != null) scrollbar.Width = 6;
var grid = track.FindAscendant<Grid>();
if (grid.FindDescendantByName("ScrollBarBorderTrackBackground") is Border backgroundBorder)
{
backgroundBorder.Width = 3;
backgroundBorder.CornerRadius = new CornerRadius(1.5);
backgroundBorder.Opacity = 0;
}
var thumb = track.Thumb.Template.FindName("ScrollbarThumbEx", track.Thumb);
if (thumb != null)
{
var _thumb = thumb as Border;
_thumb.CornerRadius = new CornerRadius(1.5);
_thumb.Width = 3;
_thumb.Margin = new Thickness(0);
_thumb.Background = new SolidColorBrush(Color.FromRgb(195, 195, 195));
}
}
}
private void ScrollbarThumb_MouseDown(object sender, MouseButtonEventArgs e)
{
var thumb = (Thumb)sender;
var border = thumb.Template.FindName("ScrollbarThumbEx", thumb);
((Border)border).Background = new SolidColorBrush(Color.FromRgb(95, 95, 95));
}
private void ScrollbarThumb_MouseUp(object sender, MouseButtonEventArgs e)
{
var thumb = (Thumb)sender;
var border = thumb.Template.FindName("ScrollbarThumbEx", thumb);
((Border)border).Background = new SolidColorBrush(Color.FromRgb(138, 138, 138));
}
private void LinkOfficialWebsite_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
try
{
Process.Start(new ProcessStartInfo
{
FileName = "https://inkcanvasforclass.github.io",
UseShellExecute = true
});
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"打开官方网站失败: {ex.Message}");
}
}
private void LinkGithubRepo_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
try
{
Process.Start(new ProcessStartInfo
{
FileName = "https://github.com/InkCanvasForClass/community",
UseShellExecute = true
});
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"打开GitHub仓库失败: {ex.Message}");
}
}
private void LinkContributors_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
try
{
Process.Start(new ProcessStartInfo
{
FileName = "https://github.com/InkCanvasForClass/community#贡献者",
UseShellExecute = true
});
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"打开贡献者名单失败: {ex.Message}");
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"AboutPanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,682 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.AdvancedPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ComboBoxStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- 开关样式模板 -->
<Style x:Key="ToggleSwitchStyle" TargetType="Border">
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="25"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="3,0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,0,15,0"/>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="ScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<!-- 特殊屏幕和触摸设置 -->
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="可在手指触摸画板时显示圆形橡皮或手掌触摸画板时显示的橡皮比手掌大很多时调整"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,0,0,12"/>
<!-- Description = 启用特殊屏幕模式以优化触摸体验 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="特殊屏幕模式" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AdvancedPanel_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsSpecialScreen" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="IsSpecialScreen" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 调整触摸大小的倍数 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="触摸倍数" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AdvancedPanel_Hint_1}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="TouchMultiplierSlider" Width="150" Minimum="0" Maximum="2" Value="0.3" TickFrequency="0.01" IsSnapToTickEnabled="True" ValueChanged="TouchMultiplierSlider_ValueChanged"/>
<TextBlock x:Name="TouchMultiplierText" Text="0.30" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 橡皮擦大小与触摸大小倍数绑定 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="橡皮擦绑定触摸大小倍数" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AdvancedPanel_Hint_2}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEraserBindTouchMultiplier" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="EraserBindTouchMultiplier" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 笔尖模式的接触面积区分界限 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="笔尖模式 BoundsWidth" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AdvancedPanel_Hint_3}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="NibModeBoundsWidthSlider" Width="150" Minimum="1" Maximum="50" Value="5" TickFrequency="1" IsSnapToTickEnabled="True"/>
<TextBlock x:Name="NibModeBoundsWidthText" Text="5" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 手指模式的接触面积区分界限 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="手指模式 BoundsWidth" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AdvancedPanel_Hint_4}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="FingerModeBoundsWidthSlider" Width="150" Minimum="1" Maximum="50" Value="20" TickFrequency="1" IsSnapToTickEnabled="True"/>
<TextBlock x:Name="FingerModeBoundsWidthText" Text="20" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 启用四边红外触摸屏模式 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="四边红外模式" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AdvancedPanel_Hint_5}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsQuadIR" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- 日志和系统设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<!-- Description = 启用日志记录功能 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="记录日志" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AdvancedPanel_Hint_6}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsLogEnabled" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid MinHeight="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,8,0,8">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="日志以日期保存" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="日志文件超过 512 KB 时会自动删除。开启日期保存后,日志将保存在Logs文件夹中,当文件夹大小超过5MB时自动清空" HorizontalAlignment="Left" MaxWidth="450"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsSaveLogByDate" Grid.Column="1" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" VerticalAlignment="Top" Margin="0,8,15,8">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 关闭软件时显示确认对话框 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="关闭软件时二次弹窗确认" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AdvancedPanel_Hint_7}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsSecondConfimeWhenShutdownApp" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- 实验性功能 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="实验性选项" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<!-- Description = 在自动更新前自动备份当前设置 -->
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Border Height="20" CornerRadius="3" Background="#7f1d1d" Padding="4,0" Margin="0,0,12,0">
<StackPanel Orientation="Horizontal">
<Image Width="15" Height="15" VerticalAlignment="Center">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#fca5a5"
Geometry="F1 M24,24z M0,0z M20.1758,20.0951L15.1058,9.97512C15.0358,9.83512,14.9958,9.68512,14.9958,9.52512L14.9958,2.99512 15.4958,2.99512C16.0458,2.99512 16.4958,2.54512 16.4958,1.99512 16.4958,1.44512 16.0458,0.995117 15.4958,0.995117L8.49582,0.995117C7.94582,0.995117 7.49582,1.44512 7.49582,1.99512 7.49582,2.54512 7.94582,2.99512 8.49582,2.99512L8.99582,2.99512 8.99582,9.52512C8.99582,9.67512,8.95582,9.83512,8.89582,9.97512L3.82582,20.0951C3.67582,20.4051 3.59582,20.7451 3.61582,21.0851 3.62582,21.4251 3.73582,21.7651 3.91582,22.0551 4.09582,22.3451 4.34582,22.5851 4.64582,22.7551 4.94582,22.9151 5.27582,23.0051 5.60582,23.0051L18.3758,23.0051C18.7558,23.0051 19.0558,22.9251 19.3558,22.7551 19.6558,22.5851 19.9058,22.3451 20.0858,22.0551 20.2658,21.7651 20.3658,21.4351 20.3858,21.0851 20.3958,20.7451 20.3258,20.4051 20.1758,20.1051L20.1758,20.0951z M10.6858,10.8651C10.8958,10.4451,11.0058,9.98512,11.0058,9.52512L11.0058,2.99512 13.0058,2.99512 13.0058,9.52512C13.0058,9.98512,13.1158,10.4551,13.3258,10.8651L15.3858,14.9951 8.62582,14.9951 10.6958,10.8651 10.6858,10.8651z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Foreground="#fca5a5" Text="实验性选项" FontSize="12" VerticalAlignment="Center" Margin="4,0,0,0"/>
</StackPanel>
</Border>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用FullScreenHelper" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsEnableFullScreenHelper" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<TextBlock Text="感谢lindexi大佬提供的FullScreenHelper,可以减少任务栏弹出的问题,且支持多显示器自动全屏"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,8,0,0"/>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Border Height="20" CornerRadius="3" Background="#7f1d1d" Padding="4,0" Margin="0,0,12,0">
<StackPanel Orientation="Horizontal">
<Image Width="15" Height="15" VerticalAlignment="Center">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#fca5a5"
Geometry="F1 M24,24z M0,0z M20.1758,20.0951L15.1058,9.97512C15.0358,9.83512,14.9958,9.68512,14.9958,9.52512L14.9958,2.99512 15.4958,2.99512C16.0458,2.99512 16.4958,2.54512 16.4958,1.99512 16.4958,1.44512 16.0458,0.995117 15.4958,0.995117L8.49582,0.995117C7.94582,0.995117 7.49582,1.44512 7.49582,1.99512 7.49582,2.54512 7.94582,2.99512 8.49582,2.99512L8.99582,2.99512 8.99582,9.52512C8.99582,9.67512,8.95582,9.83512,8.89582,9.97512L3.82582,20.0951C3.67582,20.4051 3.59582,20.7451 3.61582,21.0851 3.62582,21.4251 3.73582,21.7651 3.91582,22.0551 4.09582,22.3451 4.34582,22.5851 4.64582,22.7551 4.94582,22.9151 5.27582,23.0051 5.60582,23.0051L18.3758,23.0051C18.7558,23.0051 19.0558,22.9251 19.3558,22.7551 19.6558,22.5851 19.9058,22.3451 20.0858,22.0551 20.2658,21.7651 20.3658,21.4351 20.3858,21.0851 20.3958,20.7451 20.3258,20.4051 20.1758,20.1051L20.1758,20.0951z M10.6858,10.8651C10.8958,10.4451,11.0058,9.98512,11.0058,9.52512L11.0058,2.99512 13.0058,2.99512 13.0058,9.52512C13.0058,9.98512,13.1158,10.4551,13.3258,10.8651L15.3858,14.9951 8.62582,14.9951 10.6958,10.8651 10.6858,10.8651z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Foreground="#fca5a5" Text="实验性选项" FontSize="12" VerticalAlignment="Center" Margin="4,0,0,0"/>
</StackPanel>
</Border>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用AvoidFullScreenHelper" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsEnableAvoidFullScreenHelper" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<TextBlock Text="避免画布全屏,可解决开启dock栏软件后浮动工具栏偏高的问题"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,8,0,0"/>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Border Height="20" CornerRadius="3" Background="#7f1d1d" Padding="4,0" Margin="0,0,12,0">
<StackPanel Orientation="Horizontal">
<Image Width="15" Height="15" VerticalAlignment="Center">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#fca5a5"
Geometry="F1 M24,24z M0,0z M20.1758,20.0951L15.1058,9.97512C15.0358,9.83512,14.9958,9.68512,14.9958,9.52512L14.9958,2.99512 15.4958,2.99512C16.0458,2.99512 16.4958,2.54512 16.4958,1.99512 16.4958,1.44512 16.0458,0.995117 15.4958,0.995117L8.49582,0.995117C7.94582,0.995117 7.49582,1.44512 7.49582,1.99512 7.49582,2.54512 7.94582,2.99512 8.49582,2.99512L8.99582,2.99512 8.99582,9.52512C8.99582,9.67512,8.95582,9.83512,8.89582,9.97512L3.82582,20.0951C3.67582,20.4051 3.59582,20.7451 3.61582,21.0851 3.62582,21.4251 3.73582,21.7651 3.91582,22.0551 4.09582,22.3451 4.34582,22.5851 4.64582,22.7551 4.94582,22.9151 5.27582,23.0051 5.60582,23.0051L18.3758,23.0051C18.7558,23.0051 19.0558,22.9251 19.3558,22.7551 19.6558,22.5851 19.9058,22.3451 20.0858,22.0551 20.2658,21.7651 20.3658,21.4351 20.3858,21.0851 20.3958,20.7451 20.3258,20.4051 20.1758,20.1051L20.1758,20.0951z M10.6858,10.8651C10.8958,10.4451,11.0058,9.98512,11.0058,9.52512L11.0058,2.99512 13.0058,2.99512 13.0058,9.52512C13.0058,9.98512,13.1158,10.4551,13.3258,10.8651L15.3858,14.9951 8.62582,14.9951 10.6958,10.8651 10.6858,10.8651z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Foreground="#fca5a5" Text="实验性选项" FontSize="12" VerticalAlignment="Center" Margin="4,0,0,0"/>
</StackPanel>
</Border>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用EdgeGestureUtil" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsEnableEdgeGestureUtil" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<TextBlock Text="EdgeGestureUtil可以暂时阻止在使用触摸时触发边缘手势(如Windows10环境下,屏幕左边缘滑动进入任务视图,右边缘滑动弹出通知中心;Windows11环境下,底部向上滑动打开开始菜单)"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,8,0,0"/>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Border Height="20" CornerRadius="3" Background="#7f1d1d" Padding="4,0" Margin="0,0,12,0">
<StackPanel Orientation="Horizontal">
<Image Width="15" Height="15" VerticalAlignment="Center">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#fca5a5"
Geometry="F1 M24,24z M0,0z M20.1758,20.0951L15.1058,9.97512C15.0358,9.83512,14.9958,9.68512,14.9958,9.52512L14.9958,2.99512 15.4958,2.99512C16.0458,2.99512 16.4958,2.54512 16.4958,1.99512 16.4958,1.44512 16.0458,0.995117 15.4958,0.995117L8.49582,0.995117C7.94582,0.995117 7.49582,1.44512 7.49582,1.99512 7.49582,2.54512 7.94582,2.99512 8.49582,2.99512L8.99582,2.99512 8.99582,9.52512C8.99582,9.67512,8.95582,9.83512,8.89582,9.97512L3.82582,20.0951C3.67582,20.4051 3.59582,20.7451 3.61582,21.0851 3.62582,21.4251 3.73582,21.7651 3.91582,22.0551 4.09582,22.3451 4.34582,22.5851 4.64582,22.7551 4.94582,22.9151 5.27582,23.0051 5.60582,23.0051L18.3758,23.0051C18.7558,23.0051 19.0558,22.9251 19.3558,22.7551 19.6558,22.5851 19.9058,22.3451 20.0858,22.0551 20.2658,21.7651 20.3658,21.4351 20.3858,21.0851 20.3958,20.7451 20.3258,20.4051 20.1758,20.1051L20.1758,20.0951z M10.6858,10.8651C10.8958,10.4451,11.0058,9.98512,11.0058,9.52512L11.0058,2.99512 13.0058,2.99512 13.0058,9.52512C13.0058,9.98512,13.1158,10.4551,13.3258,10.8651L15.3858,14.9951 8.62582,14.9951 10.6958,10.8651 10.6858,10.8651z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Foreground="#fca5a5" Text="实验性选项" FontSize="12" VerticalAlignment="Center" Margin="4,0,0,0"/>
</StackPanel>
</Border>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用ForceFullScreen" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsEnableForceFullScreen" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<TextBlock Text="当检测到窗口大小变化时,自动使用Win32API将本窗口的大小设置为主显示器大小(设备像素大小),不需要可以关闭,实时生效"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,8,0,0"/>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Border Height="20" CornerRadius="3" Background="#7f1d1d" Padding="4,0" Margin="0,0,12,0">
<StackPanel Orientation="Horizontal">
<Image Width="15" Height="15" VerticalAlignment="Center">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#fca5a5"
Geometry="F1 M24,24z M0,0z M20.1758,20.0951L15.1058,9.97512C15.0358,9.83512,14.9958,9.68512,14.9958,9.52512L14.9958,2.99512 15.4958,2.99512C16.0458,2.99512 16.4958,2.54512 16.4958,1.99512 16.4958,1.44512 16.0458,0.995117 15.4958,0.995117L8.49582,0.995117C7.94582,0.995117 7.49582,1.44512 7.49582,1.99512 7.49582,2.54512 7.94582,2.99512 8.49582,2.99512L8.99582,2.99512 8.99582,9.52512C8.99582,9.67512,8.95582,9.83512,8.89582,9.97512L3.82582,20.0951C3.67582,20.4051 3.59582,20.7451 3.61582,21.0851 3.62582,21.4251 3.73582,21.7651 3.91582,22.0551 4.09582,22.3451 4.34582,22.5851 4.64582,22.7551 4.94582,22.9151 5.27582,23.0051 5.60582,23.0051L18.3758,23.0051C18.7558,23.0051 19.0558,22.9251 19.3558,22.7551 19.6558,22.5851 19.9058,22.3451 20.0858,22.0551 20.2658,21.7651 20.3658,21.4351 20.3858,21.0851 20.3958,20.7451 20.3258,20.4051 20.1758,20.1051L20.1758,20.0951z M10.6858,10.8651C10.8958,10.4451,11.0058,9.98512,11.0058,9.52512L11.0058,2.99512 13.0058,2.99512 13.0058,9.52512C13.0058,9.98512,13.1158,10.4551,13.3258,10.8651L15.3858,14.9951 8.62582,14.9951 10.6958,10.8651 10.6858,10.8651z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Foreground="#fca5a5" Text="实验性选项" FontSize="12" VerticalAlignment="Center" Margin="4,0,0,0"/>
</StackPanel>
</Border>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用DPIChangeDetection" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsEnableDPIChangeDetection" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<TextBlock Text="当检测到系统DPI变化时,会尝试检测FloatingBar是否在屏幕内显示,如果不在屏幕内显示将会尝试移动到屏幕内可见区域"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,8,0,0"/>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Border Height="20" CornerRadius="3" Background="#7f1d1d" Padding="4,0" Margin="0,0,12,0">
<StackPanel Orientation="Horizontal">
<Image Width="15" Height="15" VerticalAlignment="Center">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#fca5a5"
Geometry="F1 M24,24z M0,0z M20.1758,20.0951L15.1058,9.97512C15.0358,9.83512,14.9958,9.68512,14.9958,9.52512L14.9958,2.99512 15.4958,2.99512C16.0458,2.99512 16.4958,2.54512 16.4958,1.99512 16.4958,1.44512 16.0458,0.995117 15.4958,0.995117L8.49582,0.995117C7.94582,0.995117 7.49582,1.44512 7.49582,1.99512 7.49582,2.54512 7.94582,2.99512 8.49582,2.99512L8.99582,2.99512 8.99582,9.52512C8.99582,9.67512,8.95582,9.83512,8.89582,9.97512L3.82582,20.0951C3.67582,20.4051 3.59582,20.7451 3.61582,21.0851 3.62582,21.4251 3.73582,21.7651 3.91582,22.0551 4.09582,22.3451 4.34582,22.5851 4.64582,22.7551 4.94582,22.9151 5.27582,23.0051 5.60582,23.0051L18.3758,23.0051C18.7558,23.0051 19.0558,22.9251 19.3558,22.7551 19.6558,22.5851 19.9058,22.3451 20.0858,22.0551 20.2658,21.7651 20.3658,21.4351 20.3858,21.0851 20.3958,20.7451 20.3258,20.4051 20.1758,20.1051L20.1758,20.0951z M10.6858,10.8651C10.8958,10.4451,11.0058,9.98512,11.0058,9.52512L11.0058,2.99512 13.0058,2.99512 13.0058,9.52512C13.0058,9.98512,13.1158,10.4551,13.3258,10.8651L15.3858,14.9951 8.62582,14.9951 10.6958,10.8651 10.6858,10.8651z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Foreground="#fca5a5" Text="实验性选项" FontSize="12" VerticalAlignment="Center" Margin="4,0,0,0"/>
</StackPanel>
</Border>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用ResolutionChangeDetection" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsEnableResolutionChangeDetection" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<TextBlock Text="当检测到系统分辨率变化时,会尝试检测FloatingBar是否在屏幕内显示,如果不在屏幕内显示将会尝试移动到屏幕内可见区域"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,8,0,0"/>
</StackPanel>
</Border>
<!-- 设置备份与还原 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="设置备份与还原" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<TextBlock Text="可手动备份当前设置或还原之前的备份,自动更新前也会自动备份"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,0,0,12"/>
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自动更新前备份" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AdvancedPanel_Hint_8}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsAutoBackupBeforeUpdate" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 定期自动备份设置文件 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="定期自动备份" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AdvancedPanel_Hint_9}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsAutoBackupEnabled" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 设置定期备份的时间间隔 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="备份间隔" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AdvancedPanel_Hint_10}" HorizontalAlignment="Left"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Border x:Name="AutoBackupInterval1DayBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="AutoBackupInterval_1" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="1天"/>
</Border>
<Border x:Name="AutoBackupInterval3DaysBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="AutoBackupInterval_3" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="3天"/>
</Border>
<Border x:Name="AutoBackupInterval7DaysBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="AutoBackupInterval_7" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="7天"/>
</Border>
<Border x:Name="AutoBackupInterval14DaysBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="AutoBackupInterval_14" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="14天"/>
</Border>
<Border x:Name="AutoBackupInterval30DaysBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="AutoBackupInterval_30" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="30天"/>
</Border>
</WrapPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,8,0,0">
<Button x:Name="BtnManualBackup" Tag="manual_backup" Content="手动备份" Padding="12,6" Margin="0,0,12,0" Background="#2563eb" Foreground="White" Click="Button_Click"/>
<Button x:Name="BtnRestoreBackup" Tag="restore_backup" Content="还原备份" Padding="12,6" Background="#2563eb" Foreground="White" Click="Button_Click"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 文件关联管理 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="文件关联管理" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<TextBlock Text="管理.icstk文件的关联设置,双击.icstk文件可直接在Ink Canvas中打开"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,0,0,12"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,8,0,0">
<Button x:Name="BtnUnregisterFileAssociation" Tag="unregister" Content="取消文件关联" Padding="15,5" Margin="0,0,8,0" Background="#2563eb" Foreground="White" Click="Button_Click"/>
<Button x:Name="BtnCheckFileAssociation" Tag="check" Content="检查关联状态" Padding="15,5" Margin="0,0,8,0" Background="#2563eb" Foreground="White" Click="Button_Click"/>
<Button x:Name="BtnRegisterFileAssociation" Tag="register" Content="重新注册关联" Padding="15,5" Background="#2563eb" Foreground="White" Click="Button_Click"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 外部协议调用 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="外部协议调用" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<TextBlock Text="允许通过 icc:// 协议调用软件,支持从浏览器或其他应用快速控制软件"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,0,0,12"/>
<!-- Description = 开启后可通过 icc://fold (收纳) 或 icc://unfold (展开) 等命令控制 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用外部协议 (icc://)" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AdvancedPanel__iccfold___iccunfold__Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsEnableUriScheme" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="IsEnableUriScheme" MouseLeftButtonDown="ToggleSwitch_Click"
Focusable="True" KeyboardNavigation.IsTabStop="True" KeyDown="ToggleSwitch_KeyDown"
AutomationProperties.Name="启用外部协议 (icc://)"
AutomationProperties.HelpText="开启后可通过 icc://fold (收纳) 或 icc://unfold (展开) 等命令控制">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- 悬浮窗拦截 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="悬浮窗拦截" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<TextBlock Text="自动检测并拦截同类软件的悬浮窗"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,0,0,12"/>
<!-- Description = 开启后自动检测并拦截同类软件的悬浮窗 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用悬浮窗拦截" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AdvancedPanel_Hint_11}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchFloatingWindowInterceptorEnabled" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<!-- 拦截规则网格 -->
<Grid x:Name="FloatingWindowInterceptorGrid" Margin="0,12,0,0" Visibility="Collapsed">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<!-- 希沃白板3 -->
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/EasiNote3.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="希沃白板3" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchSeewoWhiteboard3Floating" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<!-- 希沃白板5 -->
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/EasiNote.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="希沃白板5" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchSeewoWhiteboard5Floating" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<!-- 希沃白板5C -->
<StackPanel Grid.Row="0" Grid.Column="2" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/EasiNote5C.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="希沃白板5C" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchSeewoWhiteboard5CFloating" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<!-- 希沃品课 -->
<StackPanel Grid.Row="0" Grid.Column="3" Orientation="Vertical" Margin="0,0,0,12">
<Image Source="/Resources/Icons-png/SeewoPinco.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="希沃品课" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchSeewoPincoSideBarFloating" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<!-- 希沃品课画笔 -->
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/SeewoPinco.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="希沃品课画笔" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchSeewoPincoDrawingFloating" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<!-- 希沃PPT小工具 -->
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/PPTTools.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="希沃PPT小工具" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchSeewoPPTFloating" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<!-- AiClass -->
<StackPanel Grid.Row="1" Grid.Column="2" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/AiClass.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="AiClass" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAiClassFloating" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<!-- 鸿合屏幕书写 -->
<StackPanel Grid.Row="1" Grid.Column="3" Orientation="Vertical" Margin="0,0,0,12">
<Image Source="/Resources/Icons-png/HiteAnnotation.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="鸿合屏幕书写" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchHiteAnnotationFloating" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<!-- 畅言智慧课堂 -->
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/畅言智慧课堂.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="畅言智慧课堂" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchChangYanFloating" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<!-- 畅言PPT -->
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/畅言智慧课堂.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="畅言PPT" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchChangYanPptFloating" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<!-- 天喻教育云 -->
<StackPanel Grid.Row="2" Grid.Column="2" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/天喻教育云.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="天喻教育云" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchIntelligentClassFloating" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<!-- 希沃桌面画笔 -->
<StackPanel Grid.Row="2" Grid.Column="3" Orientation="Vertical" Margin="0,0,0,12">
<Image Source="/Resources/Icons-png/SeewoPinco.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="希沃桌面画笔" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchSeewoDesktopAnnotationFloating" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<!-- 希沃桌面侧栏 -->
<StackPanel Grid.Row="3" Grid.Column="0" Orientation="Vertical" Margin="0,0,8,0">
<Image Source="/Resources/Icons-png/SeewoPinco.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="希沃桌面侧栏" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchSeewoDesktopSideBarFloating" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
</Grid>
<TextBlock x:Name="TextBlockFloatingWindowInterceptorStatus" Text="拦截器未启动"
Foreground="#9a9996" FontSize="12" Margin="0,8,0,0" Visibility="Collapsed"/>
</StackPanel>
</Border>
<!-- 云存储管理 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="云存储管理" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<Button x:Name="BtnDlassSettingsManage" Tag="dlass_settings" Content="云存储管理" Padding="15,5" HorizontalAlignment="Left" Background="#2563eb" Foreground="White" Click="Button_Click"/>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,596 +0,0 @@
using iNKORE.UI.WPF.Helpers;
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using Application = System.Windows.Application;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// AdvancedPanel.xaml 的交互逻辑
/// </summary>
public partial class AdvancedPanel : UserControl
{
private bool _isLoaded = false;
public AdvancedPanel()
{
InitializeComponent();
Loaded += AdvancedPanel_Loaded;
}
private void AdvancedPanel_Loaded(object sender, RoutedEventArgs e)
{
LoadSettings();
// 添加触摸支持
EnableTouchSupport();
// 应用主题
ApplyTheme();
_isLoaded = true;
}
/// <summary>
/// 为面板中的所有交互控件启用触摸支持
/// </summary>
private void EnableTouchSupport()
{
try
{
// 延迟执行,确保所有控件都已加载
Dispatcher.BeginInvoke(new Action(() =>
{
MainWindowSettingsHelper.EnableTouchSupportForControls(this);
}), System.Windows.Threading.DispatcherPriority.Loaded);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"AdvancedPanel 启用触摸支持时出错: {ex.Message}");
}
}
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());
}
}
/// <summary>
/// 加载设置到UI
/// </summary>
public void LoadSettings()
{
if (MainWindow.Settings == null || MainWindow.Settings.Advanced == null) return;
_isLoaded = false;
try
{
var advanced = MainWindow.Settings.Advanced;
// 特殊屏幕模式
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchIsSpecialScreen"), advanced.IsSpecialScreen);
// 触摸倍数
if (TouchMultiplierSlider != null)
{
TouchMultiplierSlider.Value = advanced.TouchMultiplier;
if (TouchMultiplierText != null)
{
TouchMultiplierText.Text = advanced.TouchMultiplier.ToString("F2");
}
}
// 橡皮擦绑定触摸大小倍数
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEraserBindTouchMultiplier"), advanced.EraserBindTouchMultiplier);
// 笔尖模式 BoundsWidth
if (NibModeBoundsWidthSlider != null)
{
NibModeBoundsWidthSlider.Value = advanced.NibModeBoundsWidth;
if (NibModeBoundsWidthText != null)
{
NibModeBoundsWidthText.Text = advanced.NibModeBoundsWidth.ToString();
}
}
// 手指模式 BoundsWidth
if (FingerModeBoundsWidthSlider != null)
{
FingerModeBoundsWidthSlider.Value = advanced.FingerModeBoundsWidth;
if (FingerModeBoundsWidthText != null)
{
FingerModeBoundsWidthText.Text = advanced.FingerModeBoundsWidth.ToString();
}
}
// 四边红外模式
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchIsQuadIR"), advanced.IsQuadIR);
// 记录日志
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchIsLogEnabled"), advanced.IsLogEnabled);
// 日志以日期保存
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchIsSaveLogByDate"), advanced.IsSaveLogByDate);
// 关闭软件时二次弹窗确认
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchIsSecondConfimeWhenShutdownApp"), advanced.IsSecondConfirmWhenShutdownApp);
// 实验性功能
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchIsEnableFullScreenHelper"), advanced.IsEnableFullScreenHelper);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchIsEnableAvoidFullScreenHelper"), advanced.IsEnableAvoidFullScreenHelper);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchIsEnableEdgeGestureUtil"), advanced.IsEnableEdgeGestureUtil);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchIsEnableForceFullScreen"), advanced.IsEnableForceFullScreen);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchIsEnableDPIChangeDetection"), advanced.IsEnableDPIChangeDetection);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchIsEnableResolutionChangeDetection"), advanced.IsEnableResolutionChangeDetection);
// 备份设置
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchIsAutoBackupBeforeUpdate"), advanced.IsAutoBackupBeforeUpdate);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchIsAutoBackupEnabled"), advanced.IsAutoBackupEnabled);
SetOptionButtonState("AutoBackupInterval", advanced.AutoBackupIntervalDays);
// 外部协议
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchIsEnableUriScheme"), advanced.IsEnableUriScheme);
// 悬浮窗拦截
// 注意:IsEnableFloatingWindowInterception 可能不在 Advanced 类中,需要确认
// 这里先假设它在 Advanced 类中,如果不在,需要调整
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"加载高级设置时出错: {ex.Message}");
}
_isLoaded = true;
}
/// <summary>
/// 查找ToggleSwitch控件
/// </summary>
private Border FindToggleSwitch(string name)
{
return this.FindDescendantByName(name) as Border;
}
/// <summary>
/// 设置ToggleSwitch状态
/// </summary>
private void SetToggleSwitchState(Border toggleSwitch, bool isOn)
{
if (toggleSwitch == null) return;
toggleSwitch.Background = isOn
? new SolidColorBrush(Color.FromRgb(53, 132, 228))
: (ThemeHelper.IsDarkTheme ? ThemeHelper.GetButtonBackgroundBrush() : new SolidColorBrush(Color.FromRgb(225, 225, 225)));
var innerBorder = toggleSwitch.Child as Border;
if (innerBorder != null)
{
innerBorder.HorizontalAlignment = isOn ? HorizontalAlignment.Right : HorizontalAlignment.Left;
innerBorder.Background = new SolidColorBrush(Colors.White);
}
}
/// <summary>
/// 设置选项按钮状态
/// </summary>
private void SetOptionButtonState(string group, int selectedValue)
{
var buttons = new Dictionary<string, Dictionary<int, string>>
{
{ "AutoBackupInterval", new Dictionary<int, string> { { 1, "1Day" }, { 3, "3Days" }, { 7, "7Days" }, { 14, "14Days" }, { 30, "30Days" } } }
};
if (!buttons.ContainsKey(group)) return;
var buttonNames = buttons[group];
if (!buttonNames.ContainsKey(selectedValue)) return;
string buttonName = buttonNames[selectedValue];
var button = this.FindDescendantByName($"{group}{buttonName}Border") as Border;
if (button != null)
{
bool isDarkTheme = ThemeHelper.IsDarkTheme;
var selectedBrush = isDarkTheme ? new SolidColorBrush(Color.FromRgb(25, 25, 25)) : new SolidColorBrush(Color.FromRgb(225, 225, 225));
var unselectedBrush = new SolidColorBrush(Colors.Transparent);
var parent = button.Parent as Panel;
if (parent != null)
{
foreach (var child in parent.Children)
{
if (child is Border childBorder && childBorder != button)
{
string childTag = childBorder.Tag?.ToString();
if (!string.IsNullOrEmpty(childTag) && childTag.StartsWith(group + "_"))
{
childBorder.Background = unselectedBrush;
var textBlock = childBorder.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Normal;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
}
}
}
button.Background = selectedBrush;
var currentTextBlock = button.Child as TextBlock;
if (currentTextBlock != null)
{
currentTextBlock.FontWeight = FontWeights.Bold;
currentTextBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
}
private bool GetCurrentSettingValue(string tag)
{
if (MainWindow.Settings?.Advanced == null) return false;
try
{
var advanced = MainWindow.Settings.Advanced;
switch (tag)
{
case "IsSpecialScreen":
return advanced.IsSpecialScreen;
case "EraserBindTouchMultiplier":
return advanced.EraserBindTouchMultiplier;
case "IsQuadIR":
return advanced.IsQuadIR;
case "IsLogEnabled":
return advanced.IsLogEnabled;
case "IsSaveLogByDate":
return advanced.IsSaveLogByDate;
case "IsSecondConfirmWhenShutdownApp":
return advanced.IsSecondConfirmWhenShutdownApp;
case "IsEnableFullScreenHelper":
return advanced.IsEnableFullScreenHelper;
case "IsEnableAvoidFullScreenHelper":
return advanced.IsEnableAvoidFullScreenHelper;
case "IsEnableEdgeGestureUtil":
return advanced.IsEnableEdgeGestureUtil;
case "IsEnableForceFullScreen":
return advanced.IsEnableForceFullScreen;
case "IsEnableDPIChangeDetection":
return advanced.IsEnableDPIChangeDetection;
case "IsEnableResolutionChangeDetection":
return advanced.IsEnableResolutionChangeDetection;
case "IsAutoBackupBeforeUpdate":
return advanced.IsAutoBackupBeforeUpdate;
case "IsAutoBackupEnabled":
return advanced.IsAutoBackupEnabled;
case "IsEnableUriScheme":
return advanced.IsEnableUriScheme;
default:
return false;
}
}
catch
{
return false;
}
}
/// <summary>
/// ToggleSwitch点击事件处理
/// </summary>
private void ToggleSwitch_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
string tag = border.Tag?.ToString();
if (string.IsNullOrEmpty(tag)) return;
bool currentState = GetCurrentSettingValue(tag);
bool newState = !currentState;
SetToggleSwitchState(border, newState);
var advanced = MainWindow.Settings.Advanced;
if (advanced == null) return;
switch (tag)
{
case "IsSpecialScreen":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsSpecialScreen", newState);
break;
case "EraserBindTouchMultiplier":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEraserBindTouchMultiplier", newState);
break;
case "IsQuadIR":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsQuadIR", newState);
break;
case "IsLogEnabled":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsLogEnabled", newState);
break;
case "IsSaveLogByDate":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsSaveLogByDate", newState);
break;
case "IsSecondConfirmWhenShutdownApp":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsSecondConfimeWhenShutdownApp", newState);
break;
case "IsEnableFullScreenHelper":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsEnableFullScreenHelper", newState);
break;
case "IsEnableAvoidFullScreenHelper":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsEnableAvoidFullScreenHelper", newState);
break;
case "IsEnableEdgeGestureUtil":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsEnableEdgeGestureUtil", newState);
break;
case "IsEnableForceFullScreen":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsEnableForceFullScreen", newState);
break;
case "IsEnableDPIChangeDetection":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsEnableDPIChangeDetection", newState);
break;
case "IsEnableResolutionChangeDetection":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsEnableResolutionChangeDetection", newState);
break;
case "IsAutoBackupBeforeUpdate":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsAutoBackupBeforeUpdate", newState);
break;
case "IsAutoBackupEnabled":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsAutoBackupEnabled", newState);
break;
case "IsEnableUriScheme":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchIsEnableUriScheme", newState);
break;
}
}
/// <summary>
/// ToggleSwitch键盘事件处理
/// </summary>
private void ToggleSwitch_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == System.Windows.Input.Key.Space || e.Key == System.Windows.Input.Key.Enter)
{
ToggleSwitch_Click(sender, new RoutedEventArgs());
e.Handled = true;
}
}
/// <summary>
/// Slider值变化事件处理
/// </summary>
private void TouchMultiplierSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
if (TouchMultiplierSlider != null && TouchMultiplierText != null)
{
double value = TouchMultiplierSlider.Value;
TouchMultiplierText.Text = value.ToString("F2");
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("TouchMultiplierSlider", value);
}
}
private void NibModeBoundsWidthSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
if (NibModeBoundsWidthSlider != null && NibModeBoundsWidthText != null)
{
double value = NibModeBoundsWidthSlider.Value;
NibModeBoundsWidthText.Text = ((int)value).ToString();
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("NibModeBoundsWidthSlider", value);
}
}
private void FingerModeBoundsWidthSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
if (FingerModeBoundsWidthSlider != null && FingerModeBoundsWidthText != null)
{
double value = FingerModeBoundsWidthSlider.Value;
FingerModeBoundsWidthText.Text = ((int)value).ToString();
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("FingerModeBoundsWidthSlider", value);
}
}
/// <summary>
/// 选项按钮点击事件处理
/// </summary>
private void OptionButton_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
string tag = border.Tag?.ToString();
if (string.IsNullOrEmpty(tag)) return;
string[] parts = tag.Split('_');
if (parts.Length < 2) return;
string group = parts[0];
string value = parts[1];
bool isDarkTheme = ThemeHelper.IsDarkTheme;
var selectedBrush = isDarkTheme ? ThemeHelper.GetButtonBackgroundBrush() : new SolidColorBrush(Color.FromRgb(225, 225, 225));
var unselectedBrush = new SolidColorBrush(Colors.Transparent);
var parent = border.Parent as Panel;
if (parent != null)
{
foreach (var child in parent.Children)
{
if (child is Border childBorder && childBorder != border)
{
string childTag = childBorder.Tag?.ToString();
if (!string.IsNullOrEmpty(childTag) && childTag.StartsWith(group + "_"))
{
childBorder.Background = unselectedBrush;
var textBlock = childBorder.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Normal;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
}
}
}
border.Background = selectedBrush;
var currentTextBlock = border.Child as TextBlock;
if (currentTextBlock != null)
{
currentTextBlock.FontWeight = FontWeights.Bold;
currentTextBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
if (MainWindow.Settings.Advanced == null) return;
switch (group)
{
case "AutoBackupInterval":
int days;
if (int.TryParse(value, out days))
{
// 尝试调用 MainWindow 中的方法
var mainWindow = Application.Current.MainWindow as MainWindow;
if (mainWindow != null)
{
var comboBox = mainWindow.FindName("ComboBoxAutoBackupInterval") as System.Windows.Controls.ComboBox;
if (comboBox != null)
{
// 找到对应的选项并设置
foreach (ComboBoxItem item in comboBox.Items)
{
if (item.Tag != null && int.TryParse(item.Tag.ToString(), out int tagValue) && tagValue == days)
{
comboBox.SelectedItem = item;
MainWindowSettingsHelper.InvokeComboBoxSelectionChanged("ComboBoxAutoBackupInterval", item);
break;
}
}
}
else
{
// 如果找不到控件,直接更新设置
MainWindowSettingsHelper.UpdateSettingDirectly(() =>
{
MainWindow.Settings.Advanced.AutoBackupIntervalDays = days;
}, "ComboBoxAutoBackupInterval");
}
}
}
break;
}
}
/// <summary>
/// 按钮点击事件处理(备份还原、文件关联等)
/// </summary>
private void Button_Click(object sender, RoutedEventArgs e)
{
var button = sender as Button;
if (button == null) return;
string action = button.Tag?.ToString();
if (string.IsNullOrEmpty(action)) action = button.Name;
// 这些按钮的功能可能需要调用 MainWindow 中的方法
// 暂时先留空,后续可以根据需要实现
switch (action)
{
case "manual_backup":
case "BtnManualBackup":
// TODO: 调用 MainWindow 的备份方法
break;
case "restore_backup":
case "BtnRestoreBackup":
// TODO: 调用 MainWindow 的还原方法
break;
case "unregister":
case "BtnUnregisterFileAssociation":
// TODO: 调用 MainWindow 的取消文件关联方法
break;
case "check":
case "BtnCheckFileAssociation":
// TODO: 调用 MainWindow 的检查文件关联状态方法
break;
case "register":
case "BtnRegisterFileAssociation":
// TODO: 调用 MainWindow 的注册文件关联方法
break;
case "dlass_settings":
case "BtnDlassSettingsManage":
// TODO: 调用 MainWindow 的 Dlass 设置管理方法
break;
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
if (_isLoaded)
{
LoadSettings();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"AdvancedPanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,520 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.AppearancePanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ComboBoxStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- 开关样式模板 -->
<Style x:Key="ToggleSwitchStyle" TargetType="Border">
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="25"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="3,0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,0,15,0"/>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="ScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<!-- 主题设置 -->
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<!-- Description = 选择应用程序的主题样式 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="主题" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Border x:Name="ThemeLightBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="Theme_Light">
<TextBlock Foreground="#2e3436" FontSize="14" Text="浅色主题"/>
</Border>
<Border x:Name="ThemeDarkBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="Theme_Dark" Margin="8,0,0,0">
<TextBlock Foreground="#2e3436" FontSize="14" Text="深色主题"/>
</Border>
<Border x:Name="ThemeSystemBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="Theme_System" Margin="8,0,0,0">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="跟随系统"/>
</Border>
</StackPanel>
</Grid>
</StackPanel>
</Border>
<!-- 启动动画设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<!-- Description = 启动时显示动画效果 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用启动动画" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_1}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableSplashScreen" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<StackPanel Margin="18,8,18,8" x:Name="SplashScreenStylePanel">
<StackPanel Orientation="Vertical" Margin="0,0,0,12">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启动动画样式" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_2}" HorizontalAlignment="Left"/>
</StackPanel>
<WrapPanel Orientation="Horizontal">
<Border x:Name="SplashScreenStyleRandomBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="SplashScreenStyle_Random" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="随机"/>
</Border>
<Border x:Name="SplashScreenStyleSeasonBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="SplashScreenStyle_Season" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="跟随四季"/>
</Border>
<Border x:Name="SplashScreenStyleSpringBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="SplashScreenStyle_Spring" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="春季"/>
</Border>
<Border x:Name="SplashScreenStyleSummerBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="SplashScreenStyle_Summer" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="夏季"/>
</Border>
<Border x:Name="SplashScreenStyleAutumnBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="SplashScreenStyle_Autumn" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="秋季"/>
</Border>
<Border x:Name="SplashScreenStyleWinterBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="SplashScreenStyle_Winter" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="冬季"/>
</Border>
<Border x:Name="SplashScreenStyleHorseBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="SplashScreenStyle_Horse" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="马年限定"/>
</Border>
</WrapPanel>
</StackPanel>
</StackPanel>
</Border>
<!-- 浮动工具栏设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<StackPanel Margin="18,8,18,8">
<StackPanel Orientation="Vertical" Margin="0,0,0,12">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="浮动工具栏图标" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_3}" HorizontalAlignment="Left"/>
</StackPanel>
<WrapPanel Orientation="Horizontal">
<Border x:Name="FloatingBarImgDefaultBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="FloatingBarImg_Default" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="&quot;ICC-CE&quot;默认"/>
</Border>
<Border x:Name="FloatingBarImgNoShadowBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="FloatingBarImg_NoShadow" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="&quot;ICC-CE&quot;无阴影"/>
</Border>
<Border x:Name="FloatingBarImgDarkBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="FloatingBarImg_Dark" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="&quot;ICC-CE&quot;深色"/>
</Border>
<Border x:Name="FloatingBarImgDarkBreathingBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="FloatingBarImg_DarkBreathing" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="&quot;ICC-CE&quot;深色呼吸版"/>
</Border>
<Border x:Name="FloatingBarImgWhiteTransparentBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="FloatingBarImg_WhiteTransparent" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="&quot;ICC-CE&quot;白色透明版"/>
</Border>
<Border x:Name="FloatingBarImgBlackTransparentBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="FloatingBarImg_BlackTransparent" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="&quot;ICC-CE&quot;黑色透明版"/>
</Border>
<Border x:Name="FloatingBarImgKuan1Border" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="FloatingBarImg_Kuan1" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="酷安斗鸡眼滑稽"/>
</Border>
<Border x:Name="FloatingBarImgKuan2Border" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="FloatingBarImg_Kuan2" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="酷安受虐滑稽"/>
</Border>
<Border x:Name="FloatingBarImgKuan3Border" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="FloatingBarImg_Kuan3" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="酷安呲牙笑"/>
</Border>
<Border x:Name="FloatingBarImgKuan4Border" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="FloatingBarImg_Kuan4" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="酷安头戴内裤滑稽"/>
</Border>
<Border x:Name="FloatingBarImgKuan5Border" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="FloatingBarImg_Kuan5" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="酷安绿帽Doge"/>
</Border>
<Border x:Name="FloatingBarImgTiebaBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="FloatingBarImg_Tieba" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="贴吧滑稽"/>
</Border>
</WrapPanel>
</StackPanel>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 调整浮动工具栏的大小 -->
<Grid Height="54">
<StackPanel Orientation="Horizontal" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自定义浮动栏图标" HorizontalAlignment="Left" Margin="0,0,12,0"/>
<Button x:Name="ButtonAddCustomIcon" Content="上传" Padding="10,3"/>
<Button x:Name="ButtonManageCustomIcons" Content="管理" Padding="10,3" Margin="5,0,0,0"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="浮动工具栏缩放" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_4}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="ViewboxFloatingBarScaleTransformValueSlider" Width="150" Minimum="0.5" Maximum="1.25" Value="1" TickFrequency="0.05" IsSnapToTickEnabled="True"/>
<TextBlock x:Name="ViewboxFloatingBarScaleTransformValueText" Text="1.00" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 调整浮动工具栏的透明度 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="浮动工具栏透明度" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_5}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="ViewboxFloatingBarOpacityValueSlider" Width="150" Minimum="0.3" Maximum="1" Value="1" TickFrequency="0.05" IsSnapToTickEnabled="True"/>
<TextBlock x:Name="ViewboxFloatingBarOpacityValueText" Text="1.00" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 在PPT模式下浮动工具栏的透明度(重新进入PPT放映后生效) -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="浮栏在PPT下透明度" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_PPTPPTHint}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="ViewboxFloatingBarOpacityInPPTValueSlider" Width="150" Minimum="0.3" Maximum="1" Value="1" TickFrequency="0.05" IsSnapToTickEnabled="True"/>
<TextBlock x:Name="ViewboxFloatingBarOpacityInPPTValueText" Text="1.00" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 在调色盘窗口中显示笔尖模式切换按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="在调色盘窗口中显示 笔尖模式 按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_6}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableDisPlayNibModeToggle" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 使用旧版浮动栏按钮的界面样式 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="使用老版浮动栏按钮UI" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_7}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxUseLegacyFloatingBarUI" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0"/>
</Grid>
</StackPanel>
</Border>
<!-- 浮动栏按钮显示设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="浮动栏按钮显示" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<!-- Description = 在浮动栏中显示形状按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示形状按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_8}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowShapeButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示撤销按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示撤销按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_9}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowUndoButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示重做按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示重做按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_10}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowRedoButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示清空按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示清空按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_11}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowClearButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示白板按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示白板按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_12}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowWhiteboardButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示隐藏按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示隐藏按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_13}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowHideButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示套索选择按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示套索选择按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_14}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowLassoSelectButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示清并鼠按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示清并鼠按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_15}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowClearAndMouseButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示快捷调色盘 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示快捷调色盘" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_16}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowQuickColorPalette" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 选择快捷调色盘的显示模式 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="快捷调色盘显示模式" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_17}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Border x:Name="QuickColorPaletteDisplayModeSingleBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="QuickColorPaletteDisplayMode_Single">
<TextBlock Foreground="#2e3436" FontSize="14" Text="单行显示(6色)"/>
</Border>
<Border x:Name="QuickColorPaletteDisplayModeDoubleBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="QuickColorPaletteDisplayMode_Double" Margin="8,0,0,0">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="双行显示(8色)"/>
</Border>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Vertical" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,8,0,12">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="橡皮按钮显示" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="选择橡皮按钮的显示方式" HorizontalAlignment="Left"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" Margin="0,0,0,8">
<Border x:Name="EraserDisplayOptionBothBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="EraserDisplayOption_Both" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="两个都显示"/>
</Border>
<Border x:Name="EraserDisplayOptionAreaBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="EraserDisplayOption_Area" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="仅显示面积擦"/>
</Border>
<Border x:Name="EraserDisplayOptionLineBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="EraserDisplayOption_Line" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="仅显示线擦"/>
</Border>
<Border x:Name="EraserDisplayOptionNoneBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="EraserDisplayOption_None" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="都不显示"/>
</Border>
</WrapPanel>
</StackPanel>
</StackPanel>
</Border>
<!-- 任务栏托盘图标设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="任务栏托盘图标" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<!-- Description = 在任务栏系统托盘显示图标 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用托盘图标" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_18}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableTrayIcon" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- 白板设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<!-- Description = 将白板界面缩放至80% -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="白板 UI 80% 缩放" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_80Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableViewboxBlackBoardScaleTransform" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 在白板界面显示当前时间和日期 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="在白板中显示当前时间和日期" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_19}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableTimeDisplayInWhiteboardMode" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 在白板界面显示励志语句 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="在白板中显示信仰の源1(好喝的/毒的鸡汤)" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_20}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableChickenSoupInWhiteboardMode" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Vertical" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,8,0,12">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="信仰の源出自Where" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="选择励志语句的来源" HorizontalAlignment="Left"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" Margin="0,0,0,8">
<Border x:Name="ChickenSoupSourceOsuBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="ChickenSoupSource_Osu" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="osu!玩家语录"/>
</Border>
<Border x:Name="ChickenSoupSourceMotivationalBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="ChickenSoupSource_Motivational" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="励志立志的名言警句"/>
</Border>
<Border x:Name="ChickenSoupSourceGaokaoBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="ChickenSoupSource_Gaokao" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="高考祝福语"/>
</Border>
<Border x:Name="ChickenSoupSourceHitokotoBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="ChickenSoupSource_Hitokoto" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="一言(Hitokoto API"/>
</Border>
</WrapPanel>
</StackPanel>
</StackPanel>
</Border>
<!-- 收纳模式设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<!-- Description = 在收纳模式下显示快速操作面板 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="在收纳模式下启用快速面板" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_21}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableQuickPanel" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 选择取消收纳按钮的图标样式 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="取消收纳按钮图标" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_22}" HorizontalAlignment="Left"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Border x:Name="UnFoldBtnImgArrowBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="UnFoldBtnImg_Arrow" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="箭头"/>
</Border>
<Border x:Name="UnFoldBtnImgPenBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="UnFoldBtnImg_Pen" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="笔"/>
</Border>
</WrapPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 开启后,退出收纳模式时将自动切换至批注模式,便于快速批注 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="退出收纳模式时自动切换至批注模式" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_23}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoEnterAnnotationModeWhenExitFoldMode" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 开启后,退出PPT放映后会自动收纳浮动栏 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="退出PPT放映后自动收纳浮动栏" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_PPTHint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoFoldAfterPPTSlideShow" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 开启后,退出白板模式时会自动收纳到侧边栏 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="退出白板时自动收纳" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AppearancePanel_Hint_24}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoFoldWhenExitWhiteboard" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,48 +0,0 @@
using System;
using System.Windows;
using System.Windows.Controls;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// AppearancePanel.xaml 的交互逻辑
/// </summary>
public partial class AppearancePanel : UserControl
{
public AppearancePanel()
{
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());
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"AppearancePanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,422 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.AutomationPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<UserControl.Resources>
<!-- 开关样式模板 -->
<Style x:Key="ToggleSwitchStyle" TargetType="Border">
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="25"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="3,0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,0,15,0"/>
</Style>
</UserControl.Resources>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="ScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<!-- 自动收纳设置 -->
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="自动收纳" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<!-- 第一行 -->
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/EasiNote.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="希沃白板5" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInEasiNote" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/EasiCamera.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="希沃展台" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInEasiCamera" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="2" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/HiteBoard.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="鸿合白板" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInHiteTouchPro" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="3" Orientation="Vertical" Margin="0,0,0,12">
<Image Source="/Resources/Icons-png/EasiNote3.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="希沃白板3" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInEasiNote3" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<!-- 第二行 -->
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/EasiNote3C.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="希沃轻白板" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInEasiNote3C" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/EasiNote5C.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="希沃轻白板5C" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInEasiNote5C" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="2" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/SeewoPinco.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="希沃品课" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInSeewoPincoTeacher" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="3" Orientation="Vertical" Margin="0,0,0,12">
<Image Source="/Resources/Icons-png/HiteCamera.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="鸿合展台" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInHiteCamera" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<!-- 第三行 -->
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/HiteLightBoard.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="鸿合轻量白板" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInHiteLightBoard" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/WenXiang.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="文香白板" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInWxBoardMain" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="2" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/Whiteboard.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="微软白板" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInMSWhiteboard" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="3" Orientation="Vertical" Margin="0,0,0,12">
<Image Source="/Resources/Icons-png/AdmoxWhiteboard.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="安道白板" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInAdmoxWhiteboard" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<!-- 第四行 -->
<StackPanel Grid.Row="3" Grid.Column="0" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/AdmoxBooth.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="安道展台" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInAdmoxBooth" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/YiYunWhiteboard.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="艺云白板" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInQPoint" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<StackPanel Grid.Row="3" Grid.Column="2" Orientation="Vertical" Margin="0,0,8,12">
<Image Source="/Resources/Icons-png/YiYunVisualPresenter.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="艺云展台" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInYiYunVisualPresenter" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
<StackPanel Grid.Row="3" Grid.Column="3" Orientation="Vertical" Margin="0,0,0,12">
<Image Source="/Resources/Icons-png/MaxHubWhiteboard.png" Width="42" Height="42" HorizontalAlignment="Center" Margin="0,0,0,4"/>
<TextBlock Text="MaxHub白板" HorizontalAlignment="Center" FontSize="14" Margin="0,0,0,4" Foreground="#2e3436"/>
<Border x:Name="ToggleSwitchAutoFoldInMaxHubWhiteboard" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" HorizontalAlignment="Center" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 开启后,执行自动收纳的软件在软件退出后不退出收纳模式,保持收纳状态 -->
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/Powerpoint.png" Margin="0,0,6,0" Width="28" Height="28" VerticalAlignment="Center"/>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="播放PPT时自动收纳" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoFoldInPPTSlideShow" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="软件退出后保持收纳模式" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AutomationPanel_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchKeepFoldAfterSoftwareExit" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 查杀鸿合屏幕书写后自动进入批注模式 -->
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/EasiNote.png" Margin="0,0,6,0" Width="28" Height="28" VerticalAlignment="Center"/>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自动收纳忽略桌面EN5批注窗口" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoFoldInEasiNoteIgnoreDesktopAnno" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/Donview.png" Margin="0,0,6,0" Width="28" Height="28" VerticalAlignment="Center"/>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="进入&quot;中原旧白板&quot;时自动收纳" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoFoldInOldZyBoard" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- 自动查杀设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="自动查杀" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/PPTTools.png" Margin="0,0,6,0" Width="28" Height="28" VerticalAlignment="Center"/>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自动查杀希沃&quot;PPT 小工具&quot;" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoKillPptService" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<TextBlock Text="请注意,查杀 PPT 小工具会导致希沃课堂授课助手无法使用"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,8,0,0"/>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/EasiNote.png" Margin="0,0,6,0" Width="28" Height="28" VerticalAlignment="Center"/>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自动查杀 希沃白板5" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoKillEasiNote" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/HiteAnnotation.png" Margin="0,0,6,0" Width="28" Height="28" VerticalAlignment="Center"/>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自动查杀 鸿合屏幕书写" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoKillHiteAnnotation" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="鸿合屏幕书写查杀后自动进入批注" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=AutomationPanel_Hint_1}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoEnterAnnotationAfterKillHite" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/VComYouJiao.png" Margin="0,0,6,0" Width="28" Height="28" VerticalAlignment="Center"/>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自动查杀 优教授课端" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoKillVComYouJiao" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/Seewo2Annotation.png" Margin="0,0,6,0" Width="28" Height="28" VerticalAlignment="Center"/>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自动查杀 希沃桌面2.0 桌面批注" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoKillSeewoLauncher2DesktopAnnotation" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<TextBlock Text="由于希沃桌面2.0提供的桌面批注是64位应用程序,icc是32位程序无法访问,所以目前暂不做精准匹配,只匹配进程名称DesktopAnnotation"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,8,0,0"/>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<TextBlock Text="同类软件查杀" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/InkCanvas.png" Margin="0,0,6,0" Width="28" Height="28" VerticalAlignment="Center"/>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自动查杀 Ink Canvas 和 IC+" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoKillInkCanvas" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/ica.png" Margin="0,0,6,0" Width="28" Height="28" VerticalAlignment="Center"/>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自动查杀ICA(新版旧版通杀)" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoKillICA" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/idt.png" Margin="0,0,6,0" Width="28" Height="28" VerticalAlignment="Center"/>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自动查杀 智绘教Inkeys(仅限新版)" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoKillIDT" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,204 +0,0 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// AutomationPanel.xaml 的交互逻辑
/// </summary>
public partial class AutomationPanel : UserControl
{
private bool _isLoaded = false;
public AutomationPanel()
{
InitializeComponent();
Loaded += AutomationPanel_Loaded;
}
private void AutomationPanel_Loaded(object sender, RoutedEventArgs e)
{
LoadSettings();
// 添加触摸支持
EnableTouchSupport();
// 应用主题
ApplyTheme();
_isLoaded = true;
}
/// <summary>
/// 加载设置
/// </summary>
private void LoadSettings()
{
try
{
if (MainWindow.Settings == null || MainWindow.Settings.Automation == null) return;
_isLoaded = false;
var automation = MainWindow.Settings.Automation;
// 自动收纳相关
SetToggleSwitchState("ToggleSwitchAutoFoldInEasiNote", automation.IsAutoFoldInEasiNote);
SetToggleSwitchState("ToggleSwitchAutoFoldInEasiCamera", automation.IsAutoFoldInEasiCamera);
SetToggleSwitchState("ToggleSwitchAutoFoldInHiteTouchPro", automation.IsAutoFoldInHiteTouchPro);
SetToggleSwitchState("ToggleSwitchAutoFoldInEasiNote3", automation.IsAutoFoldInEasiNote3);
SetToggleSwitchState("ToggleSwitchAutoFoldInEasiNote3C", automation.IsAutoFoldInEasiNote3C);
SetToggleSwitchState("ToggleSwitchAutoFoldInEasiNote5C", automation.IsAutoFoldInEasiNote5C);
SetToggleSwitchState("ToggleSwitchAutoFoldInSeewoPincoTeacher", automation.IsAutoFoldInSeewoPincoTeacher);
SetToggleSwitchState("ToggleSwitchAutoFoldInHiteCamera", automation.IsAutoFoldInHiteCamera);
SetToggleSwitchState("ToggleSwitchAutoFoldInHiteLightBoard", automation.IsAutoFoldInHiteLightBoard);
SetToggleSwitchState("ToggleSwitchAutoFoldInWxBoardMain", automation.IsAutoFoldInWxBoardMain);
SetToggleSwitchState("ToggleSwitchAutoFoldInMSWhiteboard", automation.IsAutoFoldInMSWhiteboard);
SetToggleSwitchState("ToggleSwitchAutoFoldInAdmoxWhiteboard", automation.IsAutoFoldInAdmoxWhiteboard);
SetToggleSwitchState("ToggleSwitchAutoFoldInAdmoxBooth", automation.IsAutoFoldInAdmoxBooth);
SetToggleSwitchState("ToggleSwitchAutoFoldInQPoint", automation.IsAutoFoldInQPoint);
SetToggleSwitchState("ToggleSwitchAutoFoldInYiYunVisualPresenter", automation.IsAutoFoldInYiYunVisualPresenter);
SetToggleSwitchState("ToggleSwitchAutoFoldInMaxHubWhiteboard", automation.IsAutoFoldInMaxHubWhiteboard);
SetToggleSwitchState("ToggleSwitchAutoFoldInPPTSlideShow", automation.IsAutoFoldInPPTSlideShow);
SetToggleSwitchState("ToggleSwitchAutoFoldInEasiNoteIgnoreDesktopAnno", automation.IsAutoFoldInEasiNoteIgnoreDesktopAnno);
SetToggleSwitchState("ToggleSwitchAutoFoldInOldZyBoard", automation.IsAutoFoldInOldZyBoard);
SetToggleSwitchState("ToggleSwitchKeepFoldAfterSoftwareExit", automation.KeepFoldAfterSoftwareExit);
// 自动查杀相关
SetToggleSwitchState("ToggleSwitchAutoKillPptService", automation.IsAutoKillPptService);
SetToggleSwitchState("ToggleSwitchAutoKillEasiNote", automation.IsAutoKillEasiNote);
SetToggleSwitchState("ToggleSwitchAutoKillHiteAnnotation", automation.IsAutoKillHiteAnnotation);
SetToggleSwitchState("ToggleSwitchAutoEnterAnnotationAfterKillHite", automation.IsAutoEnterAnnotationAfterKillHite);
SetToggleSwitchState("ToggleSwitchAutoKillVComYouJiao", automation.IsAutoKillVComYouJiao);
SetToggleSwitchState("ToggleSwitchAutoKillSeewoLauncher2DesktopAnnotation", automation.IsAutoKillSeewoLauncher2DesktopAnnotation);
SetToggleSwitchState("ToggleSwitchAutoKillInkCanvas", automation.IsAutoKillInkCanvas);
SetToggleSwitchState("ToggleSwitchAutoKillICA", automation.IsAutoKillICA);
SetToggleSwitchState("ToggleSwitchAutoKillIDT", automation.IsAutoKillIDT);
_isLoaded = true;
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"AutomationPanel 加载设置时出错: {ex.Message}");
_isLoaded = true;
}
}
/// <summary>
/// 设置 ToggleSwitch 状态
/// </summary>
private void SetToggleSwitchState(string name, bool isOn)
{
try
{
var border = FindName(name) as Border;
if (border == null) return;
border.Background = isOn
? new SolidColorBrush(Color.FromRgb(0x35, 0x84, 0xE4))
: (ThemeHelper.IsDarkTheme ? ThemeHelper.GetButtonBackgroundBrush() : new SolidColorBrush(Color.FromRgb(0xE1, 0xE1, 0xE1)));
var innerBorder = border.Child as Border;
if (innerBorder != null)
{
innerBorder.HorizontalAlignment = isOn ? HorizontalAlignment.Right : HorizontalAlignment.Left;
// 保持滑块为白色(主题切换时也更稳定)
innerBorder.Background = new SolidColorBrush(Colors.White);
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"AutomationPanel 设置 ToggleSwitch {name} 状态时出错: {ex.Message}");
}
}
private static bool IsToggleSwitchOn(Border border)
{
try
{
if (border?.Background is SolidColorBrush scb)
{
return scb.Color.A == 0xFF &&
scb.Color.R == 0x35 &&
scb.Color.G == 0x84 &&
scb.Color.B == 0xE4;
}
var s = border?.Background?.ToString();
return string.Equals(s, "#FF3584E4", StringComparison.OrdinalIgnoreCase);
}
catch
{
return false;
}
}
/// <summary>
/// ToggleSwitch 点击事件处理
/// </summary>
private void ToggleSwitch_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
bool newState = !IsToggleSwitchOn(border);
SetToggleSwitchState(border.Name, newState);
// 通过 MainWindowSettingsHelper 调用 MainWindow 中的方法
string toggleSwitchName = border.Name;
MainWindowSettingsHelper.InvokeToggleSwitchToggled(toggleSwitchName, newState);
}
/// <summary>
/// 为面板中的所有交互控件启用触摸支持
/// </summary>
private void EnableTouchSupport()
{
try
{
// 延迟执行,确保所有控件都已加载
Dispatcher.BeginInvoke(new Action(() =>
{
MainWindowSettingsHelper.EnableTouchSupportForControls(this);
}), System.Windows.Threading.DispatcherPriority.Loaded);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"AutomationPanel 启用触摸支持时出错: {ex.Message}");
}
}
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());
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"AutomationPanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,399 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.CanvasAndInkPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ComboBoxStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- 开关样式模板 -->
<Style x:Key="ToggleSwitchStyle" TargetType="Border">
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="25"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="3,0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,0,15,0"/>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="ScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<!-- 画笔和光标设置 -->
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<!-- Description = 绘制时显示画笔光标 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示画笔光标" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=CanvasAndInkPanel_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchShowCursor" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="ShowCursor" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 开启后,触屏设备也将支持压感效果,适用于部分支持压感但无法被系统识别的触屏设备 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用压感触屏模式" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=CanvasAndInkPanel_Hint_1}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnablePressureTouchMode" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="EnablePressureTouchMode" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 开启后,将忽略所有设备的压感信息,使所有笔画具有统一的粗细。与压感触屏模式互斥 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="屏蔽压感" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=CanvasAndInkPanel_Hint_2}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchDisablePressure" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="DisablePressure" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 开启后,进入 PPT 模式时未处于批注模式时不会显示墨迹 -->
<Grid Height="54">
<StackPanel Orientation="Horizontal" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="板擦橡皮大小" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Border x:Name="EraserSizeVerySmall" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="EraserSize_VerySmall" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="很小"/>
</Border>
<Border x:Name="EraserSizeSmall" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="EraserSize_Small" Margin="8,0,0,0" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="较小"/>
</Border>
<Border x:Name="EraserSizeMedium" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="EraserSize_Medium" Margin="8,0,0,0" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="中等"/>
</Border>
<Border x:Name="EraserSizeLarge" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="EraserSize_Large" Margin="8,0,0,0" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="较大"/>
</Border>
<Border x:Name="EraserSizeVeryLarge" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="EraserSize_VeryLarge" Margin="8,0,0,0" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="很大"/>
</Border>
</StackPanel>
</Grid>
</StackPanel>
</Border>
<!-- 墨迹显示设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="退出画板模式后隐藏墨迹" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=CanvasAndInkPanel__PPT_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchHideStrokeWhenSelecting" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="HideStrokeWhenSelecting" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 开启后,清空墨迹后将无法通过"撤销"功能恢复 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="清空墨迹时删除墨迹历史记录" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=CanvasAndInkPanel_quotquotHint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchClearCanvasAndClearTimeMachine" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="ClearCanvasAndClearTimeMachine" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 清空画布时同时删除所有插入的图片 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="清空画布时同时清空图片" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=CanvasAndInkPanel_Hint_3}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchClearCanvasAlsoClearImages" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="ClearCanvasAlsoClearImages" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 插入的图片大于1920x1080时自动压缩以节省内存 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="插入图片时自动压缩(大于1920x1080" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=CanvasAndInkPanel_1920x1080Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchCompressPicturesUploaded" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="CompressPicturesUploaded" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="白板展台按钮启动希沃视频展台" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="开启后,点击白板工具栏「展台」将打开希沃视频展台(需已安装);关闭则使用内置展台" HorizontalAlignment="Left" TextWrapping="Wrap" MaxWidth="420"/>
</StackPanel>
<Border x:Name="ToggleSwitchLaunchSeewoVideoShowcaseForWhiteboardBooth" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="LaunchSeewoVideoShowcaseForWhiteboardBooth" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- 形状和曲线设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<!-- Description = 绘制圆形时显示圆心标记 -->
<Grid Height="54">
<StackPanel Orientation="Horizontal" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="保留双曲线渐近线" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Border x:Name="HyperbolaAsymptoteYes" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="HyperbolaAsymptote_Yes" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="是"/>
</Border>
<Border x:Name="HyperbolaAsymptoteNo" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="HyperbolaAsymptote_No" Margin="8,0,0,0" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="否"/>
</Border>
<Border x:Name="HyperbolaAsymptoteAsk" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="HyperbolaAsymptote_Ask" Margin="8,0,0,0" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="每次询问"/>
</Border>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="绘制圆时显示圆心位置" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=CanvasAndInkPanel_Hint_4}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchShowCircleCenter" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="ShowCircleCenter" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 使用WPF内置的曲线平滑算法 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="使用WPF默认贝塞尔曲线平滑" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=CanvasAndInkPanel_WPFHint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchFitToCurve" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="FitToCurve" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 使用改进的贝塞尔曲线平滑算法,提供更好的绘制效果 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="使用高级曲线平滑(推荐)" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=CanvasAndInkPanel_Hint_5}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAdvancedBezierSmoothing" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="AdvancedBezierSmoothing" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- 墨迹渐隐设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<!-- Description = 开启后墨迹不会绘制到画布上,而是保持湿墨迹状态,根据设置的渐隐时间自动消失 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用墨迹渐隐功能" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=CanvasAndInkPanel_Hint_6}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableInkFade" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="EnableInkFade" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 设置墨迹从绘制到完全消失的时间 -->
<Grid Height="54" x:Name="InkFadeTimePanel" Visibility="Collapsed">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="墨迹渐隐时间" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=CanvasAndInkPanel_Hint_7}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="InkFadeTimeSlider" Width="150" Minimum="1000" Maximum="10000" Value="3000" TickFrequency="1000" IsSnapToTickEnabled="True" ValueChanged="InkFadeTimeSlider_ValueChanged"/>
<TextBlock x:Name="InkFadeTimeText" Text="3000ms" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 开启后,主工具栏上点击笔工具后弹出的上下文菜单中将不显示墨迹渐隐控制开关 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="在笔工具菜单中隐藏墨迹渐隐控制" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=CanvasAndInkPanel_Hint_8}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchHideInkFadeControlInPenMenu" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="HideInkFadeControlInPenMenu" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- 墨迹保存设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="墨迹保存设置" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<!-- Description = 开启后将在设定时间间隔自动保存墨迹,仅在画布可见且有墨迹时才会保存 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="定时自动保存墨迹" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=CanvasAndInkPanel_Hint_9}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableAutoSaveStrokes" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="EnableAutoSaveStrokes" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<StackPanel x:Name="AutoSaveIntervalPanel" Visibility="Collapsed">
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 开启后保存墨迹时将使用XML格式(ISF格式),便于查看和编辑墨迹数据 -->
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="保存间隔" HorizontalAlignment="Left" Margin="0,0,12,0"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" Margin="0,0,15,0">
<Border x:Name="AutoSaveStrokesInterval1MinBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="AutoSaveStrokesInterval_1" Margin="0,0,8,8" MouseLeftButtonDown="AutoSaveIntervalButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="1分钟"/>
</Border>
<Border x:Name="AutoSaveStrokesInterval3MinBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="AutoSaveStrokesInterval_3" Margin="0,0,8,8" MouseLeftButtonDown="AutoSaveIntervalButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="3分钟"/>
</Border>
<Border x:Name="AutoSaveStrokesInterval5MinBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="AutoSaveStrokesInterval_5" Margin="0,0,8,8" MouseLeftButtonDown="AutoSaveIntervalButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="5分钟"/>
</Border>
<Border x:Name="AutoSaveStrokesInterval10MinBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="AutoSaveStrokesInterval_10" Margin="0,0,8,8" MouseLeftButtonDown="AutoSaveIntervalButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="10分钟"/>
</Border>
<Border x:Name="AutoSaveStrokesInterval15MinBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="AutoSaveStrokesInterval_15" Margin="0,0,8,8" MouseLeftButtonDown="AutoSaveIntervalButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="15分钟"/>
</Border>
<Border x:Name="AutoSaveStrokesInterval30MinBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="AutoSaveStrokesInterval_30" Margin="0,0,8,8" MouseLeftButtonDown="AutoSaveIntervalButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="30分钟"/>
</Border>
<Border x:Name="AutoSaveStrokesInterval60MinBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="AutoSaveStrokesInterval_60" Margin="0,0,8,8" MouseLeftButtonDown="AutoSaveIntervalButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="60分钟"/>
</Border>
</WrapPanel>
</Grid>
</StackPanel>
<Grid MinHeight="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,8,0,8">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="墨迹全页面保存" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="开启后自动保存和手动保存墨迹时将以全屏模式保存。如果存在多个画布和墨迹,将把所有页面的墨迹按照每页为单位保存进一个压缩包中" HorizontalAlignment="Left" MaxWidth="450"/>
</StackPanel>
<Border x:Name="ToggleSwitchSaveFullPageStrokes" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Grid.Column="1" VerticalAlignment="Top" Margin="0,8,15,8" Tag="SaveFullPageStrokes" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="保存为XML格式" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=CanvasAndInkPanel_XMLISFHint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchSaveStrokesAsXML" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="SaveStrokesAsXML" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid MinHeight="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,8,0,8">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自动保存幻灯片墨迹" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="开启后将在结束幻灯片放映时自动保存已有墨迹,并在下次打开时自动加载(文件名和幻灯片页数都要相同)" HorizontalAlignment="Left" MaxWidth="450"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoSaveStrokesInPowerPoint" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Grid.Column="1" VerticalAlignment="Top" Margin="0,8,15,8" Tag="AutoSaveStrokesInPowerPoint" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,694 +0,0 @@
using iNKORE.UI.WPF.Helpers;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// CanvasAndInkPanel.xaml 的交互逻辑
/// </summary>
public partial class CanvasAndInkPanel : UserControl
{
private bool _isLoaded = false;
public CanvasAndInkPanel()
{
InitializeComponent();
Loaded += CanvasAndInkPanel_Loaded;
}
private void CanvasAndInkPanel_Loaded(object sender, RoutedEventArgs e)
{
LoadSettings();
// 添加触摸支持
EnableTouchSupport();
// 应用主题
ApplyTheme();
_isLoaded = true;
}
/// <summary>
/// 为面板中的所有交互控件启用触摸支持
/// </summary>
private void EnableTouchSupport()
{
try
{
// 延迟执行,确保所有控件都已加载
Dispatcher.BeginInvoke(new Action(() =>
{
MainWindowSettingsHelper.EnableTouchSupportForControls(this);
}), System.Windows.Threading.DispatcherPriority.Loaded);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"CanvasAndInkPanel 启用触摸支持时出错: {ex.Message}");
}
}
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());
}
}
/// <summary>
/// 加载设置到UI
/// </summary>
public void LoadSettings()
{
if (MainWindow.Settings == null || MainWindow.Settings.Canvas == null) return;
_isLoaded = false;
try
{
var canvas = MainWindow.Settings.Canvas;
// 显示画笔光标
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchShowCursor"), canvas.IsShowCursor);
// 启用压感触屏模式
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnablePressureTouchMode"), canvas.EnablePressureTouchMode);
// 屏蔽压感
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchDisablePressure"), canvas.DisablePressure);
// 板擦橡皮大小
SetOptionButtonState("EraserSize", canvas.EraserSize);
// 退出画板模式后隐藏墨迹
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchHideStrokeWhenSelecting"), canvas.HideStrokeWhenSelecting);
// 清空墨迹时删除墨迹历史记录
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchClearCanvasAndClearTimeMachine"), canvas.ClearCanvasAndClearTimeMachine);
// 清空画布时同时清空图片
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchClearCanvasAlsoClearImages"), canvas.ClearCanvasAlsoClearImages);
// 插入图片时自动压缩
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchCompressPicturesUploaded"), canvas.IsCompressPicturesUploaded);
// 白板展台按钮启动希沃视频展台
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchLaunchSeewoVideoShowcaseForWhiteboardBooth"), canvas.LaunchSeewoVideoShowcaseForWhiteboardBooth);
// 保留双曲线渐近线
SetOptionButtonState("HyperbolaAsymptote", (int)canvas.HyperbolaAsymptoteOption);
// 绘制圆时显示圆心位置
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchShowCircleCenter"), canvas.ShowCircleCenter);
// 使用WPF默认贝塞尔曲线平滑
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchFitToCurve"), canvas.FitToCurve && !canvas.UseAdvancedBezierSmoothing);
// 使用高级贝塞尔曲线平滑
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchAdvancedBezierSmoothing"), canvas.UseAdvancedBezierSmoothing);
// 启用异步墨迹平滑
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchUseAsyncInkSmoothing"), canvas.UseAsyncInkSmoothing);
// 启用硬件加速
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchUseHardwareAcceleration"), canvas.UseHardwareAcceleration);
// 启用直线自动拉直
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchAutoStraightenLine"), canvas.AutoStraightenLine);
// 启用高精度直线拉直
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchHighPrecisionLineStraighten"), canvas.HighPrecisionLineStraighten);
// 启用直线端点吸附
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchLineEndpointSnapping"), canvas.LineEndpointSnapping);
// 启用墨迹渐隐功能
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableInkFade"), canvas.EnableInkFade);
if (InkFadeTimePanel != null)
{
InkFadeTimePanel.Visibility = canvas.EnableInkFade ? Visibility.Visible : Visibility.Collapsed;
}
if (InkFadeTimeSlider != null)
{
InkFadeTimeSlider.Value = canvas.InkFadeTime;
}
// 定时自动保存墨迹
// 注意:这个设置可能在 Automation 或 Canvas 中,需要根据实际情况调整
// SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableAutoSaveStrokes"), ...);
// 墨迹全页面保存
// SetToggleSwitchState(FindToggleSwitch("ToggleSwitchSaveFullPageStrokes"), ...);
// 保存为XML格式
// SetToggleSwitchState(FindToggleSwitch("ToggleSwitchSaveStrokesAsXML"), ...);
// 自动保存幻灯片墨迹
if (MainWindow.Settings.PowerPointSettings != null)
{
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchAutoSaveStrokesInPowerPoint"),
MainWindow.Settings.PowerPointSettings.IsAutoSaveStrokesInPowerPoint);
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"加载画板和墨迹设置时出错: {ex.Message}");
}
_isLoaded = true;
}
/// <summary>
/// 查找ToggleSwitch控件
/// </summary>
private Border FindToggleSwitch(string name)
{
return this.FindDescendantByName(name) as Border;
}
/// <summary>
/// 设置ToggleSwitch状态
/// </summary>
private void SetToggleSwitchState(Border toggleSwitch, bool isOn)
{
if (toggleSwitch == null) return;
toggleSwitch.Background = isOn
? new SolidColorBrush(Color.FromRgb(53, 132, 228))
: (ThemeHelper.IsDarkTheme ? ThemeHelper.GetButtonBackgroundBrush() : new SolidColorBrush(Color.FromRgb(225, 225, 225)));
var innerBorder = toggleSwitch.Child as Border;
if (innerBorder != null)
{
innerBorder.HorizontalAlignment = isOn ? HorizontalAlignment.Right : HorizontalAlignment.Left;
innerBorder.Background = new SolidColorBrush(Colors.White);
}
}
/// <summary>
/// 设置选项按钮状态
/// </summary>
private void SetOptionButtonState(string group, int selectedIndex)
{
var buttons = new[] { "VerySmall", "Small", "Medium", "Large", "VeryLarge" };
var hyperbolaButtons = new[] { "Yes", "No", "Ask" };
string[] buttonNames = group == "EraserSize" ? buttons : hyperbolaButtons;
bool isDarkTheme = ThemeHelper.IsDarkTheme;
var selectedBrush = isDarkTheme ? new SolidColorBrush(Color.FromRgb(25, 25, 25)) : new SolidColorBrush(Color.FromRgb(225, 225, 225));
var unselectedBrush = new SolidColorBrush(Colors.Transparent);
for (int i = 0; i < buttonNames.Length && i <= selectedIndex; i++)
{
var button = this.FindDescendantByName($"{group}{buttonNames[i]}") as Border;
if (button != null)
{
if (i == selectedIndex)
{
button.Background = selectedBrush;
var textBlock = button.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Bold;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
else
{
button.Background = unselectedBrush;
var textBlock = button.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Normal;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
}
}
}
private bool GetCurrentSettingValue(string tag)
{
if (MainWindow.Settings?.Canvas == null) return false;
try
{
var canvas = MainWindow.Settings.Canvas;
switch (tag)
{
case "ShowCursor":
return canvas.IsShowCursor;
case "EnablePressureTouchMode":
return canvas.EnablePressureTouchMode;
case "DisablePressure":
return canvas.DisablePressure;
case "LaunchSeewoVideoShowcaseForWhiteboardBooth":
return canvas.LaunchSeewoVideoShowcaseForWhiteboardBooth;
case "HideStrokeWhenSelecting":
return canvas.HideStrokeWhenSelecting;
case "ClearCanvasAndClearTimeMachine":
return canvas.ClearCanvasAndClearTimeMachine;
case "ClearCanvasAlsoClearImages":
return canvas.ClearCanvasAlsoClearImages;
case "CompressPicturesUploaded":
return canvas.IsCompressPicturesUploaded;
case "ShowCircleCenter":
return canvas.ShowCircleCenter;
case "FitToCurve":
return canvas.FitToCurve && !canvas.UseAdvancedBezierSmoothing;
case "AdvancedBezierSmoothing":
return canvas.UseAdvancedBezierSmoothing;
case "UseAsyncInkSmoothing":
return canvas.UseAsyncInkSmoothing;
case "UseHardwareAcceleration":
return canvas.UseHardwareAcceleration;
case "AutoStraightenLine":
return canvas.AutoStraightenLine;
case "HighPrecisionLineStraighten":
return canvas.HighPrecisionLineStraighten;
case "LineEndpointSnapping":
return canvas.LineEndpointSnapping;
case "EnableInkFade":
return canvas.EnableInkFade;
case "HideInkFadeControlInPenMenu":
return canvas.HideInkFadeControlInPenMenu;
case "EnableAutoSaveStrokes":
return MainWindow.Settings.Automation?.IsEnableAutoSaveStrokes ?? false;
case "SaveFullPageStrokes":
return MainWindow.Settings.Automation?.IsSaveFullPageStrokes ?? false;
case "SaveStrokesAsXML":
return MainWindow.Settings.Automation?.IsSaveStrokesAsXML ?? false;
case "AutoSaveStrokesInPowerPoint":
return MainWindow.Settings.PowerPointSettings?.IsAutoSaveStrokesInPowerPoint ?? false;
default:
return false;
}
}
catch
{
return false;
}
}
/// <summary>
/// ToggleSwitch点击事件处理
/// </summary>
private void ToggleSwitch_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
string tag = border.Tag?.ToString();
if (string.IsNullOrEmpty(tag)) return;
bool currentState = GetCurrentSettingValue(tag);
bool newState = !currentState;
SetToggleSwitchState(border, newState);
var canvas = MainWindow.Settings.Canvas;
if (canvas == null) return;
switch (tag)
{
case "ShowCursor":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchShowCursor", newState);
break;
case "EnablePressureTouchMode":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnablePressureTouchMode", newState);
// 处理互斥逻辑
if (newState && canvas.DisablePressure)
{
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchDisablePressure", false);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchDisablePressure"), false);
}
break;
case "DisablePressure":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchDisablePressure", newState);
// 处理互斥逻辑
if (newState && canvas.EnablePressureTouchMode)
{
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnablePressureTouchMode", false);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnablePressureTouchMode"), false);
}
break;
case "LaunchSeewoVideoShowcaseForWhiteboardBooth":
MainWindowSettingsHelper.InvokeToggleSwitchToggled(
"ToggleSwitchLaunchSeewoVideoShowcaseForWhiteboardBooth", newState);
break;
case "HideStrokeWhenSelecting":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchHideStrokeWhenSelecting", newState);
break;
case "ClearCanvasAndClearTimeMachine":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchClearCanvasAndClearTimeMachine", newState);
break;
case "ClearCanvasAlsoClearImages":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchClearCanvasAlsoClearImages", newState);
break;
case "CompressPicturesUploaded":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchCompressPicturesUploaded", newState);
break;
case "ShowCircleCenter":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchShowCircleCenter", newState);
break;
case "FitToCurve":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchFitToCurve", newState);
// 处理互斥逻辑
if (newState)
{
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAdvancedBezierSmoothing", false);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchAdvancedBezierSmoothing"), false);
}
break;
case "AdvancedBezierSmoothing":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAdvancedBezierSmoothing", newState);
// 处理互斥逻辑
if (newState)
{
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchFitToCurve", false);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchFitToCurve"), false);
}
break;
case "UseAsyncInkSmoothing":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAsyncInkSmoothing", newState);
break;
case "UseHardwareAcceleration":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchHardwareAcceleration", newState);
break;
case "AutoStraightenLine":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAutoStraightenLine", newState);
break;
case "HighPrecisionLineStraighten":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchHighPrecisionLineStraighten", newState);
break;
case "LineEndpointSnapping":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchLineEndpointSnapping", newState);
break;
case "EnableInkFade":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableInkFade", newState);
// 更新UI状态
if (InkFadeTimePanel != null)
{
InkFadeTimePanel.Visibility = newState ? Visibility.Visible : Visibility.Collapsed;
}
break;
case "HideInkFadeControlInPenMenu":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchHideInkFadeControlInPenMenu", newState);
break;
case "EnableAutoSaveStrokes":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableAutoSaveStrokes", newState);
break;
case "SaveFullPageStrokes":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchSaveFullPageStrokes", newState);
break;
case "SaveStrokesAsXML":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchSaveStrokesAsXML", newState);
break;
case "AutoSaveStrokesInPowerPoint":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAutoSaveStrokesInPowerPoint", newState);
break;
}
}
/// <summary>
/// 选项按钮点击事件处理
/// </summary>
private void OptionButton_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
string tag = border.Tag?.ToString();
if (string.IsNullOrEmpty(tag)) return;
string[] parts = tag.Split('_');
if (parts.Length < 2) return;
string group = parts[0];
string value = parts[1];
bool isDarkTheme = ThemeHelper.IsDarkTheme;
var selectedBrush = isDarkTheme ? new SolidColorBrush(Color.FromRgb(25, 25, 25)) : new SolidColorBrush(Color.FromRgb(225, 225, 225));
var unselectedBrush = new SolidColorBrush(Colors.Transparent);
var parent = border.Parent as Panel;
if (parent != null)
{
foreach (var child in parent.Children)
{
if (child is Border childBorder && childBorder != border)
{
string childTag = childBorder.Tag?.ToString();
if (!string.IsNullOrEmpty(childTag) && childTag.StartsWith(group + "_"))
{
childBorder.Background = unselectedBrush;
var textBlock = childBorder.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Normal;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
}
}
}
border.Background = selectedBrush;
var currentTextBlock = border.Child as TextBlock;
if (currentTextBlock != null)
{
currentTextBlock.FontWeight = FontWeights.Bold;
currentTextBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
var canvas = MainWindow.Settings.Canvas;
if (canvas == null) return;
switch (group)
{
case "EraserSize":
int eraserSize;
switch (value)
{
case "VerySmall":
eraserSize = 0;
break;
case "Small":
eraserSize = 1;
break;
case "Medium":
eraserSize = 2;
break;
case "Large":
eraserSize = 3;
break;
case "VeryLarge":
eraserSize = 4;
break;
default:
eraserSize = 2;
break;
}
// 调用 MainWindow 中的方法
var mainWindow = Application.Current.MainWindow as MainWindow;
if (mainWindow != null)
{
var comboBox = mainWindow.FindName("ComboBoxEraserSize") as System.Windows.Controls.ComboBox;
if (comboBox != null && comboBox.Items.Count > eraserSize)
{
comboBox.SelectedIndex = eraserSize;
MainWindowSettingsHelper.InvokeComboBoxSelectionChanged("ComboBoxEraserSize", comboBox.Items[eraserSize]);
}
else
{
// 如果找不到控件,直接更新设置
MainWindowSettingsHelper.UpdateSettingDirectly(() =>
{
canvas.EraserSize = eraserSize;
}, "ComboBoxEraserSize");
}
}
break;
case "HyperbolaAsymptote":
OptionalOperation option;
switch (value)
{
case "Yes":
option = OptionalOperation.Yes;
break;
case "No":
option = OptionalOperation.No;
break;
case "Ask":
option = OptionalOperation.Ask;
break;
default:
option = OptionalOperation.Ask;
break;
}
// 调用 MainWindow 中的方法
var mainWindow2 = Application.Current.MainWindow as MainWindow;
if (mainWindow2 != null)
{
var comboBox = mainWindow2.FindName("ComboBoxHyperbolaAsymptoteOption") as System.Windows.Controls.ComboBox;
if (comboBox != null)
{
int optionIndex = (int)option;
if (comboBox.Items.Count > optionIndex)
{
comboBox.SelectedIndex = optionIndex;
MainWindowSettingsHelper.InvokeComboBoxSelectionChanged("ComboBoxHyperbolaAsymptoteOption", comboBox.Items[optionIndex]);
}
}
else
{
// 如果找不到控件,直接更新设置
MainWindowSettingsHelper.UpdateSettingDirectly(() =>
{
canvas.HyperbolaAsymptoteOption = option;
}, "ComboBoxHyperbolaAsymptoteOption");
}
}
break;
case "AutoSaveStrokesInterval":
// 调用 MainWindow 中的方法
int interval = int.Parse(value);
var mainWindow3 = Application.Current.MainWindow as MainWindow;
if (mainWindow3 != null)
{
var comboBox = mainWindow3.FindName("ComboBoxAutoSaveStrokesInterval") as System.Windows.Controls.ComboBox;
if (comboBox != null)
{
// 查找对应的选项(根据 Tag 或 Content 匹配)
foreach (System.Windows.Controls.ComboBoxItem item in comboBox.Items)
{
if (item.Tag != null && int.TryParse(item.Tag.ToString(), out int tagValue) && tagValue == interval)
{
comboBox.SelectedItem = item;
MainWindowSettingsHelper.InvokeComboBoxSelectionChanged("ComboBoxAutoSaveStrokesInterval", item);
break;
}
else if (item.Content != null && item.Content.ToString().Contains(interval.ToString()))
{
comboBox.SelectedItem = item;
MainWindowSettingsHelper.InvokeComboBoxSelectionChanged("ComboBoxAutoSaveStrokesInterval", item);
break;
}
}
}
else
{
// 如果找不到控件,直接更新设置
MainWindowSettingsHelper.UpdateSettingDirectly(() =>
{
if (MainWindow.Settings.Automation != null)
{
MainWindow.Settings.Automation.AutoSaveStrokesIntervalMinutes = interval;
}
}, "ComboBoxAutoSaveStrokesInterval");
}
}
break;
}
}
/// <summary>
/// 自动保存间隔选项按钮点击事件处理
/// </summary>
private void AutoSaveIntervalButton_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
OptionButton_Click(sender, e);
}
/// <summary>
/// Slider值变化事件处理
/// </summary>
private void InkFadeTimeSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
if (InkFadeTimeSlider != null && InkFadeTimeText != null)
{
double value = InkFadeTimeSlider.Value;
InkFadeTimeText.Text = $"{(int)value}ms";
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("InkFadeTimeSlider", value);
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
if (_isLoaded)
{
LoadSettings();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"CanvasAndInkPanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,136 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="ComboBoxStyle" TargetType="ComboBox">
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="#e6e6e6"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="13,7"/>
<Setter Property="FontFamily" Value="Microsoft YaHei UI"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Foreground" Value="#2e3436"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="MinHeight" Value="32"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<ToggleButton x:Name="ToggleButton"
Focusable="False"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
ClickMode="Press"
Background="Transparent"
BorderThickness="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<ToggleButton.Template>
<ControlTemplate TargetType="ToggleButton">
<Border Background="Transparent"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"/>
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>
<Border x:Name="Border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="8"
IsHitTestVisible="False">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ContentPresenter Grid.Column="0"
Margin="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"/>
<Path x:Name="Arrow" Grid.Column="1"
Data="M 0 0 L 5 5 L 10 0 Z"
Fill="#9a9996"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="0,0,12,0"
Width="10"
Height="5"
Stretch="Uniform"
IsHitTestVisible="False"/>
</Grid>
</Border>
<Popup x:Name="Popup"
Placement="Bottom"
PlacementTarget="{Binding ElementName=Border}"
AllowsTransparency="True"
PopupAnimation="Fade"
IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}"
StaysOpen="False">
<Border Background="White"
BorderBrush="#e6e6e6"
BorderThickness="1"
CornerRadius="8"
MaxHeight="300"
MinWidth="{Binding ActualWidth, ElementName=Border}">
<Border.Effect>
<DropShadowEffect BlurRadius="8" Direction="270" ShadowDepth="4" Color="Black" Opacity="0.15"/>
</Border.Effect>
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled"
Padding="4">
<ItemsPresenter/>
</ScrollViewer>
</Border>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Border" Property="BorderBrush" Value="#3584e4"/>
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter TargetName="Border" Property="BorderBrush" Value="#3584e4"/>
</Trigger>
<Trigger Property="IsDropDownOpen" Value="True">
<Setter TargetName="Arrow" Property="Data" Value="M 0 5 L 5 0 L 10 5 Z"/>
<Setter TargetName="Border" Property="BorderBrush" Value="#3584e4"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Border" Property="Opacity" Value="0.5"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ComboBoxItem样式 - 符合设置页面风格 -->
<Style x:Key="ComboBoxItemStyle" TargetType="ComboBoxItem">
<Setter Property="Background" Value="White"/>
<Setter Property="Foreground" Value="#2e3436"/>
<Setter Property="Padding" Value="13,8"/>
<Setter Property="FontFamily" Value="Microsoft YaHei UI"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="MinHeight" Value="36"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Border x:Name="Border"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}">
<ContentPresenter VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Border" Property="Background" Value="#f5f5f5"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="Background" Value="#e1e1e1"/>
<Setter Property="FontWeight" Value="Bold"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
@@ -1,37 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.CrashActionPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="ScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<Grid MinHeight="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,8,0,8">
<TextBlock Text="请选择软件发生未处理异常时的自动操作:" Foreground="#2e3436" FontSize="14.5" HorizontalAlignment="Left"/>
<TextBlock Text="静默重启:崩溃后自动重启软件,无提示。无操作:崩溃后仅记录日志,不自动重启。"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" HorizontalAlignment="Left" MaxWidth="450"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,8,15,8">
<Border x:Name="CrashActionSilentRestartBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="CrashAction_SilentRestart" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="静默重启软件"/>
</Border>
<Border x:Name="CrashActionNoActionBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="CrashAction_NoAction" Margin="0,0,8,8">
<TextBlock Foreground="#2e3436" FontSize="14" Text="无操作"/>
</Border>
</WrapPanel>
</Grid>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,49 +0,0 @@
using System;
using System.Windows;
using System.Windows.Controls;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// CrashActionPanel.xaml 的交互逻辑
/// </summary>
public partial class CrashActionPanel : UserControl
{
public CrashActionPanel()
{
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());
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"CrashActionPanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,98 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.FloatingBarDnDSettingsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:dd="urn:gong-wpf-dragdrop"
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="600">
<UserControl.Resources>
<DrawingImage x:Key="CursorIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M24,24z M0,0z M5.19409,16.3124C5.46422,18.0658 5.69121,19.539 5.8351,20.4621 5.9631,21.2477 6.80568,21.3359 7.22902,20.5643 7.93608,19.3044 9.20443,17.1009 10.0921,15.5636L14.9921,22.5615C15.1915,22.8462,15.5839,22.9154,15.8687,22.716L17.9309,21.272C18.2157,21.0727,18.2848,20.6802,18.0854,20.3955L13.5037,13.8522C15.6284,13.8519 18.6266,13.8518 20.2609,13.8524 21.1847,13.8201 21.258,12.9461 20.5777,12.4184 16.9666,9.91811 8.45126,4.12632 4.34164,1.42431 3.63839,0.928666 2.78717,1.12985 3.00557,2.27077 3.59731,5.94841 4.52718,11.9839 5.19409,16.3124z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="PenIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#222222" Geometry="F1 M24,24z M0,0z M20.4786,1.42438C19.9985,1.23743 19.4847,1.15194 18.9698,1.17319 18.4549,1.19444 17.9499,1.32197 17.4869,1.54789 17.0368,1.76752 16.6358,2.07554 16.3083,2.45361L3.85516,14.9067 9.08243,20.134 21.5311,7.68529C21.9113,7.36382 22.223,6.96912 22.447,6.52438 22.6786,6.06462 22.8113,5.56167 22.8365,5.04763 22.8616,4.5336 22.7787,4.02012 22.593,3.54002 22.4073,3.05994 22.1232,2.62403 21.759,2.25988 21.3949,1.89574 20.9587,1.61132 20.4786,1.42438z" />
<GeometryDrawing Brush="#222222" Geometry="F1 M24,24z M0,0z M7.28056,21.1605L2.8286,16.7086 1.15912,22.83 7.28056,21.1605z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="EraserIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#222222" Geometry="F1 M24,24z M0,0z M15.6314,20.7262L22.7921,13.5655C24.3494,12.141,24.2819,9.81776,22.8105,8.34633L16.7793,2.31508C15.3547,0.757753,13.0315,0.825236,11.5601,2.29666L4.38099,9.47574 15.6314,20.7262z" />
<GeometryDrawing Brush="#222222" Geometry="F1 M24,24z M0,0z M14.2172,22.1404L2.96677,10.89 1.20761,12.6491C-0.34971,14.0737,-0.281711,16.3974,1.18971,17.8688L6.15089,22.83 13.5276,22.83 14.2172,22.1404z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</UserControl.Resources>
<Grid>
<StackPanel Orientation="Vertical">
<Border Name="ToolbarItemsControl" Height="46" Background="#ebebeb" Margin="0,0,6,0">
<Grid Margin="4,0">
<ItemsControl ikw:DragDrop.IsDragSource="True"
ikw:DragDrop.IsDropTarget="True"
ikw:DragDrop.DragMouseAnchorPoint="0.5,0.5"
ikw:DragDrop.DropHandler="{Binding}"
ItemsSource="{Binding BarItems}">
<ikw:DragDrop.DragAdornerTemplate>
<DataTemplate>
<Border HorizontalAlignment="Center" CornerRadius="6" Background="#fafafa" BorderBrush="#a3a3a3" BorderThickness="1" Width="38" Height="38">
<Image Source="{Binding IconSource}" Width="20" Height="20"></Image>
</Border>
</DataTemplate>
</ikw:DragDrop.DragAdornerTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Background="Transparent" Orientation="Horizontal" Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Border},AncestorLevel=1},Path=ActualWidth}"></StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border HorizontalAlignment="Center" CornerRadius="6" Margin="4,0,0,0" Background="#fafafa" BorderBrush="#a3a3a3" BorderThickness="1" Width="38" Height="38">
<Image Source="{Binding IconSource}" Width="20" Height="20"></Image>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</Border>
<Border Name="ToolbarDrawerItemsControl" Height="46" Background="#ebebeb" Margin="0,0,6,0">
<Grid Margin="4,0">
<ItemsControl ikw:DragDrop.IsDragSource="True"
ikw:DragDrop.IsDropTarget="True"
ikw:DragDrop.DragMouseAnchorPoint="0,0"
ikw:DragDrop.DropHandler="{Binding}"
ItemsSource="{Binding BarDrawerItems}">
<ikw:DragDrop.DragAdornerTemplate>
<DataTemplate>
<Border HorizontalAlignment="Center" CornerRadius="6" Background="#fafafa" BorderBrush="#a3a3a3" BorderThickness="1" Width="38" Height="38">
<Image Source="{Binding IconSource}" Width="20" Height="20"></Image>
</Border>
</DataTemplate>
</ikw:DragDrop.DragAdornerTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Background="Transparent" Orientation="Horizontal" Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Border},AncestorLevel=1},Path=ActualWidth}" HorizontalAlignment="Center"></StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border HorizontalAlignment="Center" CornerRadius="6" Margin="4,0,0,0" Background="#fafafa" BorderBrush="#a3a3a3" BorderThickness="1" Width="38" Height="38">
<Image Source="{Binding IconSource}" Width="20" Height="20"/>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</Border>
</StackPanel>
</Grid>
</UserControl>
@@ -1,163 +0,0 @@
using iNKORE.UI.WPF.DragDrop;
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Ink_Canvas.Windows.SettingsViews
{
public class FloatingBarItem
{
public DrawingImage IconSource { get; set; }
}
public partial class FloatingBarDnDSettingsPanel : UserControl
{
public class BarItemsDropTarget : IDropTarget
{
public ObservableCollection<FloatingBarItem> BarItems { get; set; } =
new ObservableCollection<FloatingBarItem>();
void IDropTarget.DragOver(IDropInfo info)
{
info.Effects = DragDropEffects.Move;
info.DropTargetAdorner = DropTargetAdorners.Insert;
}
void IDropTarget.Drop(IDropInfo info)
{
if (info.Data is FloatingBarItem draggedItem)
{
var targetCollection = info.TargetCollection as ObservableCollection<FloatingBarItem>;
var sourceCollection = info.DragInfo.SourceCollection as ObservableCollection<FloatingBarItem>;
Trace.WriteLine(info.InsertIndex);
// 在同一个 ObservableCollection 中移动
if (targetCollection.Equals(sourceCollection))
{
if (info.InsertIndex == 0)
{
targetCollection.Move(targetCollection.IndexOf(info.Data as FloatingBarItem), 0);
}
else if (info.InsertIndex == targetCollection.Count)
{
targetCollection.Remove(info.Data as FloatingBarItem);
targetCollection.Add(info.Data as FloatingBarItem);
}
else if ((info.InsertIndex - targetCollection.IndexOf(info.Data as FloatingBarItem) == 1 &&
info.InsertPosition == RelativeInsertPosition.AfterTargetItem) ||
(info.InsertIndex - targetCollection.IndexOf(info.Data as FloatingBarItem) == 0 &&
info.InsertPosition == RelativeInsertPosition.BeforeTargetItem)) { }
else
{
targetCollection.Move(targetCollection.IndexOf(info.Data as FloatingBarItem), info.InsertIndex - 1);
}
}
else
{ // 跨 ObservableCollection 移动
sourceCollection.Remove(info.Data as FloatingBarItem);
targetCollection.Insert(info.InsertIndex, info.Data as FloatingBarItem);
}
}
}
void IDropTarget.DragEnter(IDropInfo info)
{
}
void IDropTarget.DragLeave(IDropInfo info)
{
}
}
public class BarDrawerItemsDropTarget : IDropTarget
{
public ObservableCollection<FloatingBarItem> BarDrawerItems { get; set; } =
new ObservableCollection<FloatingBarItem>();
void IDropTarget.DragOver(IDropInfo info)
{
info.Effects = DragDropEffects.Move;
info.DropTargetAdorner = DropTargetAdorners.Insert;
}
void IDropTarget.Drop(IDropInfo info)
{
if (info.Data is FloatingBarItem draggedItem)
{
var targetCollection = info.TargetCollection as ObservableCollection<FloatingBarItem>;
var sourceCollection = info.DragInfo.SourceCollection as ObservableCollection<FloatingBarItem>;
// 在同一个 ObservableCollection 中移动
if (targetCollection.Equals(sourceCollection))
{
targetCollection.Insert(info.InsertIndex, info.Data as FloatingBarItem);
}
else
{ // 跨 ObservableCollection 移动
sourceCollection.Remove(info.Data as FloatingBarItem);
targetCollection.Insert(info.InsertIndex, info.Data as FloatingBarItem);
}
}
}
void IDropTarget.DragEnter(IDropInfo info)
{
}
void IDropTarget.DragLeave(IDropInfo info)
{
}
}
public BarItemsDropTarget barItems { get; set; } = new BarItemsDropTarget();
public BarDrawerItemsDropTarget barDrawerItems { get; set; } = new BarDrawerItemsDropTarget();
public FloatingBarDnDSettingsPanel()
{
InitializeComponent();
ToolbarItemsControl.DataContext = barItems;
ToolbarDrawerItemsControl.DataContext = barDrawerItems;
barItems.BarItems.Add(new FloatingBarItem()
{
IconSource = FindResource("EraserIcon") as DrawingImage,
});
barDrawerItems.BarDrawerItems.Add(new FloatingBarItem()
{
IconSource = FindResource("CursorIcon") as DrawingImage,
});
barDrawerItems.BarDrawerItems.Add(new FloatingBarItem()
{
IconSource = FindResource("PenIcon") as DrawingImage,
});
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"FloatingBarDnDSettingsPanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,104 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.GesturesPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ComboBoxStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- 开关样式模板 -->
<Style x:Key="ToggleSwitchStyle" TargetType="Border">
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="25"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="3,0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,0,15,0"/>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="ScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<!-- 双指手势设置 -->
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<!-- Description = 开启后退出画板模式时自动关闭双指移动手势,进入白板模式时自动开启双指移动手势 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="进退白板模式自动开关双指移动功能" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=GesturesPanel_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoSwitchTwoFingerGesture" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="AutoSwitchTwoFingerGesture" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 允许选中墨迹后对墨迹进行双指或多指缩放操作 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="允许双指旋转与缩放选中的墨迹" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=GesturesPanel_Hint_1}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableTwoFingerRotationOnSelection" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="EnableTwoFingerRotationOnSelection" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- 手掌擦设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<!-- Description = 开启后,两个及以上触点且触摸面积较大时自动切换为橡皮擦,抬手后恢复原编辑模式 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用手掌擦" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=GesturesPanel_Hint_2}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnablePalmEraser" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="EnablePalmEraser" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<StackPanel Orientation="Vertical" x:Name="PalmEraserSensitivityPanel" Visibility="Collapsed" Margin="0,12,0,12">
<StackPanel Orientation="Vertical" Margin="18,0,0,0">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="手掌擦敏感度" HorizontalAlignment="Left" Margin="0,0,0,8"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,0,0,12" Text="低敏感度:需要更大的触摸面积和更多触摸点,减少误判;高敏感度:更容易触发手掌擦,但可能误判手指" HorizontalAlignment="Left" TextWrapping="Wrap"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" Margin="18,0,15,0">
<Border x:Name="PalmEraserSensitivityLowBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="PalmEraserSensitivity_Low" Margin="0,0,8,0" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="低敏感度"/>
</Border>
<Border x:Name="PalmEraserSensitivityMediumBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="PalmEraserSensitivity_Medium" Margin="0,0,8,0" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="中敏感度"/>
</Border>
<Border x:Name="PalmEraserSensitivityHighBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="PalmEraserSensitivity_High" Margin="0,0,0,0" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="高敏感度"/>
</Border>
</WrapPanel>
</StackPanel>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,364 +0,0 @@
using iNKORE.UI.WPF.Helpers;
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using Application = System.Windows.Application;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// GesturesPanel.xaml 的交互逻辑
/// </summary>
public partial class GesturesPanel : UserControl
{
private bool _isLoaded = false;
public GesturesPanel()
{
InitializeComponent();
Loaded += GesturesPanel_Loaded;
}
private void GesturesPanel_Loaded(object sender, RoutedEventArgs e)
{
LoadSettings();
// 添加触摸支持
EnableTouchSupport();
// 应用主题
ApplyTheme();
_isLoaded = true;
}
/// <summary>
/// 为面板中的所有交互控件启用触摸支持
/// </summary>
private void EnableTouchSupport()
{
try
{
// 延迟执行,确保所有控件都已加载
Dispatcher.BeginInvoke(new Action(() =>
{
MainWindowSettingsHelper.EnableTouchSupportForControls(this);
}), System.Windows.Threading.DispatcherPriority.Loaded);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"GesturesPanel 启用触摸支持时出错: {ex.Message}");
}
}
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());
}
}
/// <summary>
/// 加载设置到UI
/// </summary>
public void LoadSettings()
{
if (MainWindow.Settings == null) return;
_isLoaded = false;
try
{
// 进退白板模式自动开关双指移动功能
if (MainWindow.Settings.Gesture != null)
{
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchAutoSwitchTwoFingerGesture"), MainWindow.Settings.Gesture.AutoSwitchTwoFingerGesture);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableTwoFingerRotationOnSelection"), MainWindow.Settings.Gesture.IsEnableTwoFingerRotationOnSelection);
}
// 启用手掌擦
if (MainWindow.Settings.Canvas != null)
{
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnablePalmEraser"), MainWindow.Settings.Canvas.EnablePalmEraser);
if (PalmEraserSensitivityPanel != null)
{
PalmEraserSensitivityPanel.Visibility = MainWindow.Settings.Canvas.EnablePalmEraser ? Visibility.Visible : Visibility.Collapsed;
}
// 手掌擦敏感度
SetOptionButtonState("PalmEraserSensitivity", MainWindow.Settings.Canvas.PalmEraserSensitivity);
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"加载手势操作设置时出错: {ex.Message}");
}
_isLoaded = true;
}
/// <summary>
/// 查找ToggleSwitch控件
/// </summary>
private Border FindToggleSwitch(string name)
{
return this.FindDescendantByName(name) as Border;
}
/// <summary>
/// 设置ToggleSwitch状态
/// </summary>
private void SetToggleSwitchState(Border toggleSwitch, bool isOn)
{
if (toggleSwitch == null) return;
toggleSwitch.Background = isOn
? new SolidColorBrush(Color.FromRgb(53, 132, 228))
: (ThemeHelper.IsDarkTheme ? ThemeHelper.GetButtonBackgroundBrush() : new SolidColorBrush(Color.FromRgb(225, 225, 225)));
var innerBorder = toggleSwitch.Child as Border;
if (innerBorder != null)
{
innerBorder.HorizontalAlignment = isOn ? HorizontalAlignment.Right : HorizontalAlignment.Left;
innerBorder.Background = new SolidColorBrush(Colors.White);
}
}
/// <summary>
/// 设置选项按钮状态
/// </summary>
private void SetOptionButtonState(string group, int selectedIndex)
{
var buttons = new Dictionary<string, string[]>
{
{ "PalmEraserSensitivity", new[] { "Low", "Medium", "High" } }
};
if (!buttons.ContainsKey(group)) return;
string[] buttonNames = buttons[group];
bool isDarkTheme = ThemeHelper.IsDarkTheme;
var selectedBrush = isDarkTheme ? new SolidColorBrush(Color.FromRgb(25, 25, 25)) : new SolidColorBrush(Color.FromRgb(225, 225, 225));
var unselectedBrush = new SolidColorBrush(Colors.Transparent);
for (int i = 0; i < buttonNames.Length; i++)
{
var button = this.FindDescendantByName($"{group}{buttonNames[i]}Border") as Border;
if (button != null)
{
if (i == selectedIndex)
{
button.Background = selectedBrush;
var textBlock = button.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Bold;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
else
{
button.Background = unselectedBrush;
var textBlock = button.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Normal;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
}
}
}
private bool GetCurrentSettingValue(string tag)
{
if (MainWindow.Settings == null) return false;
try
{
switch (tag)
{
case "AutoSwitchTwoFingerGesture":
return MainWindow.Settings.Gesture?.AutoSwitchTwoFingerGesture ?? false;
case "EnableTwoFingerRotationOnSelection":
return MainWindow.Settings.Gesture?.IsEnableTwoFingerRotationOnSelection ?? false;
case "EnablePalmEraser":
return MainWindow.Settings.Canvas?.EnablePalmEraser ?? false;
default:
return false;
}
}
catch
{
return false;
}
}
/// <summary>
/// ToggleSwitch点击事件处理
/// </summary>
private void ToggleSwitch_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
string tag = border.Tag?.ToString();
if (string.IsNullOrEmpty(tag)) return;
bool currentState = GetCurrentSettingValue(tag);
bool newState = !currentState;
SetToggleSwitchState(border, newState);
switch (tag)
{
case "AutoSwitchTwoFingerGesture":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAutoSwitchTwoFingerGesture", newState);
break;
case "EnableTwoFingerRotationOnSelection":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableTwoFingerRotationOnSelection", newState);
break;
case "EnablePalmEraser":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnablePalmEraser", newState);
// 更新UI状态
if (PalmEraserSensitivityPanel != null)
{
PalmEraserSensitivityPanel.Visibility = newState ? Visibility.Visible : Visibility.Collapsed;
}
break;
}
}
/// <summary>
/// 选项按钮点击事件处理
/// </summary>
private void OptionButton_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
string tag = border.Tag?.ToString();
if (string.IsNullOrEmpty(tag)) return;
string[] parts = tag.Split('_');
if (parts.Length < 2) return;
string group = parts[0];
string value = parts[1];
bool isDarkTheme = ThemeHelper.IsDarkTheme;
var selectedBrush = isDarkTheme ? new SolidColorBrush(Color.FromRgb(25, 25, 25)) : new SolidColorBrush(Color.FromRgb(225, 225, 225));
var unselectedBrush = new SolidColorBrush(Colors.Transparent);
var parent = border.Parent as Panel;
if (parent != null)
{
foreach (var child in parent.Children)
{
if (child is Border childBorder && childBorder != border)
{
string childTag = childBorder.Tag?.ToString();
if (!string.IsNullOrEmpty(childTag) && childTag.StartsWith(group + "_"))
{
childBorder.Background = unselectedBrush;
var textBlock = childBorder.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Normal;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
}
}
}
border.Background = selectedBrush;
var currentTextBlock = border.Child as TextBlock;
if (currentTextBlock != null)
{
currentTextBlock.FontWeight = FontWeights.Bold;
currentTextBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
switch (group)
{
case "PalmEraserSensitivity":
int sensitivity;
switch (value)
{
case "Low":
sensitivity = 0;
break;
case "Medium":
sensitivity = 1;
break;
case "High":
sensitivity = 2;
break;
default:
sensitivity = 0;
break;
}
// 调用 MainWindow 中的方法(通过设置 ComboBox 的 SelectedIndex
var mainWindow = Application.Current.MainWindow as MainWindow;
if (mainWindow != null)
{
var comboBox = mainWindow.FindName("ComboBoxPalmEraserSensitivity") as System.Windows.Controls.ComboBox;
if (comboBox != null && comboBox.Items.Count > sensitivity)
{
comboBox.SelectedIndex = sensitivity;
// 触发 SelectionChanged 事件
MainWindowSettingsHelper.InvokeComboBoxSelectionChanged("ComboBoxPalmEraserSensitivity", comboBox.Items[sensitivity]);
}
else
{
// 如果找不到控件,直接更新设置
MainWindowSettingsHelper.UpdateSettingDirectly(() =>
{
if (MainWindow.Settings.Canvas != null)
{
MainWindow.Settings.Canvas.PalmEraserSensitivity = sensitivity;
}
}, "ComboBoxPalmEraserSensitivity");
}
}
break;
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
if (_isLoaded)
{
LoadSettings();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"GesturesPanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,200 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.InkRecognitionPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<UserControl.Resources>
<!-- 开关样式模板 -->
<Style x:Key="ToggleSwitchStyle" TargetType="Border">
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="25"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="3,0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,0,15,0"/>
</Style>
</UserControl.Resources>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="ScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<!-- 墨迹识别主开关 -->
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<!-- Description = 自动将手绘图形识别并转换为标准形状 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用墨迹识别" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=InkRecognitionPanel_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableInkToShape" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- 形状识别选项 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8" x:Name="InkRecognitionOptionsPanel">
<StackPanel Orientation="Vertical">
<!-- Description = 矫正后的矩形不包含模拟压感信息 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="阻止矫正后的矩形带有模拟压感值" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=InkRecognitionPanel_Hint_1}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableInkToShapeNoFakePressureRectangle" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 矫正后的三角形不包含模拟压感信息 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="阻止矫正后的三角形带有模拟压感值" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=InkRecognitionPanel_Hint_2}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableInkToShapeNoFakePressureTriangle" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 当绘制的直线超过设定长度阈值时,将自动调整为完美直线 -->
<Grid Height="54">
<StackPanel Orientation="Horizontal" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<CheckBox x:Name="ToggleCheckboxEnableInkToShapeTriangle" IsChecked="True">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="矫正手绘三角形" VerticalAlignment="Center"/>
</CheckBox>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<CheckBox x:Name="ToggleCheckboxEnableInkToShapeRectangle" IsChecked="True">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="矫正手绘矩形" VerticalAlignment="Center"/>
</CheckBox>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<CheckBox x:Name="ToggleCheckboxEnableInkToShapeRounded" IsChecked="True">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="矫正手绘圆形与椭圆" VerticalAlignment="Center"/>
</CheckBox>
</StackPanel>
</Grid>
</StackPanel>
</Border>
<!-- 直线识别设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="直线自动拉直" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=InkRecognitionPanel_Hint_3}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoStraightenLine" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid MinHeight="54" x:Name="AutoStraightenLineSettingsPanel">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="18,8,0,8">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="长度阈值" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="设置直线自动拉直的最小长度" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="AutoStraightenLineThresholdSlider" Width="150" Minimum="30" Maximum="300" Value="80" TickFrequency="30" IsSnapToTickEnabled="True"/>
<TextBlock x:Name="AutoStraightenLineThresholdText" Text="80" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid MinHeight="54" x:Name="LineStraightenSensitivityPanel">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="18,8,0,8">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="灵敏度" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="越小要求越严格,越弯曲的线条越不容易被拉直;值越大越容易识别为直线" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="LineStraightenSensitivitySlider" Width="150" Minimum="0.05" Maximum="2.0" Value="0.20" TickFrequency="0.05" IsSnapToTickEnabled="True"/>
<TextBlock x:Name="LineStraightenSensitivityText" Text="0.20" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 高精度模式下,每隔10像素取一个计数点,获取更准确的平均值用于判断 -->
<Grid Height="54" x:Name="HighPrecisionLineStraightenPanel">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="高精度直线拉直" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=InkRecognitionPanel_10Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchHighPrecisionLineStraighten" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 当绘制的直线端点靠近其他直线端点时,将自动吸附连接 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="直线端点吸附" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=InkRecognitionPanel_Hint_4}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchLineEndpointSnapping" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid MinHeight="54" x:Name="LineEndpointSnappingThresholdPanel">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="18,8,0,8">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="吸附距离" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="设置直线端点自动吸附的最大距离" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="LineEndpointSnappingThresholdSlider" Width="150" Minimum="5" Maximum="50" Value="15" TickFrequency="5" IsSnapToTickEnabled="True"/>
<TextBlock x:Name="LineEndpointSnappingThresholdText" Text="15" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,49 +0,0 @@
using System;
using System.Windows;
using System.Windows.Controls;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// InkRecognitionPanel.xaml 的交互逻辑
/// </summary>
public partial class InkRecognitionPanel : UserControl
{
public InkRecognitionPanel()
{
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());
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"InkRecognitionPanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,231 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.LuckyRandomPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ComboBoxStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- 开关样式模板 -->
<Style x:Key="ToggleSwitchStyle" TargetType="Border">
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="25"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="3,0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,0,15,0"/>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="ScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<!-- 基本设置 -->
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<!-- Description = 在随机点名窗口中显示修改名单的按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示修改随机点名名单的按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=LuckyRandomPanel_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchDisplayRandWindowNamesInputBtn" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="DisplayRandWindowNamesInputBtn" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在随机点名窗口中显示随机抽和单次抽按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用随机抽和单次抽按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=LuckyRandomPanel_Hint_1}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchShowRandomAndSingleDraw" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="ShowRandomAndSingleDraw" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 启用快速抽人的悬浮按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用快抽悬浮按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=LuckyRandomPanel_Hint_2}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableQuickDraw" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="EnableQuickDraw" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 使用外部点名工具代替内置点名功能 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="直接调用外部点名" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=LuckyRandomPanel_Hint_3}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchExternalCaller" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="ExternalCaller" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Vertical" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,8,0,12">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="点名类型" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="选择外部点名工具的类型" HorizontalAlignment="Left"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" Margin="0,0,0,8">
<Border x:Name="ExternalCallerTypeClassIslandBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="ExternalCallerType_ClassIsland" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="ClassIsland点名"/>
</Border>
<Border x:Name="ExternalCallerTypeSecRandomBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="ExternalCallerType_SecRandom" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="SecRandom点名"/>
</Border>
<Border x:Name="ExternalCallerTypeNamePickerBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="ExternalCallerType_NamePicker" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="NamePicker点名"/>
</Border>
</WrapPanel>
</StackPanel>
</StackPanel>
</Border>
<!-- 窗口设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<!-- Description = 设置单次抽人窗口自动关闭的延迟时间 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="单次抽人窗口关闭延迟" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=LuckyRandomPanel_Hint_4}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="RandWindowOnceCloseLatencySlider" Width="150" Minimum="0.5" Maximum="8" Value="2.5" TickFrequency="0.1" IsSnapToTickEnabled="True" ValueChanged="RandWindowOnceCloseLatencySlider_ValueChanged"/>
<TextBlock x:Name="RandWindowOnceCloseLatencyText" Text="2.5s" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 设置单次随机点名最多抽取的人数 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="单次随机点名人数上限" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=LuckyRandomPanel_Hint_5}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="RandWindowOnceMaxStudentsSlider" Width="150" Minimum="0" Maximum="20" Value="10" TickFrequency="1" IsSnapToTickEnabled="True" ValueChanged="RandWindowOnceMaxStudentsSlider_ValueChanged"/>
<TextBlock x:Name="RandWindowOnceMaxStudentsText" Text="10" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
</StackPanel>
</Border>
<!-- 新点名UI设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="新点名UI设置" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<!-- Description = 使用新的点名界面设计 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用新点名UI" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=LuckyRandomPanel_Hint_6}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchUseNewRollCallUI" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="UseNewRollCallUI" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 使用机器学习算法避免重复抽取相同的人 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用机器学习避免重复" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=LuckyRandomPanel_Hint_7}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableMLAvoidance" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="EnableMLAvoidance" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 设置用于避免重复的历史记录数量 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="避免重复历史记录数量" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=LuckyRandomPanel_Hint_8}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="MLAvoidanceHistorySlider" Width="150" Minimum="5" Maximum="50" Value="50" TickFrequency="5" IsSnapToTickEnabled="True" ValueChanged="MLAvoidanceHistorySlider_ValueChanged"/>
<TextBlock x:Name="MLAvoidanceHistoryText" Text="50" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 设置机器学习算法避免重复的权重 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="避免重复权重" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=LuckyRandomPanel_Hint_9}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="MLAvoidanceWeightSlider" Width="150" Minimum="0.1" Maximum="1.0" Value="1.0" TickFrequency="0.1" IsSnapToTickEnabled="True" ValueChanged="MLAvoidanceWeightSlider_ValueChanged"/>
<TextBlock x:Name="MLAvoidanceWeightText" Text="100%" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436" FontFamily="Consolas"/>
</StackPanel>
</Grid>
<TextBlock Text="机器学习算法会分析最近的点名历史,智能避免重复选择相同人员"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,8,0,0"/>
</StackPanel>
</Border>
<!-- 背景设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="点名窗口背景设置(仅老版点名UI有效)" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<StackPanel Margin="18,8,18,8">
<StackPanel Orientation="Vertical" Margin="0,0,0,12">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="背景选择" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=LuckyRandomPanel_Hint_10}" HorizontalAlignment="Left"/>
</StackPanel>
<WrapPanel Orientation="Horizontal">
<Border x:Name="PickNameBackgroundDefaultBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="PickNameBackground_Default" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="默认背景"/>
</Border>
</WrapPanel>
</StackPanel>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自定义背景" HorizontalAlignment="Left" Margin="0,0,12,0"/>
<Button x:Name="ButtonAddCustomBackground" Content="上传" Padding="10,3"/>
<Button x:Name="ButtonManageBackgrounds" Content="管理" Padding="10,3" Margin="5,0,0,0"/>
</StackPanel>
</Grid>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,489 +0,0 @@
using iNKORE.UI.WPF.Helpers;
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using Application = System.Windows.Application;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// LuckyRandomPanel.xaml 的交互逻辑
/// </summary>
public partial class LuckyRandomPanel : UserControl
{
private bool _isLoaded = false;
public LuckyRandomPanel()
{
InitializeComponent();
Loaded += LuckyRandomPanel_Loaded;
}
private void LuckyRandomPanel_Loaded(object sender, RoutedEventArgs e)
{
LoadSettings();
// 添加触摸支持
EnableTouchSupport();
// 应用主题
ApplyTheme();
_isLoaded = true;
}
/// <summary>
/// 为面板中的所有交互控件启用触摸支持
/// </summary>
private void EnableTouchSupport()
{
try
{
// 延迟执行,确保所有控件都已加载
Dispatcher.BeginInvoke(new Action(() =>
{
MainWindowSettingsHelper.EnableTouchSupportForControls(this);
}), System.Windows.Threading.DispatcherPriority.Loaded);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"LuckyRandomPanel 启用触摸支持时出错: {ex.Message}");
}
}
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());
}
}
/// <summary>
/// 加载设置到UI
/// </summary>
public void LoadSettings()
{
if (MainWindow.Settings == null || MainWindow.Settings.RandSettings == null) return;
_isLoaded = false;
try
{
var randSettings = MainWindow.Settings.RandSettings;
// 显示修改随机点名名单的按钮
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchDisplayRandWindowNamesInputBtn"), randSettings.DisplayRandWindowNamesInputBtn);
// 启用随机抽和单次抽按钮
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchShowRandomAndSingleDraw"), randSettings.ShowRandomAndSingleDraw);
// 启用快抽悬浮按钮
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableQuickDraw"), randSettings.EnableQuickDraw);
// 直接调用外部点名
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchExternalCaller"), randSettings.DirectCallCiRand);
// 点名类型
SetOptionButtonState("ExternalCallerType", randSettings.ExternalCallerType);
// 单次抽人窗口关闭延迟
if (RandWindowOnceCloseLatencySlider != null)
{
RandWindowOnceCloseLatencySlider.Value = randSettings.RandWindowOnceCloseLatency;
if (RandWindowOnceCloseLatencyText != null)
{
RandWindowOnceCloseLatencyText.Text = $"{randSettings.RandWindowOnceCloseLatency:F1}s";
}
}
// 单次随机点名人数上限
if (RandWindowOnceMaxStudentsSlider != null)
{
RandWindowOnceMaxStudentsSlider.Value = randSettings.RandWindowOnceMaxStudents;
if (RandWindowOnceMaxStudentsText != null)
{
RandWindowOnceMaxStudentsText.Text = randSettings.RandWindowOnceMaxStudents.ToString();
}
}
// 启用新点名UI
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchUseNewRollCallUI"), randSettings.UseNewRollCallUI);
// 启用机器学习避免重复
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableMLAvoidance"), randSettings.EnableMLAvoidance);
// 避免重复历史记录数量
if (MLAvoidanceHistorySlider != null)
{
MLAvoidanceHistorySlider.Value = randSettings.MLAvoidanceHistoryCount;
if (MLAvoidanceHistoryText != null)
{
MLAvoidanceHistoryText.Text = randSettings.MLAvoidanceHistoryCount.ToString();
}
}
// 避免重复权重
if (MLAvoidanceWeightSlider != null)
{
MLAvoidanceWeightSlider.Value = randSettings.MLAvoidanceWeight;
if (MLAvoidanceWeightText != null)
{
MLAvoidanceWeightText.Text = $"{(randSettings.MLAvoidanceWeight * 100):F0}%";
}
}
// 背景选择
SetOptionButtonState("PickNameBackground", randSettings.SelectedBackgroundIndex);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"加载幸运随机设置时出错: {ex.Message}");
}
_isLoaded = true;
}
/// <summary>
/// 查找ToggleSwitch控件
/// </summary>
private Border FindToggleSwitch(string name)
{
return this.FindDescendantByName(name) as Border;
}
/// <summary>
/// 设置ToggleSwitch状态
/// </summary>
private void SetToggleSwitchState(Border toggleSwitch, bool isOn)
{
if (toggleSwitch == null) return;
toggleSwitch.Background = isOn
? new SolidColorBrush(Color.FromRgb(53, 132, 228))
: (ThemeHelper.IsDarkTheme ? ThemeHelper.GetButtonBackgroundBrush() : new SolidColorBrush(Color.FromRgb(225, 225, 225)));
var innerBorder = toggleSwitch.Child as Border;
if (innerBorder != null)
{
innerBorder.HorizontalAlignment = isOn ? HorizontalAlignment.Right : HorizontalAlignment.Left;
innerBorder.Background = new SolidColorBrush(Colors.White);
}
}
/// <summary>
/// 设置选项按钮状态
/// </summary>
private void SetOptionButtonState(string group, int selectedIndex)
{
var buttons = new Dictionary<string, string[]>
{
{ "ExternalCallerType", new[] { "ClassIsland", "SecRandom", "NamePicker" } },
{ "PickNameBackground", new[] { "Default" } }
};
if (!buttons.ContainsKey(group)) return;
string[] buttonNames = buttons[group];
bool isDarkTheme = ThemeHelper.IsDarkTheme;
var selectedBrush = isDarkTheme ? new SolidColorBrush(Color.FromRgb(25, 25, 25)) : new SolidColorBrush(Color.FromRgb(225, 225, 225));
var unselectedBrush = new SolidColorBrush(Colors.Transparent);
for (int i = 0; i < buttonNames.Length; i++)
{
var button = this.FindDescendantByName($"{group}{buttonNames[i]}Border") as Border;
if (button != null)
{
if (i == selectedIndex)
{
button.Background = selectedBrush;
var textBlock = button.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Bold;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
else
{
button.Background = unselectedBrush;
var textBlock = button.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Normal;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
}
}
}
private bool GetCurrentSettingValue(string tag)
{
if (MainWindow.Settings?.RandSettings == null) return false;
try
{
var randSettings = MainWindow.Settings.RandSettings;
switch (tag)
{
case "DisplayRandWindowNamesInputBtn":
return randSettings.DisplayRandWindowNamesInputBtn;
case "ShowRandomAndSingleDraw":
return randSettings.ShowRandomAndSingleDraw;
case "EnableQuickDraw":
return randSettings.EnableQuickDraw;
case "ExternalCaller":
return randSettings.DirectCallCiRand;
case "UseNewRollCallUI":
return randSettings.UseNewRollCallUI;
case "EnableMLAvoidance":
return randSettings.EnableMLAvoidance;
default:
return false;
}
}
catch
{
return false;
}
}
/// <summary>
/// ToggleSwitch点击事件处理
/// </summary>
private void ToggleSwitch_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
string tag = border.Tag?.ToString();
if (string.IsNullOrEmpty(tag)) return;
bool currentState = GetCurrentSettingValue(tag);
bool newState = !currentState;
SetToggleSwitchState(border, newState);
var randSettings = MainWindow.Settings.RandSettings;
if (randSettings == null) return;
switch (tag)
{
case "DisplayRandWindowNamesInputBtn":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchDisplayRandWindowNamesInputBtn", newState);
break;
case "ShowRandomAndSingleDraw":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchShowRandomAndSingleDraw", newState);
break;
case "EnableQuickDraw":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableQuickDraw", newState);
break;
case "ExternalCaller":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchExternalCaller", newState);
break;
case "UseNewRollCallUI":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchUseNewRollCallUI", newState);
break;
case "EnableMLAvoidance":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableMLAvoidance", newState);
break;
}
}
/// <summary>
/// 选项按钮点击事件处理
/// </summary>
private void OptionButton_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
string tag = border.Tag?.ToString();
if (string.IsNullOrEmpty(tag)) return;
string[] parts = tag.Split('_');
if (parts.Length < 2) return;
string group = parts[0];
string value = parts[1];
bool isDarkTheme = ThemeHelper.IsDarkTheme;
var selectedBrush = isDarkTheme ? new SolidColorBrush(Color.FromRgb(25, 25, 25)) : new SolidColorBrush(Color.FromRgb(225, 225, 225));
var unselectedBrush = new SolidColorBrush(Colors.Transparent);
var parent = border.Parent as Panel;
if (parent != null)
{
foreach (var child in parent.Children)
{
if (child is Border childBorder && childBorder != border)
{
string childTag = childBorder.Tag?.ToString();
if (!string.IsNullOrEmpty(childTag) && childTag.StartsWith(group + "_"))
{
childBorder.Background = unselectedBrush;
var textBlock = childBorder.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Normal;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
}
}
}
border.Background = selectedBrush;
var currentTextBlock = border.Child as TextBlock;
if (currentTextBlock != null)
{
currentTextBlock.FontWeight = FontWeights.Bold;
currentTextBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
var randSettings = MainWindow.Settings.RandSettings;
if (randSettings == null) return;
switch (group)
{
case "ExternalCallerType":
int callerType;
switch (value)
{
case "ClassIsland":
callerType = 0;
break;
case "SecRandom":
callerType = 1;
break;
case "NamePicker":
callerType = 2;
break;
default:
callerType = 0;
break;
}
// 调用 MainWindow 中的方法
var mainWindow = Application.Current.MainWindow as MainWindow;
if (mainWindow != null)
{
var comboBox = mainWindow.FindName("ComboBoxExternalCallerType") as System.Windows.Controls.ComboBox;
if (comboBox != null && comboBox.Items.Count > callerType)
{
comboBox.SelectedIndex = callerType;
MainWindowSettingsHelper.InvokeComboBoxSelectionChanged("ComboBoxExternalCallerType", comboBox.Items[callerType]);
}
else
{
// 如果找不到控件,直接更新设置
MainWindowSettingsHelper.UpdateSettingDirectly(() =>
{
randSettings.ExternalCallerType = callerType;
}, "ComboBoxExternalCallerType");
}
}
break;
case "PickNameBackground":
// 背景选择逻辑 - 这个设置可能没有对应的方法,直接更新
MainWindowSettingsHelper.UpdateSettingDirectly(() =>
{
randSettings.SelectedBackgroundIndex = 0; // 默认背景
}, "PickNameBackground");
break;
}
}
/// <summary>
/// Slider值变化事件处理
/// </summary>
private void RandWindowOnceCloseLatencySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
if (RandWindowOnceCloseLatencySlider != null && RandWindowOnceCloseLatencyText != null)
{
double value = RandWindowOnceCloseLatencySlider.Value;
RandWindowOnceCloseLatencyText.Text = $"{value:F1}s";
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("RandWindowOnceCloseLatencySlider", value);
}
}
private void RandWindowOnceMaxStudentsSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
if (RandWindowOnceMaxStudentsSlider != null && RandWindowOnceMaxStudentsText != null)
{
double value = RandWindowOnceMaxStudentsSlider.Value;
RandWindowOnceMaxStudentsText.Text = ((int)value).ToString();
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("RandWindowOnceMaxStudentsSlider", value);
}
}
private void MLAvoidanceHistorySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
if (MLAvoidanceHistorySlider != null && MLAvoidanceHistoryText != null)
{
double value = MLAvoidanceHistorySlider.Value;
MLAvoidanceHistoryText.Text = ((int)value).ToString();
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("MLAvoidanceHistorySlider", value);
}
}
private void MLAvoidanceWeightSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
if (MLAvoidanceWeightSlider != null && MLAvoidanceWeightText != null)
{
double value = MLAvoidanceWeightSlider.Value;
MLAvoidanceWeightText.Text = $"{(value * 100):F0}%";
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("MLAvoidanceWeightSlider", value);
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
if (_isLoaded)
{
LoadSettings();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"LuckyRandomPanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,600 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.PowerPointPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ComboBoxStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- 开关样式模板 -->
<Style x:Key="ToggleSwitchStyle" TargetType="Border">
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="25"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="3,0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,0,15,0"/>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="ScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<!-- PPT联动设置 -->
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="此部分的设置项将会在幻灯片播放时使用,优先级高于其他设置项"
Foreground="#9a9996" FontSize="11" Margin="0,0,0,12"/>
<!-- Description = 在PPT放映模式下显示翻页控制按钮 -->
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/Powerpoint.png" Margin="0,0,6,0" Width="28" Height="28" VerticalAlignment="Center"/>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="Microsoft PowerPoint 支持" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchSupportPowerPoint" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="SupportPowerPoint" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/Powerpoint.png" Margin="0,0,6,0" Width="28" Height="28" VerticalAlignment="Center"/>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="PowerPoint 联动增强" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchPowerPointEnhancement" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="PowerPointEnhancement" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/WPS.png" Margin="0,0,6,0" Width="28" Height="28" VerticalAlignment="Center"/>
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="WPS 支持" VerticalAlignment="Center"/>
</StackPanel>
<Border x:Name="ToggleSwitchSupportWPS" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="SupportWPS" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="WPP进程查杀(防止WPP残留进程)" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="关闭后将不会自动查杀WPP残留进程,可能导致WPP关闭卡顿或无法彻底退出" HorizontalAlignment="Left" MaxWidth="450"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableWppProcessKill" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="EnableWppProcessKill" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border BorderBrush="#ef4444" BorderThickness="2" Padding="8" CornerRadius="6" Background="#991b1b" Margin="0,12,0,0">
<StackPanel Orientation="Horizontal">
<Image Width="20" Height="20">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="White"
Geometry="F0 M24,24z M0,0z M10.478,6.91759C10.478,6.07778 11.1588,5.39697 11.9986,5.39697 12.8385,5.39697 13.5193,6.07778 13.5193,6.91759L13.5193,12.0001C13.5193,12.8399 12.8385,13.5207 11.9986,13.5207 11.1588,13.5207 10.478,12.8399 10.478,12.0001L10.478,6.91759z M10.478,17.0826C10.478,16.2427,11.1588,15.5619,11.9986,15.5619L12.0114,15.5619C12.8512,15.5619 13.532,16.2427 13.532,17.0826 13.532,17.9224 12.8512,18.6032 12.0114,18.6032L11.9986,18.6032C11.1588,18.6032,10.478,17.9224,10.478,17.0826z M12,0.75C5.7868,0.75 0.75,5.7868 0.75,12 0.75,18.2132 5.7868,23.25 12,23.25 18.2132,23.25 23.25,18.2132 23.25,12 23.25,5.7868 18.2132,0.75 12,0.75z M3.25,12C3.25,7.16751 7.16751,3.25 12,3.25 16.8325,3.25 20.75,7.16751 20.75,12 20.75,16.8325 16.8325,20.75 12,20.75 7.16751,20.75 3.25,16.8325 3.25,12z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Margin="8,0,0,0" FontSize="13" VerticalAlignment="Center" Foreground="White"
Text="开启WPS支持后会导致WPS关闭时卡顿!"/>
</StackPanel>
</Border>
<TextBlock Text="如果您只使用PowerPoint请不要打开WPS联动开关,如果使用WPS建议不要使用PowerPoint"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,8,0,0"/>
<TextBlock Text="可支持 WPS,但目前无法同时支持 MSOffice 和 WPS。若要启用WPS支持,请确保 WPS 是否在 &quot;配置工具&quot; 中开启了 &quot;WPS Office 兼容第三方系统和软件&quot; 选项,否则将无法识别到WPS"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,8,0,0"/>
</StackPanel>
</Border>
<!-- PPT翻页按钮设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="PPT翻页按钮" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<Border ClipToBounds="True" Width="324" Height="182" Margin="0,0,0,12">
<Grid>
<Image Source="Resources/PresentationExample/page.jpg" Width="324" Height="182" Stretch="Fill"/>
<Image x:Name="PPTBtnPreviewToolbar" Source="Resources/PresentationExample/toolbar.png" Height="16"
VerticalAlignment="Bottom" HorizontalAlignment="Center" Stretch="Uniform"/>
<Image x:Name="PPTBtnPreviewLS" Source="Resources/PresentationExample/sidebar-white.png" Width="10" Height="30"
VerticalAlignment="Center" HorizontalAlignment="Left" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
<Image.RenderTransform>
<TransformGroup>
<TranslateTransform x:Name="PPTBtnPreviewLSTransform"/>
</TransformGroup>
</Image.RenderTransform>
</Image>
<Image x:Name="PPTBtnPreviewRS" Source="Resources/PresentationExample/sidebar-white.png" Width="10" Height="30"
VerticalAlignment="Center" HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
<Image.RenderTransform>
<TransformGroup>
<TranslateTransform x:Name="PPTBtnPreviewRSTransform"/>
</TransformGroup>
</Image.RenderTransform>
</Image>
<Image x:Name="PPTBtnPreviewLB" Source="Resources/PresentationExample/bottombar-white.png" Height="10" Width="30"
VerticalAlignment="Bottom" HorizontalAlignment="Left" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
<Image.RenderTransform>
<TransformGroup>
<TranslateTransform x:Name="PPTBtnPreviewLBTransform"/>
</TransformGroup>
</Image.RenderTransform>
</Image>
<Image x:Name="PPTBtnPreviewRB" Source="Resources/PresentationExample/bottombar-white.png" Height="10" Width="30"
VerticalAlignment="Bottom" HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
<Image.RenderTransform>
<TransformGroup>
<TranslateTransform x:Name="PPTBtnPreviewRBTransform"/>
</TransformGroup>
</Image.RenderTransform>
</Image>
</Grid>
</Border>
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="在 PPT 模式下显示翻页按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_PPTHint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchShowPPTButton" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="ShowPPTButton" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<StackPanel x:Name="PPTButtonSettingsPanel" Margin="0,12,0,0" Visibility="Visible">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,0,0,12">
<CheckBox x:Name="CheckboxEnableLBPPTButton" IsChecked="True" Content="左下" Margin="0,0,16,0" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
<CheckBox x:Name="CheckboxEnableRBPPTButton" IsChecked="True" Content="右下" Margin="0,0,16,0" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
<CheckBox x:Name="CheckboxEnableLSPPTButton" IsChecked="True" Content="左侧" Margin="0,0,16,0" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
<CheckBox x:Name="CheckboxEnableRSPPTButton" IsChecked="True" Content="右侧" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
</StackPanel>
<!-- Description = 调大往上偏移,调小往下偏移,修改为0为不偏移,居中放置 -->
<Grid Height="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="左侧偏移" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_0Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Grid Grid.Column="1" VerticalAlignment="Center" Margin="0,0,15,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<Slider x:Name="PPTButtonLeftPositionValueSlider" Grid.Column="0" Minimum="-500" Maximum="500" Value="0" TickFrequency="1" IsSnapToTickEnabled="True" ValueChanged="PPTButtonPositionSlider_ValueChanged"/>
<TextBlock x:Name="PPTButtonLeftPositionValueText" Grid.Column="1" Text="0" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436" TextAlignment="Left"/>
</Grid>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 调大往右偏移,调小往左偏移,修改为0为不偏移,居中放置 -->
<Grid Height="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="右侧偏移" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_0Hint_1}" HorizontalAlignment="Left"/>
</StackPanel>
<Grid Grid.Column="1" VerticalAlignment="Center" Margin="0,0,15,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<Slider x:Name="PPTButtonRightPositionValueSlider" Grid.Column="0" Minimum="-500" Maximum="500" Value="0" TickFrequency="1" IsSnapToTickEnabled="True" ValueChanged="PPTButtonPositionSlider_ValueChanged"/>
<TextBlock x:Name="PPTButtonRightPositionValueText" Grid.Column="1" Text="0" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436" TextAlignment="Left"/>
</Grid>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 调整左下按钮的位置 -->
<Grid Height="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="左下偏移" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Grid Grid.Column="1" VerticalAlignment="Center" Margin="0,0,15,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<Slider x:Name="PPTButtonLBPositionValueSlider" Grid.Column="0" Minimum="-500" Maximum="500" Value="0" TickFrequency="1" IsSnapToTickEnabled="True" ValueChanged="PPTButtonPositionSlider_ValueChanged"/>
<TextBlock x:Name="PPTButtonLBPositionValueText" Grid.Column="1" Text="0" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436" TextAlignment="Left"/>
</Grid>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 调整右下按钮的位置 -->
<Grid Height="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="右下偏移" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_Hint_1}" HorizontalAlignment="Left"/>
</StackPanel>
<Grid Grid.Column="1" VerticalAlignment="Center" Margin="0,0,15,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<Slider x:Name="PPTButtonRBPositionValueSlider" Grid.Column="0" Minimum="-500" Maximum="500" Value="0" TickFrequency="1" IsSnapToTickEnabled="True" ValueChanged="PPTButtonPositionSlider_ValueChanged"/>
<TextBlock x:Name="PPTButtonRBPositionValueText" Grid.Column="1" Text="0" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436" TextAlignment="Left"/>
</Grid>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<TextBlock Text="两侧按钮设置" FontWeight="Bold" Foreground="#2e3436" FontSize="16" Margin="0,0,0,8"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,0,0,8">
<CheckBox x:Name="CheckboxSPPTDisplayPage" IsChecked="True" Content="显示页码" Margin="0,0,16,0" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
<CheckBox x:Name="CheckboxSPPTHalfOpacity" IsChecked="True" Content="半透明" Margin="0,0,16,0" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
<CheckBox x:Name="CheckboxSPPTBlackBackground" IsChecked="True" Content="黑色背景" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
</StackPanel>
<StackPanel x:Name="PPTLSButtonOpacityPanel" Margin="0,8,0,8" Visibility="Visible">
<!-- Description = 调整左侧翻页按钮的透明度 -->
<Grid Height="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="左侧按钮透明度" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_Hint_2}" HorizontalAlignment="Left"/>
</StackPanel>
<Grid Grid.Column="1" VerticalAlignment="Center" Margin="0,0,15,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<Slider x:Name="PPTLSButtonOpacityValueSlider" Grid.Column="0" Minimum="0.1" Maximum="1.0" Value="0.5" TickFrequency="0.1" IsSnapToTickEnabled="True" ValueChanged="PPTButtonOpacitySlider_ValueChanged"/>
<TextBlock x:Name="PPTLSButtonOpacityValueText" Grid.Column="1" Text="0.5" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436" TextAlignment="Left"/>
</Grid>
</Grid>
</StackPanel>
<StackPanel x:Name="PPTRSButtonOpacityPanel" Margin="0,8,0,8" Visibility="Visible">
<!-- Description = 调整右侧翻页按钮的透明度 -->
<Grid Height="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="右侧按钮透明度" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_Hint_3}" HorizontalAlignment="Left"/>
</StackPanel>
<Grid Grid.Column="1" VerticalAlignment="Center" Margin="0,0,15,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<Slider x:Name="PPTRSButtonOpacityValueSlider" Grid.Column="0" Minimum="0.1" Maximum="1.0" Value="0.5" TickFrequency="0.1" IsSnapToTickEnabled="True" ValueChanged="PPTButtonOpacitySlider_ValueChanged"/>
<TextBlock x:Name="PPTRSButtonOpacityValueText" Grid.Column="1" Text="0.5" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436" TextAlignment="Left"/>
</Grid>
</Grid>
</StackPanel>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<TextBlock Text="左下右下按钮设置" FontWeight="Bold" Foreground="#2e3436" FontSize="16" Margin="0,0,0,8"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,0,0,8">
<CheckBox x:Name="CheckboxBPPTDisplayPage" IsChecked="True" Content="显示页码" Margin="0,0,16,0" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
<CheckBox x:Name="CheckboxBPPTHalfOpacity" IsChecked="True" Content="半透明" Margin="0,0,16,0" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
<CheckBox x:Name="CheckboxBPPTBlackBackground" IsChecked="True" Content="黑色背景" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
</StackPanel>
<StackPanel x:Name="PPTLBButtonOpacityPanel" Margin="0,8,0,8" Visibility="Visible">
<!-- Description = 调整左下翻页按钮的透明度 -->
<Grid Height="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="左下按钮透明度" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_Hint_4}" HorizontalAlignment="Left"/>
</StackPanel>
<Grid Grid.Column="1" VerticalAlignment="Center" Margin="0,0,15,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<Slider x:Name="PPTLBButtonOpacityValueSlider" Grid.Column="0" Minimum="0.1" Maximum="1.0" Value="0.5" TickFrequency="0.1" IsSnapToTickEnabled="True" ValueChanged="PPTButtonOpacitySlider_ValueChanged"/>
<TextBlock x:Name="PPTLBButtonOpacityValueText" Grid.Column="1" Text="0.5" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436" TextAlignment="Left"/>
</Grid>
</Grid>
</StackPanel>
<StackPanel x:Name="PPTRBButtonOpacityPanel" Margin="0,8,0,8" Visibility="Visible">
<!-- Description = 调整右下翻页按钮的透明度 -->
<Grid Height="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="右下按钮透明度" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_Hint_5}" HorizontalAlignment="Left"/>
</StackPanel>
<Grid Grid.Column="1" VerticalAlignment="Center" Margin="0,0,15,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="50"/>
</Grid.ColumnDefinitions>
<Slider x:Name="PPTRBButtonOpacityValueSlider" Grid.Column="0" Minimum="0.1" Maximum="1.0" Value="0.5" TickFrequency="0.1" IsSnapToTickEnabled="True" ValueChanged="PPTButtonOpacitySlider_ValueChanged"/>
<TextBlock x:Name="PPTRBButtonOpacityValueText" Grid.Column="1" Text="0.5" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436" TextAlignment="Left"/>
</Grid>
</Grid>
</StackPanel>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid MinHeight="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0" Margin="0,8,0,8">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="PPT 页码按钮可点击" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="开启后,点击页码按钮可以唤起PowerPoint自带的网格缩略图视图。WPS不支持该功能" HorizontalAlignment="Left" MaxWidth="450"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnablePPTButtonPageClickable" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Grid.Column="1" VerticalAlignment="Top" Margin="0,8,0,0" Tag="EnablePPTButtonPageClickable" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid MinHeight="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0" Margin="0,8,0,8">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="PPT 翻页按钮长按翻页" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="开启后,长按PPT翻页按钮可以连续翻页,提高翻页效率" HorizontalAlignment="Left" MaxWidth="450"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnablePPTButtonLongPressPageTurn" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Grid.Column="1" VerticalAlignment="Top" Margin="0,8,0,0" Tag="EnablePPTButtonLongPressPageTurn" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid MinHeight="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0" Margin="0,8,0,8">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="点击翻页时跳过转场动画,直接切到下一张" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="开启后,点击下一页按钮时会跳过幻灯片之间的转场动画,直接跳转到下一张幻灯片。不会影响幻灯片内的元素动画" HorizontalAlignment="Left" MaxWidth="450"/>
</StackPanel>
<Border x:Name="ToggleSwitchSkipAnimationsWhenGoNext" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Grid.Column="1" VerticalAlignment="Top" Margin="0,8,0,0" Tag="SkipAnimationsWhenGoNext" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</StackPanel>
</Border>
<!-- PPT放映模式设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<!-- Description = 进入PPT放映时自动切换到批注模式 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="进入 PPT 放映时自动进入批注模式" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_PPTHint_1}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchShowCanvasAtNewSlideShow" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="ShowCanvasAtNewSlideShow" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border BorderBrush="#ef4444" BorderThickness="2" Padding="8" CornerRadius="6" Background="#991b1b" Margin="0,8,0,0">
<StackPanel Orientation="Horizontal">
<Image Width="20" Height="20">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="White"
Geometry="F0 M24,24z M0,0z M10.478,6.91759C10.478,6.07778 11.1588,5.39697 11.9986,5.39697 12.8385,5.39697 13.5193,6.07778 13.5193,6.91759L13.5193,12.0001C13.5193,12.8399 12.8385,13.5207 11.9986,13.5207 11.1588,13.5207 10.478,12.8399 10.478,12.0001L10.478,6.91759z M10.478,17.0826C10.478,16.2427,11.1588,15.5619,11.9986,15.5619L12.0114,15.5619C12.8512,15.5619 13.532,16.2427 13.532,17.0826 13.532,17.9224 12.8512,18.6032 12.0114,18.6032L11.9986,18.6032C11.1588,18.6032,10.478,17.9224,10.478,17.0826z M12,0.75C5.7868,0.75 0.75,5.7868 0.75,12 0.75,18.2132 5.7868,23.25 12,23.25 18.2132,23.25 23.25,18.2132 23.25,12 23.25,5.7868 18.2132,0.75 12,0.75z M3.25,12C3.25,7.16751 7.16751,3.25 12,3.25 16.8325,3.25 20.75,7.16751 20.75,12 20.75,16.8325 16.8325,20.75 12,20.75 7.16751,20.75 3.25,16.8325 3.25,12z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Margin="8,0,0,0" FontSize="13" VerticalAlignment="Center" Foreground="White"
Text="该项与&quot;自动化&quot;中的&quot;播放PPT时自动收纳&quot;选项冲突!"/>
</StackPanel>
</Border>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在幻灯片模式下允许使用双指手势 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="允许幻灯片模式下的双指手势" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_Hint_6}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableTwoFingerGestureInPresentationMode" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="EnableTwoFingerGestureInPresentationMode" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 开启后在 PPT 放映模式下也显示手势按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="允许使用手指手势进行幻灯片翻页" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="在幻灯片放映模式下,当画板无墨迹时,使用手指左右滑动即可控制幻灯片翻页" HorizontalAlignment="Left" MaxWidth="450"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableFingerGestureSlideShowControl" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="EnableFingerGestureSlideShowControl" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="PPT 放映模式显示手势按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel__PPT_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchShowGestureButtonInSlideShow" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="ShowGestureButtonInSlideShow" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- PPT时间胶囊设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<!-- Description = 选择时间胶囊在屏幕上的显示位置 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="PPT时间显示胶囊" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="开启后在 PPT 放映模式下显示时间胶囊,可替代最小化计时器窗口" HorizontalAlignment="Left" MaxWidth="450"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnablePPTTimeCapsule" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="EnablePPTTimeCapsule" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="时间胶囊位置" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_Hint_7}" HorizontalAlignment="Left"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Border x:Name="PPTTimeCapsulePositionTopLeftBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="PPTTimeCapsulePosition_TopLeft" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="左上角"/>
</Border>
<Border x:Name="PPTTimeCapsulePositionTopRightBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="PPTTimeCapsulePosition_TopRight" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="右上角"/>
</Border>
<Border x:Name="PPTTimeCapsulePositionTopCenterBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="PPTTimeCapsulePosition_TopCenter" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="顶部居中"/>
</Border>
</WrapPanel>
</Grid>
</StackPanel>
</Border>
<!-- PPT提示设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<!-- Description = 开启后会记录上次播放的页数,点击"是"后会自动跳转 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="记忆并提示上次播放位置" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_quotquotHint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchNotifyPreviousPage" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="NotifyPreviousPage" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 进入PPT放映时自动跳转到第一页 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="进入放映时回到首页" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_PPTHint_2}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAlwaysGoToFirstPageOnReenter" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="AlwaysGoToFirstPageOnReenter" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在播放隐藏幻灯片时显示提示 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="提示隐藏幻灯片" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_Hint_8}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchNotifyHiddenPage" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="NotifyHiddenPage" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在PPT自动播放时显示提示 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="提示是否已启用自动播放" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=PowerPointPanel_PPTHint_3}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchNotifyAutoPlayPresentation" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="NotifyAutoPlayPresentation" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,714 +0,0 @@
using iNKORE.UI.WPF.Helpers;
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// PowerPointPanel.xaml 的交互逻辑
/// </summary>
public partial class PowerPointPanel : UserControl
{
private bool _isLoaded = false;
public PowerPointPanel()
{
InitializeComponent();
Loaded += PowerPointPanel_Loaded;
}
private void PowerPointPanel_Loaded(object sender, RoutedEventArgs e)
{
LoadSettings();
// 添加触摸支持
EnableTouchSupport();
// 应用主题
ApplyTheme();
_isLoaded = true;
}
/// <summary>
/// 为面板中的所有交互控件启用触摸支持
/// </summary>
private void EnableTouchSupport()
{
try
{
// 延迟执行,确保所有控件都已加载
Dispatcher.BeginInvoke(new Action(() =>
{
MainWindowSettingsHelper.EnableTouchSupportForControls(this);
}), System.Windows.Threading.DispatcherPriority.Loaded);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"PowerPointPanel 启用触摸支持时出错: {ex.Message}");
}
}
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());
}
}
/// <summary>
/// 加载设置到UI
/// </summary>
public void LoadSettings()
{
if (MainWindow.Settings == null || MainWindow.Settings.PowerPointSettings == null) return;
_isLoaded = false;
try
{
var pptSettings = MainWindow.Settings.PowerPointSettings;
// Microsoft PowerPoint 支持
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchSupportPowerPoint"), pptSettings.PowerPointSupport);
// PowerPoint 联动增强
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchPowerPointEnhancement"), pptSettings.EnablePowerPointEnhancement);
// WPS 支持
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchSupportWPS"), pptSettings.IsSupportWPS);
// WPP进程查杀
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableWppProcessKill"), pptSettings.EnableWppProcessKill);
// 在 PPT 模式下显示翻页按钮
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchShowPPTButton"), pptSettings.ShowPPTButton);
if (PPTButtonSettingsPanel != null)
{
PPTButtonSettingsPanel.Visibility = pptSettings.ShowPPTButton ? Visibility.Visible : Visibility.Collapsed;
}
// PPT按钮显示选项
var dops = pptSettings.PPTButtonsDisplayOption.ToString();
var dopsc = dops.ToCharArray();
if (dopsc.Length >= 4)
{
if (CheckboxEnableLBPPTButton != null) CheckboxEnableLBPPTButton.IsChecked = dopsc[0] == '2';
if (CheckboxEnableRBPPTButton != null) CheckboxEnableRBPPTButton.IsChecked = dopsc[1] == '2';
if (CheckboxEnableLSPPTButton != null) CheckboxEnableLSPPTButton.IsChecked = dopsc[2] == '2';
if (CheckboxEnableRSPPTButton != null) CheckboxEnableRSPPTButton.IsChecked = dopsc[3] == '2';
}
// 按钮位置
if (PPTButtonLeftPositionValueSlider != null)
{
PPTButtonLeftPositionValueSlider.Value = pptSettings.PPTLSButtonPosition;
if (PPTButtonLeftPositionValueText != null)
{
PPTButtonLeftPositionValueText.Text = pptSettings.PPTLSButtonPosition.ToString();
}
}
if (PPTButtonRightPositionValueSlider != null)
{
PPTButtonRightPositionValueSlider.Value = pptSettings.PPTRSButtonPosition;
if (PPTButtonRightPositionValueText != null)
{
PPTButtonRightPositionValueText.Text = pptSettings.PPTRSButtonPosition.ToString();
}
}
if (PPTButtonLBPositionValueSlider != null)
{
PPTButtonLBPositionValueSlider.Value = pptSettings.PPTLBButtonPosition;
if (PPTButtonLBPositionValueText != null)
{
PPTButtonLBPositionValueText.Text = pptSettings.PPTLBButtonPosition.ToString();
}
}
if (PPTButtonRBPositionValueSlider != null)
{
PPTButtonRBPositionValueSlider.Value = pptSettings.PPTRBButtonPosition;
if (PPTButtonRBPositionValueText != null)
{
PPTButtonRBPositionValueText.Text = pptSettings.PPTRBButtonPosition.ToString();
}
}
// 两侧按钮选项
var sops = pptSettings.PPTSButtonsOption.ToString();
var sopsc = sops.ToCharArray();
if (sopsc.Length >= 3)
{
if (CheckboxSPPTDisplayPage != null) CheckboxSPPTDisplayPage.IsChecked = sopsc[0] == '2';
if (CheckboxSPPTHalfOpacity != null) CheckboxSPPTHalfOpacity.IsChecked = sopsc[1] == '2';
if (CheckboxSPPTBlackBackground != null) CheckboxSPPTBlackBackground.IsChecked = sopsc[2] == '2';
}
// 左下右下按钮选项
var bops = pptSettings.PPTBButtonsOption.ToString();
var bopsc = bops.ToCharArray();
if (bopsc.Length >= 3)
{
if (CheckboxBPPTDisplayPage != null) CheckboxBPPTDisplayPage.IsChecked = bopsc[0] == '2';
if (CheckboxBPPTHalfOpacity != null) CheckboxBPPTHalfOpacity.IsChecked = bopsc[1] == '2';
if (CheckboxBPPTBlackBackground != null) CheckboxBPPTBlackBackground.IsChecked = bopsc[2] == '2';
}
// 按钮透明度
if (PPTLSButtonOpacityValueSlider != null)
{
PPTLSButtonOpacityValueSlider.Value = pptSettings.PPTLSButtonOpacity > 0 ? pptSettings.PPTLSButtonOpacity : 0.5;
if (PPTLSButtonOpacityValueText != null)
{
PPTLSButtonOpacityValueText.Text = PPTLSButtonOpacityValueSlider.Value.ToString("F1");
}
}
if (PPTRSButtonOpacityValueSlider != null)
{
PPTRSButtonOpacityValueSlider.Value = pptSettings.PPTRSButtonOpacity > 0 ? pptSettings.PPTRSButtonOpacity : 0.5;
if (PPTRSButtonOpacityValueText != null)
{
PPTRSButtonOpacityValueText.Text = PPTRSButtonOpacityValueSlider.Value.ToString("F1");
}
}
if (PPTLBButtonOpacityValueSlider != null)
{
PPTLBButtonOpacityValueSlider.Value = pptSettings.PPTLBButtonOpacity > 0 ? pptSettings.PPTLBButtonOpacity : 0.5;
if (PPTLBButtonOpacityValueText != null)
{
PPTLBButtonOpacityValueText.Text = PPTLBButtonOpacityValueSlider.Value.ToString("F1");
}
}
if (PPTRBButtonOpacityValueSlider != null)
{
PPTRBButtonOpacityValueSlider.Value = pptSettings.PPTRBButtonOpacity > 0 ? pptSettings.PPTRBButtonOpacity : 0.5;
if (PPTRBButtonOpacityValueText != null)
{
PPTRBButtonOpacityValueText.Text = PPTRBButtonOpacityValueSlider.Value.ToString("F1");
}
}
// PPT 页码按钮可点击
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnablePPTButtonPageClickable"), pptSettings.EnablePPTButtonPageClickable);
// PPT 翻页按钮长按翻页
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnablePPTButtonLongPressPageTurn"), pptSettings.EnablePPTButtonLongPressPageTurn);
// 点击翻页时跳过转场动画
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchSkipAnimationsWhenGoNext"), pptSettings.SkipAnimationsWhenGoNext);
// 进入 PPT 放映时自动进入批注模式
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchShowCanvasAtNewSlideShow"), pptSettings.IsShowCanvasAtNewSlideShow);
// 允许幻灯片模式下的双指手势
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableTwoFingerGestureInPresentationMode"), pptSettings.IsEnableTwoFingerGestureInPresentationMode);
// 允许使用手指手势进行幻灯片翻页
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableFingerGestureSlideShowControl"), pptSettings.IsEnableFingerGestureSlideShowControl);
// PPT 放映模式显示手势按钮
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchShowGestureButtonInSlideShow"), pptSettings.ShowGestureButtonInSlideShow);
// PPT时间显示胶囊
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnablePPTTimeCapsule"), pptSettings.EnablePPTTimeCapsule);
// 时间胶囊位置
SetOptionButtonState("PPTTimeCapsulePosition", pptSettings.PPTTimeCapsulePosition);
// 记忆并提示上次播放位置
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchNotifyPreviousPage"), pptSettings.IsNotifyPreviousPage);
// 进入放映时回到首页
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchAlwaysGoToFirstPageOnReenter"), pptSettings.IsAlwaysGoToFirstPageOnReenter);
// 提示隐藏幻灯片
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchNotifyHiddenPage"), pptSettings.IsNotifyHiddenPage);
// 提示是否已启用自动播放
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchNotifyAutoPlayPresentation"), pptSettings.IsNotifyAutoPlayPresentation);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"加载PowerPoint设置时出错: {ex.Message}");
}
_isLoaded = true;
}
/// <summary>
/// 查找ToggleSwitch控件
/// </summary>
private Border FindToggleSwitch(string name)
{
return this.FindDescendantByName(name) as Border;
}
/// <summary>
/// 设置ToggleSwitch状态
/// </summary>
private void SetToggleSwitchState(Border toggleSwitch, bool isOn)
{
if (toggleSwitch == null) return;
toggleSwitch.Background = isOn
? new SolidColorBrush(Color.FromRgb(53, 132, 228))
: (ThemeHelper.IsDarkTheme ? ThemeHelper.GetButtonBackgroundBrush() : new SolidColorBrush(Color.FromRgb(225, 225, 225)));
var innerBorder = toggleSwitch.Child as Border;
if (innerBorder != null)
{
innerBorder.HorizontalAlignment = isOn ? HorizontalAlignment.Right : HorizontalAlignment.Left;
innerBorder.Background = new SolidColorBrush(Colors.White);
}
}
/// <summary>
/// 设置选项按钮状态
/// </summary>
private void SetOptionButtonState(string group, int selectedIndex)
{
var buttons = new Dictionary<string, string[]>
{
{ "PPTTimeCapsulePosition", new[] { "TopLeft", "TopRight", "TopCenter" } }
};
if (!buttons.ContainsKey(group)) return;
string[] buttonNames = buttons[group];
bool isDarkTheme = ThemeHelper.IsDarkTheme;
var selectedBrush = isDarkTheme ? new SolidColorBrush(Color.FromRgb(25, 25, 25)) : new SolidColorBrush(Color.FromRgb(225, 225, 225));
var unselectedBrush = new SolidColorBrush(Colors.Transparent);
for (int i = 0; i < buttonNames.Length; i++)
{
var button = this.FindDescendantByName($"{group}{buttonNames[i]}Border") as Border;
if (button != null)
{
if (i == selectedIndex)
{
button.Background = selectedBrush;
var textBlock = button.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Bold;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
else
{
button.Background = unselectedBrush;
var textBlock = button.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Normal;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
}
}
}
private bool GetCurrentSettingValue(string tag)
{
if (MainWindow.Settings?.PowerPointSettings == null) return false;
try
{
var pptSettings = MainWindow.Settings.PowerPointSettings;
switch (tag)
{
case "SupportPowerPoint":
return pptSettings.PowerPointSupport;
case "PowerPointEnhancement":
return pptSettings.EnablePowerPointEnhancement;
case "SupportWPS":
return pptSettings.IsSupportWPS;
case "EnableWppProcessKill":
return pptSettings.EnableWppProcessKill;
case "ShowPPTButton":
return pptSettings.ShowPPTButton;
case "EnablePPTButtonPageClickable":
return pptSettings.EnablePPTButtonPageClickable;
case "EnablePPTButtonLongPressPageTurn":
return pptSettings.EnablePPTButtonLongPressPageTurn;
case "SkipAnimationsWhenGoNext":
return pptSettings.SkipAnimationsWhenGoNext;
case "ShowCanvasAtNewSlideShow":
return pptSettings.IsShowCanvasAtNewSlideShow;
case "EnableTwoFingerGestureInPresentationMode":
return pptSettings.IsEnableTwoFingerGestureInPresentationMode;
case "EnableFingerGestureSlideShowControl":
return pptSettings.IsEnableFingerGestureSlideShowControl;
case "ShowGestureButtonInSlideShow":
return pptSettings.ShowGestureButtonInSlideShow;
case "EnablePPTTimeCapsule":
return pptSettings.EnablePPTTimeCapsule;
case "NotifyPreviousPage":
return pptSettings.IsNotifyPreviousPage;
case "AlwaysGoToFirstPageOnReenter":
return pptSettings.IsAlwaysGoToFirstPageOnReenter;
case "NotifyHiddenPage":
return pptSettings.IsNotifyHiddenPage;
case "NotifyAutoPlayPresentation":
return pptSettings.IsNotifyAutoPlayPresentation;
default:
return false;
}
}
catch
{
return false;
}
}
/// <summary>
/// ToggleSwitch点击事件处理
/// </summary>
private void ToggleSwitch_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
string tag = border.Tag?.ToString();
if (string.IsNullOrEmpty(tag)) return;
bool currentState = GetCurrentSettingValue(tag);
bool newState = !currentState;
SetToggleSwitchState(border, newState);
var pptSettings = MainWindow.Settings.PowerPointSettings;
if (pptSettings == null) return;
switch (tag)
{
case "SupportPowerPoint":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchSupportPowerPoint", newState);
break;
case "PowerPointEnhancement":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchPowerPointEnhancement", newState);
break;
case "SupportWPS":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchSupportWPS", newState);
break;
case "EnableWppProcessKill":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableWppProcessKill", newState);
break;
case "ShowPPTButton":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchShowPPTButton", newState);
// 更新UI状态
if (PPTButtonSettingsPanel != null)
{
PPTButtonSettingsPanel.Visibility = newState ? Visibility.Visible : Visibility.Collapsed;
}
break;
case "EnablePPTButtonPageClickable":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnablePPTButtonPageClickable", newState);
break;
case "EnablePPTButtonLongPressPageTurn":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnablePPTButtonLongPressPageTurn", newState);
break;
case "SkipAnimationsWhenGoNext":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchSkipAnimationsWhenGoNext", newState);
break;
case "ShowCanvasAtNewSlideShow":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchShowCanvasAtNewSlideShow", newState);
break;
case "EnableTwoFingerGestureInPresentationMode":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableTwoFingerGestureInPresentationMode", newState);
break;
case "EnableFingerGestureSlideShowControl":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableFingerGestureSlideShowControl", newState);
break;
case "ShowGestureButtonInSlideShow":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchShowGestureButtonInSlideShow", newState);
break;
case "EnablePPTTimeCapsule":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnablePPTTimeCapsule", newState);
break;
case "NotifyPreviousPage":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchNotifyPreviousPage", newState);
break;
case "AlwaysGoToFirstPageOnReenter":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAlwaysGoToFirstPageOnReenter", newState);
break;
case "NotifyHiddenPage":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchNotifyHiddenPage", newState);
break;
case "NotifyAutoPlayPresentation":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchNotifyAutoPlayPresentation", newState);
break;
}
}
/// <summary>
/// 选项按钮点击事件处理
/// </summary>
private void OptionButton_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
string tag = border.Tag?.ToString();
if (string.IsNullOrEmpty(tag)) return;
string[] parts = tag.Split('_');
if (parts.Length < 2) return;
string group = parts[0];
string value = parts[1];
bool isDarkTheme = ThemeHelper.IsDarkTheme;
var selectedBrush = isDarkTheme ? new SolidColorBrush(Color.FromRgb(25, 25, 25)) : new SolidColorBrush(Color.FromRgb(225, 225, 225));
var unselectedBrush = new SolidColorBrush(Colors.Transparent);
var parent = border.Parent as Panel;
if (parent != null)
{
foreach (var child in parent.Children)
{
if (child is Border childBorder && childBorder != border)
{
string childTag = childBorder.Tag?.ToString();
if (!string.IsNullOrEmpty(childTag) && childTag.StartsWith(group + "_"))
{
childBorder.Background = unselectedBrush;
var textBlock = childBorder.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Normal;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
}
}
}
border.Background = selectedBrush;
var currentTextBlock = border.Child as TextBlock;
if (currentTextBlock != null)
{
currentTextBlock.FontWeight = FontWeights.Bold;
currentTextBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
var pptSettings = MainWindow.Settings.PowerPointSettings;
if (pptSettings == null) return;
switch (group)
{
case "PPTTimeCapsulePosition":
int position;
switch (value)
{
case "TopLeft":
position = 0;
break;
case "TopRight":
position = 1;
break;
case "TopCenter":
position = 2;
break;
default:
position = 1;
break;
}
MainWindowSettingsHelper.UpdateSettingDirectly(() =>
{
pptSettings.PPTTimeCapsulePosition = position;
}, "PPTTimeCapsulePosition");
break;
}
}
/// <summary>
/// CheckBox变化事件处理
/// </summary>
private void CheckBox_CheckedChanged(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var checkBox = sender as CheckBox;
if (checkBox == null) return;
string name = checkBox.Name;
var pptSettings = MainWindow.Settings.PowerPointSettings;
if (pptSettings == null) return;
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeCheckBoxCheckedChanged(name, checkBox.IsChecked ?? false);
}
/// <summary>
/// Slider值变化事件处理
/// </summary>
private void PPTButtonPositionSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
var slider = sender as Slider;
if (slider == null) return;
string name = slider.Name;
double value = slider.Value;
// 更新文本显示
switch (name)
{
case "PPTButtonLeftPositionValueSlider":
if (PPTButtonLeftPositionValueText != null)
{
PPTButtonLeftPositionValueText.Text = ((int)value).ToString();
}
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("PPTButtonLeftPositionValueSlider", value);
break;
case "PPTButtonRightPositionValueSlider":
if (PPTButtonRightPositionValueText != null)
{
PPTButtonRightPositionValueText.Text = ((int)value).ToString();
}
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("PPTButtonRightPositionValueSlider", value);
break;
case "PPTButtonLBPositionValueSlider":
if (PPTButtonLBPositionValueText != null)
{
PPTButtonLBPositionValueText.Text = ((int)value).ToString();
}
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("PPTButtonLBPositionValueSlider", value);
break;
case "PPTButtonRBPositionValueSlider":
if (PPTButtonRBPositionValueText != null)
{
PPTButtonRBPositionValueText.Text = ((int)value).ToString();
}
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("PPTButtonRBPositionValueSlider", value);
break;
}
}
/// <summary>
/// 按钮透明度Slider值变化事件处理
/// </summary>
private void PPTButtonOpacitySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
var slider = sender as Slider;
if (slider == null) return;
string name = slider.Name;
double value = slider.Value;
// 更新文本显示
switch (name)
{
case "PPTLSButtonOpacityValueSlider":
if (PPTLSButtonOpacityValueText != null)
{
PPTLSButtonOpacityValueText.Text = value.ToString("F1");
}
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("PPTLSButtonOpacityValueSlider", value);
break;
case "PPTRSButtonOpacityValueSlider":
if (PPTRSButtonOpacityValueText != null)
{
PPTRSButtonOpacityValueText.Text = value.ToString("F1");
}
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("PPTRSButtonOpacityValueSlider", value);
break;
case "PPTLBButtonOpacityValueSlider":
if (PPTLBButtonOpacityValueText != null)
{
PPTLBButtonOpacityValueText.Text = value.ToString("F1");
}
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("PPTLBButtonOpacityValueSlider", value);
break;
case "PPTRBButtonOpacityValueSlider":
if (PPTRBButtonOpacityValueText != null)
{
PPTRBButtonOpacityValueText.Text = value.ToString("F1");
}
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("PPTRBButtonOpacityValueSlider", value);
break;
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
if (_isLoaded)
{
LoadSettings();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"PowerPointPanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,140 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.SearchPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
mc:Ignorable="d"
d:DesignHeight="691" d:DesignWidth="910">
<Grid x:Name="SearchPanelMainGrid" Background="#fafafa" Margin="250,0,0,0">
<!-- 搜索框区域 -->
<Grid Height="48" VerticalAlignment="Top" Margin="0,0,0,0">
<Border x:Name="SearchPanelTopBarBorder" Height="48" CornerRadius="0,6,0,0" Background="#fafafa">
<Border.Effect>
<DropShadowEffect Direction="-90" ShadowDepth="3" BlurRadius="4" Color="#000000" Opacity="0.25"/>
</Border.Effect>
</Border>
<Grid Margin="0,0,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- 搜索输入框 -->
<Border x:Name="SearchInputBorder" Grid.Column="0" Margin="60,8,12,8" Background="White" CornerRadius="8" BorderBrush="#e6e6e6" BorderThickness="1">
<Grid>
<Image Width="16" Height="16" Margin="12,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V17 H16 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,17z M0,0z M6.9333,0.111572C3.11689,0.111572 -5.16259E-07,3.22999 -5.16259E-07,7.04827 -5.16259E-07,10.8665 3.11689,13.9829 6.9333,13.9829 8.45757,13.9829 9.86954,13.4831 11.0166,12.6427L14.1583,15.7858C15.1805,16.7869,16.6805,15.2528,15.6583,14.2518L12.5333,11.1252C13.3704,9.97933 13.8666,8.57003 13.8666,7.04827 13.8666,3.22999 10.7497,0.111572 6.9333,0.111572z M6.9333,2.24594C9.59676,2.24594 11.7333,4.38351 11.7333,7.04827 11.7333,9.71302 9.59676,11.8485 6.9333,11.8485 4.26985,11.8485 2.13332,9.71302 2.13332,7.04827 2.13332,4.38351 4.26985,2.24594 6.9333,2.24594z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBox Name="SearchTextBox"
FontSize="14"
Foreground="#2e3436"
Background="Transparent"
BorderThickness="0"
Padding="40,0,12,0"
VerticalContentAlignment="Center"
KeyDown="SearchTextBox_KeyDown"
TextChanged="SearchTextBox_TextChanged"
GotFocus="SearchTextBox_GotFocus"/>
</Grid>
</Border>
<!-- 关闭按钮 -->
<Border Grid.Column="1" CornerRadius="8" Background="#33ef4444" Width="34" Height="34" Margin="0,0,8,0" HorizontalAlignment="Right" VerticalAlignment="Center" MouseLeftButtonDown="CloseSearchButton_Click" Cursor="Hand">
<Image Width="12" Height="12">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V12 H12 V0 H0 Z">
<GeometryDrawing Brush="#991b1b" Geometry="F1 M12,12z M0,0z M0.999846,0C0.734646,4.07258E-05 0.480321,0.105424 0.292816,0.29297 0.105327,0.4805 0,0.734821 0,1 0,1.26518 0.105327,1.5195 0.292816,1.70703L4.58579,6 0.292816,10.293C0.105327,10.4805 0,10.7348 0,11 0,11.2652 0.105327,11.5195 0.292816,11.707 0.480347,11.8945 0.734668,11.9998 0.999846,11.9998 1.26503,11.9998 1.51935,11.8945 1.70688,11.707L5.99985,7.41406 10.2928,11.707C10.4803,11.8945 10.7347,11.9998 10.9998,11.9998 11.265,11.9998 11.5193,11.8945 11.7069,11.707 11.8944,11.5195 11.9997,11.2652 11.9997,11 11.9997,10.7348 11.8944,10.4805 11.7069,10.293L7.41391,6 11.7069,1.70703C11.8944,1.5195 11.9997,1.26518 11.9997,1 11.9997,0.734821 11.8944,0.4805 11.7069,0.29297 11.5194,0.105424 11.265,4.07258E-05 10.9998,0 10.7346,4.07258E-05 10.4803,0.105424 10.2928,0.29297L5.99985,4.58594 1.70688,0.29297C1.51937,0.105424,1.26505,4.07258E-05,0.999846,0z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Border>
</Grid>
</Grid>
<!-- 搜索结果区域 -->
<ScrollViewer Margin="0,48,0,0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" IsManipulationEnabled="True" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24" Name="SearchResultsPanel">
<!-- 精准和拼音匹配结果 -->
<StackPanel Name="ExactMatchPanel" Visibility="Collapsed">
<TextBlock x:Name="ExactMatchTitle" Text="精准匹配" FontSize="13" FontWeight="Bold" Foreground="#2e3436" Margin="0,0,0,8"/>
<ItemsControl Name="ExactMatchItemsControl">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Background="White" CornerRadius="6" Margin="0,0,0,6" Padding="16,12" MouseLeftButtonDown="SearchResultItem_Click" Cursor="Hand" Tag="{Binding}">
<Grid>
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding Title}" FontSize="14" Foreground="#2e3436" FontWeight="Bold"/>
<TextBlock Text="{Binding Category}" FontSize="11" Foreground="#9a9996" Margin="0,4,0,0"/>
<TextBlock Text="{Binding Description}" FontSize="11" Foreground="#9a9996" Margin="0,2,0,0" TextWrapping="Wrap"/>
</StackPanel>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<!-- 模糊匹配结果 -->
<StackPanel Name="FuzzyMatchPanel" Visibility="Collapsed" Margin="0,16,0,0">
<TextBlock x:Name="FuzzyMatchTitle" Text="模糊匹配" FontSize="13" FontWeight="Bold" Foreground="#2e3436" Margin="0,0,0,8"/>
<ItemsControl Name="FuzzyMatchItemsControl">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Background="White" CornerRadius="6" Margin="0,0,0,6" Padding="16,12" MouseLeftButtonDown="SearchResultItem_Click" Cursor="Hand" Tag="{Binding}">
<Grid>
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding Title}" FontSize="14" Foreground="#2e3436" FontWeight="Bold"/>
<TextBlock Text="{Binding Category}" FontSize="11" Foreground="#9a9996" Margin="0,4,0,0"/>
<TextBlock Text="{Binding Description}" FontSize="11" Foreground="#9a9996" Margin="0,2,0,0" TextWrapping="Wrap"/>
</StackPanel>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<!-- 相关项结果 -->
<StackPanel Name="RelatedItemsPanel" Visibility="Collapsed" Margin="0,16,0,0">
<TextBlock x:Name="RelatedItemsTitle" Text="相关项" FontSize="13" FontWeight="Bold" Foreground="#2e3436" Margin="0,0,0,8"/>
<ItemsControl Name="RelatedItemsControl">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Background="White" CornerRadius="6" Margin="0,0,0,6" Padding="16,12" MouseLeftButtonDown="SearchResultItem_Click" Cursor="Hand" Tag="{Binding}">
<Grid>
<StackPanel Orientation="Vertical">
<TextBlock Text="{Binding Title}" FontSize="14" Foreground="#2e3436" FontWeight="Bold"/>
<TextBlock Text="{Binding Category}" FontSize="11" Foreground="#9a9996" Margin="0,4,0,0"/>
<TextBlock Text="{Binding Description}" FontSize="11" Foreground="#9a9996" Margin="0,2,0,0" TextWrapping="Wrap"/>
</StackPanel>
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<!-- 无结果提示 -->
<TextBlock Name="NoResultsText"
Text="未找到相关设置项"
FontSize="14"
Foreground="#9a9996"
HorizontalAlignment="Center"
Margin="0,40,0,0"
Visibility="Collapsed"/>
</StackPanel>
</ScrollViewer>
</Grid>
</UserControl>
@@ -1,607 +0,0 @@
using Microsoft.International.Converters.PinYinConverter;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// SearchPanel.xaml 的交互逻辑
/// </summary>
public partial class SearchPanel : UserControl
{
public event EventHandler<string> NavigateToItem;
public event EventHandler CloseSearch;
private ObservableCollection<SearchResultItem> _exactMatches = new ObservableCollection<SearchResultItem>();
private ObservableCollection<SearchResultItem> _fuzzyMatches = new ObservableCollection<SearchResultItem>();
private ObservableCollection<SearchResultItem> _relatedItems = new ObservableCollection<SearchResultItem>();
private List<SettingItem> _allSettings = new List<SettingItem>();
public SearchPanel()
{
InitializeComponent();
InitializeSettings();
ExactMatchItemsControl.ItemsSource = _exactMatches;
FuzzyMatchItemsControl.ItemsSource = _fuzzyMatches;
RelatedItemsControl.ItemsSource = _relatedItems;
}
private void InitializeSettings()
{
// 初始化所有设置项数据
_allSettings = new List<SettingItem>
{
// 启动时行为
new SettingItem { Title = "启动时行为", Category = "启动时行为", ItemName = "StartupItem", Type = SettingItemType.Category },
// 画板和墨迹
new SettingItem { Title = "画板和墨迹", Category = "画板和墨迹", ItemName = "CanvasAndInkItem", Type = SettingItemType.Category },
// 手势操作
new SettingItem { Title = "手势操作", Category = "手势操作", ItemName = "GesturesItem", Type = SettingItemType.Category },
// 墨迹纠正
new SettingItem { Title = "墨迹纠正", Category = "墨迹纠正", ItemName = "InkRecognitionItem", Type = SettingItemType.Category },
// 个性化设置
new SettingItem { Title = "个性化设置", Category = "个性化设置", ItemName = "ThemeItem", Type = SettingItemType.Category },
// 快捷键设置
new SettingItem { Title = "快捷键设置", Category = "快捷键设置", ItemName = "ShortcutsItem", Type = SettingItemType.Category },
// 崩溃处理
new SettingItem { Title = "崩溃处理", Category = "崩溃处理", ItemName = "CrashActionItem", Type = SettingItemType.Category },
// PowerPoint 支持
new SettingItem { Title = "PowerPoint 支持", Category = "PowerPoint 支持", ItemName = "PowerPointItem", Type = SettingItemType.Category },
// 自动化行为
new SettingItem { Title = "自动化行为", Category = "自动化行为", ItemName = "AutomationItem", Type = SettingItemType.Category },
// 随机点名
new SettingItem { Title = "随机点名", Category = "随机点名", ItemName = "LuckyRandomItem", Type = SettingItemType.Category },
// 高级选项
new SettingItem { Title = "高级选项", Category = "高级选项", ItemName = "AdvancedItem", Type = SettingItemType.Category },
// 截图和屏幕捕捉
new SettingItem { Title = "截图和屏幕捕捉", Category = "截图和屏幕捕捉", ItemName = "SnapshotItem", Type = SettingItemType.Category },
// 更新中心
new SettingItem { Title = "更新中心", Category = "更新中心", ItemName = "UpdateCenterItem", Type = SettingItemType.Category },
// 关于
new SettingItem { Title = "关于 InkCanvasForClass", Category = "关于", ItemName = "AboutItem", Type = SettingItemType.Category },
};
}
public void PerformSearch(string searchText)
{
if (string.IsNullOrWhiteSpace(searchText))
{
ClearResults();
return;
}
_exactMatches.Clear();
_fuzzyMatches.Clear();
_relatedItems.Clear();
var searchLower = searchText.ToLower();
var exactMatchSet = new HashSet<string>();
var fuzzyMatchSet = new HashSet<string>();
// 精准匹配和拼音匹配
foreach (var setting in _allSettings)
{
var titleLower = setting.Title.ToLower();
var categoryLower = setting.Category.ToLower();
// 精准匹配
if (titleLower.Contains(searchLower) || categoryLower.Contains(searchLower))
{
if (!exactMatchSet.Contains(setting.ItemName))
{
_exactMatches.Add(new SearchResultItem
{
Title = setting.Title,
Category = setting.Category,
ItemName = setting.ItemName,
Type = setting.Type,
MatchType = MatchType.Exact
});
exactMatchSet.Add(setting.ItemName);
}
}
// 拼音匹配
else if (ContainsPinyinMatch(setting.Title, searchText) || ContainsPinyinMatch(setting.Category, searchText))
{
if (!exactMatchSet.Contains(setting.ItemName))
{
_exactMatches.Add(new SearchResultItem
{
Title = setting.Title,
Category = setting.Category,
ItemName = setting.ItemName,
Type = setting.Type,
MatchType = MatchType.Pinyin
});
exactMatchSet.Add(setting.ItemName);
}
}
}
// 模糊匹配
foreach (var setting in _allSettings)
{
if (exactMatchSet.Contains(setting.ItemName))
continue;
var searchableText = $"{setting.Title} {setting.Category} {setting.Description}".ToLower();
if (FuzzyMatch(searchableText, searchLower))
{
if (!fuzzyMatchSet.Contains(setting.ItemName))
{
_fuzzyMatches.Add(new SearchResultItem
{
Title = setting.Title,
Category = setting.Category,
ItemName = setting.ItemName,
Type = setting.Type,
MatchType = MatchType.Fuzzy
});
fuzzyMatchSet.Add(setting.ItemName);
}
}
}
// 相关项
var allMatched = new HashSet<string>(exactMatchSet.Concat(fuzzyMatchSet));
foreach (var setting in _allSettings)
{
if (!allMatched.Contains(setting.ItemName))
{
// 简单的相关性判断
if (IsRelated(setting, searchText))
{
_relatedItems.Add(new SearchResultItem
{
Title = setting.Title,
Category = setting.Category,
ItemName = setting.ItemName,
Type = setting.Type,
MatchType = MatchType.Related
});
}
}
}
UpdateResultsVisibility();
}
private bool ContainsPinyinMatch(string text, string search)
{
if (string.IsNullOrWhiteSpace(text) || string.IsNullOrWhiteSpace(search))
return false;
try
{
// 将搜索词转换为小写
var searchLower = search.ToLower();
// 获取文本的拼音首字母和全拼
var pinyinInitials = GetPinyinInitials(text);
var pinyinFull = GetPinyinFull(text);
// 检查搜索词是否匹配拼音首字母或全拼
if (pinyinInitials.ToLower().Contains(searchLower) ||
pinyinFull.ToLower().Contains(searchLower))
{
return true;
}
}
catch
{
// 如果拼音转换失败,返回false
return false;
}
return false;
}
private string GetPinyinInitials(string text)
{
var sb = new StringBuilder();
foreach (char c in text)
{
if (IsChinese(c))
{
try
{
var chineseChar = new ChineseChar(c);
if (chineseChar.PinyinCount > 0)
{
var pinyin = chineseChar.Pinyins[0];
if (!string.IsNullOrEmpty(pinyin) && pinyin.Length > 0)
{
// 获取首字母(移除音调数字后取第一个字母)
var firstChar = Regex.Replace(pinyin, @"\d", "")[0];
sb.Append(firstChar);
}
}
}
catch
{
sb.Append(c);
}
}
else
{
sb.Append(c);
}
}
return sb.ToString();
}
private string GetPinyinFull(string text)
{
var sb = new StringBuilder();
foreach (char c in text)
{
if (IsChinese(c))
{
try
{
var chineseChar = new ChineseChar(c);
if (chineseChar.PinyinCount > 0)
{
var pinyin = chineseChar.Pinyins[0];
// 移除音调数字
pinyin = Regex.Replace(pinyin, @"\d", "");
sb.Append(pinyin);
}
}
catch
{
sb.Append(c);
}
}
else
{
sb.Append(c);
}
}
return sb.ToString();
}
private bool IsChinese(char c)
{
return c >= 0x4e00 && c <= 0x9fbb;
}
private bool FuzzyMatch(string text, string search)
{
if (string.IsNullOrWhiteSpace(text) || string.IsNullOrWhiteSpace(search))
return false;
// 简单的模糊匹配:检查搜索词的字符是否按顺序出现在文本中
int searchIndex = 0;
foreach (char c in text)
{
if (searchIndex < search.Length && c == search[searchIndex])
{
searchIndex++;
if (searchIndex == search.Length)
return true;
}
}
return false;
}
private bool IsRelated(SettingItem setting, string search)
{
// 简单的相关性判断,可以根据需要改进
// 例如:检查是否有共同的关键词等
return false; // 暂时禁用相关项功能
}
private void UpdateResultsVisibility()
{
ExactMatchPanel.Visibility = _exactMatches.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
FuzzyMatchPanel.Visibility = _fuzzyMatches.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
RelatedItemsPanel.Visibility = _relatedItems.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
bool hasResults = _exactMatches.Count > 0 || _fuzzyMatches.Count > 0 || _relatedItems.Count > 0;
NoResultsText.Visibility = hasResults ? Visibility.Collapsed : Visibility.Visible;
}
private void ClearResults()
{
_exactMatches.Clear();
_fuzzyMatches.Clear();
_relatedItems.Clear();
UpdateResultsVisibility();
}
private void SearchTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Escape)
{
CloseSearch?.Invoke(this, EventArgs.Empty);
}
}
private void SearchTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
var textBox = sender as TextBox;
if (textBox != null)
{
PerformSearch(textBox.Text);
}
}
private void SearchTextBox_GotFocus(object sender, RoutedEventArgs e)
{
var textBox = sender as TextBox;
textBox?.SelectAll();
}
private void CloseSearchButton_Click(object sender, MouseButtonEventArgs e)
{
CloseSearch?.Invoke(this, EventArgs.Empty);
}
private void SearchResultItem_Click(object sender, MouseButtonEventArgs e)
{
var border = sender as Border;
if (border?.Tag is SearchResultItem item)
{
NavigateToItem?.Invoke(this, item.ItemName);
}
}
public void FocusSearchBox()
{
SearchTextBox.Focus();
}
public void SetSearchText(string text)
{
SearchTextBox.Text = text;
PerformSearch(text);
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
bool isDarkTheme = ThemeHelper.IsDarkTheme;
// 更新主背景
if (SearchPanelMainGrid != null)
{
SearchPanelMainGrid.Background = ThemeHelper.GetBackgroundPrimaryBrush();
}
// 更新顶部栏背景
if (SearchPanelTopBarBorder != null)
{
SearchPanelTopBarBorder.Background = ThemeHelper.GetBackgroundPrimaryBrush();
}
// 更新搜索输入框
if (SearchInputBorder != null)
{
SearchInputBorder.Background = ThemeHelper.GetTextBoxBackgroundBrush();
SearchInputBorder.BorderBrush = ThemeHelper.GetTextBoxBorderBrush();
}
// 更新搜索框文字颜色
if (SearchTextBox != null)
{
SearchTextBox.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
// 更新标题文字颜色
if (ExactMatchTitle != null)
{
ExactMatchTitle.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
if (FuzzyMatchTitle != null)
{
FuzzyMatchTitle.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
if (RelatedItemsTitle != null)
{
RelatedItemsTitle.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
// 更新无结果提示文字颜色
if (NoResultsText != null)
{
NoResultsText.Foreground = ThemeHelper.GetTextSecondaryBrush();
}
// 更新搜索框中的图标颜色
UpdateSearchIconColor(isDarkTheme);
// 使用 ThemeHelper 递归更新其他元素(如搜索结果项)
ThemeHelper.ApplyThemeToControl(this);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"SearchPanel 应用主题时出错: {ex.Message}");
}
}
/// <summary>
/// 更新搜索框中的图标颜色
/// </summary>
private void UpdateSearchIconColor(bool isDarkTheme)
{
try
{
Color iconColor = isDarkTheme
? Color.FromRgb(243, 243, 243) // 深色主题使用浅色图标 #F3F3F3
: Color.FromRgb(34, 34, 34); // 浅色主题使用深色图标 #222222
// 查找搜索输入框中的图标
if (SearchInputBorder != null)
{
var image = FindVisualChild<Image>(SearchInputBorder);
if (image != null && image.Source is DrawingImage drawingImage)
{
if (drawingImage.Drawing is DrawingGroup drawingGroup)
{
var clonedDrawing = CloneDrawingGroup(drawingGroup, iconColor);
image.Source = new DrawingImage { Drawing = clonedDrawing };
}
}
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"更新搜索图标颜色时出错: {ex.Message}");
}
}
/// <summary>
/// 克隆 DrawingGroup 并更新颜色
/// </summary>
private DrawingGroup CloneDrawingGroup(DrawingGroup source, Color newColor)
{
var cloned = new DrawingGroup();
cloned.ClipGeometry = source.ClipGeometry?.Clone();
cloned.Opacity = source.Opacity;
cloned.Transform = source.Transform?.Clone();
foreach (var drawing in source.Children)
{
if (drawing is GeometryDrawing geometryDrawing)
{
var clonedGeometry = geometryDrawing.Geometry?.Clone();
var clonedBrush = CloneBrush(geometryDrawing.Brush, newColor);
var clonedPen = geometryDrawing.Pen != null
? ClonePen(geometryDrawing.Pen, newColor)
: null;
cloned.Children.Add(new GeometryDrawing(clonedBrush, clonedPen, clonedGeometry));
}
else if (drawing is DrawingGroup subGroup)
{
cloned.Children.Add(CloneDrawingGroup(subGroup, newColor));
}
else
{
cloned.Children.Add(drawing);
}
}
return cloned;
}
/// <summary>
/// 克隆 Brush 并更新颜色
/// </summary>
private Brush CloneBrush(Brush source, Color newColor)
{
if (source is SolidColorBrush solidBrush)
{
var originalColor = solidBrush.Color;
if (originalColor.R == 34 && originalColor.G == 34 && originalColor.B == 34) // #222222
{
return new SolidColorBrush(newColor) { Opacity = solidBrush.Opacity };
}
else if (originalColor.A > 0 && originalColor != Colors.Transparent &&
originalColor.R < 50 && originalColor.G < 50 && originalColor.B < 50) // 深色
{
return new SolidColorBrush(newColor) { Opacity = solidBrush.Opacity };
}
return new SolidColorBrush(originalColor) { Opacity = solidBrush.Opacity };
}
return source?.Clone();
}
/// <summary>
/// 克隆 Pen 并更新颜色
/// </summary>
private Pen ClonePen(Pen source, Color newColor)
{
var clonedBrush = CloneBrush(source.Brush, newColor);
return new Pen(clonedBrush, source.Thickness)
{
StartLineCap = source.StartLineCap,
EndLineCap = source.EndLineCap,
LineJoin = source.LineJoin,
MiterLimit = source.MiterLimit
};
}
/// <summary>
/// 在视觉树中查找指定类型的子元素
/// </summary>
private T FindVisualChild<T>(DependencyObject parent) where T : DependencyObject
{
for (int i = 0; i < System.Windows.Media.VisualTreeHelper.GetChildrenCount(parent); i++)
{
var child = System.Windows.Media.VisualTreeHelper.GetChild(parent, i);
if (child is T result)
{
return result;
}
var childOfChild = FindVisualChild<T>(child);
if (childOfChild != null)
{
return childOfChild;
}
}
return null;
}
}
public class SettingItem
{
public string Title { get; set; }
public string Category { get; set; }
public string ItemName { get; set; }
public string Description { get; set; } = "";
public SettingItemType Type { get; set; }
}
public class SearchResultItem
{
public string Title { get; set; }
public string Category { get; set; }
public string ItemName { get; set; }
public SettingItemType Type { get; set; }
public MatchType MatchType { get; set; }
public string Description { get; set; } = "";
}
public enum SettingItemType
{
Category,
Setting
}
public enum MatchType
{
Exact,
Pinyin,
Fuzzy,
Related
}
}
@@ -1,174 +0,0 @@
<local:SettingsPanelBase x:Class="Ink_Canvas.Windows.SettingsViews.SecurityPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<UserControl.Resources>
<ResourceDictionary>
<Style x:Key="ToggleSwitchStyle" TargetType="Border">
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="25"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="3,0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,0,15,0"/>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged"
IsManipulationEnabled="True"
Name="ScrollViewerEx"
IsDeferredScrollingEnabled="True"
VerticalScrollBarVisibility="Visible"
HorizontalScrollBarVisibility="Disabled"
IsTabStop="False"
TabIndex="-1"
Margin="0,0,2,2"
PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="安全密码默认关闭。开启后可用于退出软件、进入设置与重置配置时的二次验证。"
TextWrapping="Wrap"
Foreground="#9a9996"
FontSize="11"
Margin="0,0,0,12"/>
<!-- Description = 开启后需要设置密码 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用安全密码" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=SecurityPanel_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchPasswordEnabled"
Style="{StaticResource ToggleSwitchStyle}"
Background="#e1e1e1"
Tag="PasswordEnabled"
MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 设置或修改安全密码 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="密码管理" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=SecurityPanel_Hint_1}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Button x:Name="BtnSetOrChangePassword" Width="120" Height="32" Click="BtnSetOrChangePassword_Click" Content="设置/修改密码"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 关闭 InkCanvasForClass 时进行密码验证 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="退出软件需要密码" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=SecurityPanel__InkCanvasForClass_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchRequirePasswordOnExit" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="RequirePasswordOnExit" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 打开设置面板/新设置窗口时进行验证 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="进入设置需要密码" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=SecurityPanel_Hint_2}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchRequirePasswordOnEnterSettings" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="RequirePasswordOnEnterSettings" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 重置 Settings.json 前进行二次验证 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="重置配置需要密码" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=SecurityPanel__Settingsjson_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchRequirePasswordOnResetConfig" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="RequirePasswordOnResetConfig" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在修改名单或清空名单前进行密码验证 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="修改/清空点名名单需要密码" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=SecurityPanel_Hint_3}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchRequirePasswordOnModifyOrClearNameList" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="RequirePasswordOnModifyOrClearNameList" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="进程保护默认开启:运行期间保护根目录下的程序文件(exe/dll/config)不被外部修改。"
TextWrapping="Wrap"
Foreground="#9a9996"
FontSize="11"
Margin="0,0,0,12"/>
<!-- Description = 开启后关键文件会被只读占用 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="进程保护" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=SecurityPanel_Hint_4}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableProcessProtection" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="EnableProcessProtection" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</local:SettingsPanelBase>
@@ -1,230 +0,0 @@
using Ink_Canvas.Helpers;
using System;
using System.Windows;
using System.Windows.Controls;
namespace Ink_Canvas.Windows.SettingsViews
{
public partial class SecurityPanel : SettingsPanelBase
{
/// <summary>
/// 初始化 SecurityPanel 实例并构建其界面组件。
/// </summary>
public SecurityPanel()
{
InitializeComponent();
}
/// <summary>
/// 从 MainWindow.Settings 将安全相关设置加载并同步到面板的开关控件上。
/// </summary>
/// <remarks>
/// 确保 MainWindow.Settings.Security 存在(若为 null 则创建),在加载期间暂时禁用变更处理以避免触发回调,设置各个开关的状态并更新与密码相关的 UI 状态;任何加载期间的异常会被捕获并静默忽略。
/// </remarks>
public override void LoadSettings()
{
if (MainWindow.Settings == null) return;
if (MainWindow.Settings.Security == null) MainWindow.Settings.Security = new Security();
_isLoaded = false;
try
{
var sec = MainWindow.Settings.Security;
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchPasswordEnabled"), sec.PasswordEnabled);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchRequirePasswordOnExit"), sec.RequirePasswordOnExit);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchRequirePasswordOnEnterSettings"), sec.RequirePasswordOnEnterSettings);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchRequirePasswordOnResetConfig"), sec.RequirePasswordOnResetConfig);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchRequirePasswordOnModifyOrClearNameList"), sec.RequirePasswordOnModifyOrClearNameList);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableProcessProtection"), sec.EnableProcessProtection);
UpdatePasswordUiState();
}
catch
{
}
_isLoaded = true;
}
/// <summary>
/// 更新与主密码相关的界面控件的可用性:根据当前设置启用或禁用“设置/更改密码”按钮及相关用途开关。
/// </summary>
/// <remarks>
/// 当全局安全设置的 PasswordEnabled 为 true 时,启用 BtnSetOrChangePassword 以及以下用途开关:
/// ToggleSwitchRequirePasswordOnExit、ToggleSwitchRequirePasswordOnEnterSettings、ToggleSwitchRequirePasswordOnResetConfig
/// 否则禁用它们以阻止操作。
/// </remarks>
private void UpdatePasswordUiState()
{
var sec = MainWindow.Settings?.Security;
var enabled = sec != null && sec.PasswordEnabled;
if (BtnSetOrChangePassword != null) BtnSetOrChangePassword.IsEnabled = enabled;
// 用途开关:仅在启用密码功能时可操作
var usageEnabled = enabled;
var t1 = FindToggleSwitch("ToggleSwitchRequirePasswordOnExit");
var t2 = FindToggleSwitch("ToggleSwitchRequirePasswordOnEnterSettings");
var t3 = FindToggleSwitch("ToggleSwitchRequirePasswordOnResetConfig");
var t4 = FindToggleSwitch("ToggleSwitchRequirePasswordOnModifyOrClearNameList");
if (t1 != null) t1.IsEnabled = usageEnabled;
if (t2 != null) t2.IsEnabled = usageEnabled;
if (t3 != null) t3.IsEnabled = usageEnabled;
if (t4 != null) t4.IsEnabled = usageEnabled;
}
/// <summary>
/// 根据切换项标识更新对应的安全设置并保存变更。
/// </summary>
/// <remarks>
/// 对于启用或禁用主密码会在必要时弹出密码设置或验证对话框;对进程保护的修改会同时应用到 ProcessProtectionManager。方法会在成功变更后持久化设置并更新相关 UI 状态,若用户在交互中取消,则会恢复切换控件到原始状态。
/// </remarks>
/// <param name="tag">切换项的标识字符串,支持的值:`"PasswordEnabled"`、`"RequirePasswordOnExit"`、`"RequirePasswordOnEnterSettings"`、`"RequirePasswordOnResetConfig"`、`"EnableProcessProtection"`。</param>
/// <param name="newState">切换的新布尔状态:`true` 表示启用,`false` 表示禁用。</param>
protected override async void HandleToggleSwitchChange(string tag, bool newState)
{
if (MainWindow.Settings == null) return;
if (MainWindow.Settings.Security == null) MainWindow.Settings.Security = new Security();
var sec = MainWindow.Settings.Security;
switch (tag)
{
case "PasswordEnabled":
if (newState)
{
var havePassword = SecurityManager.HasPasswordConfigured(MainWindow.Settings);
if (!havePassword)
{
var pwd = await SecurityManager.PromptSetNewPasswordAsync(Window.GetWindow(this));
if (string.IsNullOrEmpty(pwd))
{
_isLoaded = false;
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchPasswordEnabled"), false);
_isLoaded = true;
return;
}
SecurityManager.SetPassword(MainWindow.Settings, pwd);
}
sec.PasswordEnabled = true;
MainWindow.SaveSettingsToFile();
UpdatePasswordUiState();
}
else
{
// 关闭:需要输入当前密码确认(已设置密码时)
if (SecurityManager.HasPasswordConfigured(MainWindow.Settings))
{
bool ok = await SecurityManager.PromptAndVerifyAsync(MainWindow.Settings, Window.GetWindow(this),
"关闭安全密码", "请输入当前密码以关闭安全密码功能。");
if (!ok)
{
_isLoaded = false;
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchPasswordEnabled"), true);
_isLoaded = true;
return;
}
}
sec.PasswordEnabled = false;
SecurityManager.ClearPassword(MainWindow.Settings);
MainWindow.SaveSettingsToFile();
UpdatePasswordUiState();
}
break;
case "RequirePasswordOnExit":
sec.RequirePasswordOnExit = newState;
MainWindow.SaveSettingsToFile();
break;
case "RequirePasswordOnEnterSettings":
sec.RequirePasswordOnEnterSettings = newState;
MainWindow.SaveSettingsToFile();
break;
case "RequirePasswordOnResetConfig":
sec.RequirePasswordOnResetConfig = newState;
MainWindow.SaveSettingsToFile();
break;
case "RequirePasswordOnModifyOrClearNameList":
sec.RequirePasswordOnModifyOrClearNameList = newState;
MainWindow.SaveSettingsToFile();
break;
case "EnableProcessProtection":
sec.EnableProcessProtection = newState;
MainWindow.SaveSettingsToFile();
ProcessProtectionManager.SetEnabled(newState);
break;
}
}
/// <summary>
/// 处理选项按钮组的选择更改。此面板不包含选项按钮组,因此不会执行任何操作。
/// </summary>
/// <param name="group">选项组的标识(未使用)。</param>
/// <param name="value">被选中的值(未使用)。</param>
protected override void HandleOptionChange(string group, string value)
{
// 本面板无选项按钮组
}
/// <summary>
/// 处理切换开关的点击事件。
/// </summary>
protected override void ToggleSwitch_Click(object sender, RoutedEventArgs e)
{
base.ToggleSwitch_Click(sender, e);
}
/// <summary>
/// 向用户弹出设置或更改密码的对话框;当用户输入非空新密码时,将该密码保存到设置中、启用密码功能、持久化设置并更新密码相关的 UI 状态。
/// </summary>
private async void BtnSetOrChangePassword_Click(object sender, RoutedEventArgs e)
{
if (MainWindow.Settings == null) return;
if (MainWindow.Settings.Security == null) MainWindow.Settings.Security = new Security();
var owner = Window.GetWindow(this);
var newPwd = await SecurityManager.PromptChangePasswordAsync(MainWindow.Settings, owner);
if (!string.IsNullOrEmpty(newPwd))
{
SecurityManager.SetPassword(MainWindow.Settings, newPwd);
MainWindow.Settings.Security.PasswordEnabled = true;
MainWindow.SaveSettingsToFile();
UpdatePasswordUiState();
}
}
public event EventHandler<RoutedEventArgs> IsTopBarNeedShadowEffect;
public event EventHandler<RoutedEventArgs> IsTopBarNeedNoShadowEffect;
/// <summary>
/// 根据 ScrollViewer 的垂直滚动偏移触发顶部栏阴影显示或隐藏事件。
/// </summary>
/// <param name="sender">触发事件的 ScrollViewer 控件。</param>
/// <param name="e">滚动更改的事件参数(未被方法使用)。</param>
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());
}
/// <summary>
/// 将当前主题应用到此面板并重新加载面板设置。
/// </summary>
/// <remarks>
/// 在应用主题或重载设置时抛出的异常会被捕获并忽略,不会向上抛出。
/// </remarks>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
LoadSettings();
}
catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex); }
}
}
}
@@ -1,54 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.SettingsBaseView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:controls="http://schemas.inkore.net/lib/ui/wpf/modern"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="SettingsViewScrollViewer" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<ItemsControl Name="SettingsViewBaseItemsControl">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Margin="0,12,0,24" HorizontalAlignment="Center" Width="524"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical" Margin="0,0,0,25">
<TextBlock Visibility="{Binding _TitleVisibility}" Text="{Binding Title}" FontSize="15" FontWeight="Bold" Foreground="#2e3436"/>
<Border Margin="{Binding _PanelMargin}" Background="#fafafa" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<ItemsControl ItemsSource="{Binding Items}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical"></StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="{Binding Title}" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=SettingsBaseView_Binding_DescriptionHint}" HorizontalAlignment="Left"/>
</StackPanel>
<controls:ToggleSwitch IsEnabled="{Binding ToggleSwitchEnabled}" IsOn="{Binding ToggleSwitchToggled, Mode=TwoWay}" Tag="{Binding}" Visibility="{Binding _ToggleSwitchVisibility}" Margin="0,0,15,0"/>
</Grid>
<Border Visibility="{Binding _SeparatorVisibility}" Height="1" Background="#ebebeb"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Border>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</UserControl>
@@ -1,206 +0,0 @@
using iNKORE.UI.WPF.Helpers;
using iNKORE.UI.WPF.Modern.Controls;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
namespace Ink_Canvas.Windows.SettingsViews
{
public class SettingsViewPanel
{
public string Title { get; set; }
public Visibility _TitleVisibility => String.IsNullOrWhiteSpace(Title) ? Visibility.Collapsed : Visibility.Visible;
public Thickness _PanelMargin =>
String.IsNullOrWhiteSpace(Title) ? new Thickness(0) : new Thickness(0, 12, 0, 0);
public ObservableCollection<SettingsItem> Items { get; set; } = new ObservableCollection<SettingsItem>() { };
}
public enum SettingsItemType
{
Plain, // 只显示Title和Description
SingleToggleSwtich,
ToggleSwitchWithArrowButton,
SelectionButtons,
}
public class SettingsItem : INotifyPropertyChanged
{
public string Title { get; set; }
public string Description { get; set; }
public SettingsItemType Type { get; set; } = SettingsItemType.Plain;
public bool IsClickable { get; set; } = false;
public bool IsSeparatorVisible { get; set; } = true;
public Visibility _SeparatorVisibility => IsSeparatorVisible ? Visibility.Visible : Visibility.Collapsed;
public Visibility _ToggleSwitchVisibility =>
Type == SettingsItemType.SingleToggleSwtich || Type == SettingsItemType.ToggleSwitchWithArrowButton ? Visibility.Visible : Visibility.Collapsed;
private bool _toggleSwitchToggled;
public bool ToggleSwitchToggled
{
get => _toggleSwitchToggled;
set
{
if (_toggleSwitchToggled != value)
{
_toggleSwitchToggled = value;
OnPropertyChanged(nameof(ToggleSwitchToggled)); // 通知绑定控件属性变化
OnToggleSwitchToggled?.Invoke(this, EventArgs.Empty); // 触发事件
}
}
}
public event EventHandler OnToggleSwitchToggled;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
private SolidColorBrush _toggleSwitchBackground = new SolidColorBrush(Color.FromRgb(53, 132, 228));
public SolidColorBrush ToggleSwitchBackground
{
get => _toggleSwitchBackground;
set
{
if (_toggleSwitchBackground != value)
{
_toggleSwitchBackground = value;
OnPropertyChanged(nameof(ToggleSwitchBackground)); // 通知绑定控件属性变化
}
}
}
private bool _toggleSwitchEnabled = true;
public bool ToggleSwitchEnabled
{
get => _toggleSwitchEnabled;
set
{
if (_toggleSwitchEnabled != value)
{
_toggleSwitchEnabled = value;
OnPropertyChanged(nameof(ToggleSwitchEnabled)); // 通知绑定控件属性变化
}
}
}
}
public partial class SettingsBaseView : UserControl
{
public SettingsBaseView()
{
InitializeComponent();
SettingsViewBaseItemsControl.ItemsSource = SettingsPanels;
}
public ObservableCollection<SettingsViewPanel> SettingsPanels { get; set; } =
new ObservableCollection<SettingsViewPanel>() { };
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());
}
}
private void ScrollBar_Scroll(object sender, RoutedEventArgs e)
{
var scrollbar = (ScrollBar)sender;
var scrollviewer = scrollbar.FindAscendant<ScrollViewer>();
if (scrollviewer != null) scrollviewer.ScrollToVerticalOffset(scrollbar.Track.Value);
}
private void ScrollBarTrack_MouseEnter(object sender, MouseEventArgs e)
{
var border = (Border)sender;
if (border.Child is Track track)
{
track.Width = 16;
track.Margin = new Thickness(0, 0, -2, 0);
var scrollbar = track.FindAscendant<ScrollBar>();
if (scrollbar != null) scrollbar.Width = 16;
var grid = track.FindAscendant<Grid>();
if (grid.FindDescendantByName("ScrollBarBorderTrackBackground") is Border backgroundBorder)
{
backgroundBorder.Width = 8;
backgroundBorder.CornerRadius = new CornerRadius(4);
backgroundBorder.Opacity = 1;
}
var thumb = track.Thumb.Template.FindName("ScrollbarThumbEx", track.Thumb);
if (thumb != null)
{
var _thumb = thumb as Border;
_thumb.CornerRadius = new CornerRadius(4);
_thumb.Width = 8;
_thumb.Margin = new Thickness(-0.75, 0, 1, 0);
_thumb.Background = new SolidColorBrush(Color.FromRgb(138, 138, 138));
}
}
}
private void ToggleSwitch_OnToggled(object sender, RoutedEventArgs e)
{
var toggleswitch = sender as ToggleSwitch;
var item = toggleswitch.Tag as SettingsItem;
item.ToggleSwitchToggled = toggleswitch.IsOn;
}
private void ScrollBarTrack_MouseLeave(object sender, MouseEventArgs e)
{
var border = (Border)sender;
border.Background = new SolidColorBrush(Colors.Transparent);
border.CornerRadius = new CornerRadius(0);
if (border.Child is Track track)
{
track.Width = 6;
track.Margin = new Thickness(0, 0, 0, 0);
var scrollbar = track.FindAscendant<ScrollBar>();
if (scrollbar != null) scrollbar.Width = 6;
var grid = track.FindAscendant<Grid>();
if (grid.FindDescendantByName("ScrollBarBorderTrackBackground") is Border backgroundBorder)
{
backgroundBorder.Width = 3;
backgroundBorder.CornerRadius = new CornerRadius(1.5);
backgroundBorder.Opacity = 0;
}
var thumb = track.Thumb.Template.FindName("ScrollbarThumbEx", track.Thumb);
if (thumb != null)
{
var _thumb = thumb as Border;
_thumb.CornerRadius = new CornerRadius(1.5);
_thumb.Width = 3;
_thumb.Margin = new Thickness(0);
_thumb.Background = new SolidColorBrush(Color.FromRgb(195, 195, 195));
}
}
}
private void ScrollbarThumb_MouseDown(object sender, MouseButtonEventArgs e)
{
var thumb = (Thumb)sender;
var border = thumb.Template.FindName("ScrollbarThumbEx", thumb);
((Border)border).Background = new SolidColorBrush(Color.FromRgb(95, 95, 95));
}
private void ScrollbarThumb_MouseUp(object sender, MouseButtonEventArgs e)
{
var thumb = (Thumb)sender;
var border = thumb.Template.FindName("ScrollbarThumbEx", thumb);
((Border)border).Background = new SolidColorBrush(Color.FromRgb(138, 138, 138));
}
}
}
@@ -1,279 +0,0 @@
using iNKORE.UI.WPF.Helpers;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// 设置面板基类,提供通用的辅助方法
/// </summary>
public abstract class SettingsPanelBase : UserControl
{
protected bool _isLoaded = false;
public SettingsPanelBase()
{
Loaded += SettingsPanelBase_Loaded;
}
/// <summary>
/// 处理控件的 Loaded 事件:加载面板设置、启用触摸支持,尝试调用面板的 ApplyTheme 方法(若存在),
/// 再次加载设置并将内部已加载标志设为 true。
/// </summary>
/// <param name="sender">触发事件的对象(通常是当前面板实例)。</param>
/// <param name="e">事件参数,包含路由事件的相关信息。</param>
private void SettingsPanelBase_Loaded(object sender, RoutedEventArgs e)
{
LoadSettings();
// 添加触摸支持
EnableTouchSupport();
// 应用主题(如果面板有 ApplyTheme 方法)
try
{
var applyThemeMethod = this.GetType().GetMethod("ApplyTheme",
System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
if (applyThemeMethod != null)
{
applyThemeMethod.Invoke(this, null);
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"SettingsPanelBase 应用主题时出错: {ex.Message}");
}
LoadSettings();
_isLoaded = true;
}
/// <summary>
/// 为面板中的所有交互控件启用触摸支持
/// </summary>
protected virtual void EnableTouchSupport()
{
try
{
// 延迟执行,确保所有控件都已加载
Dispatcher.BeginInvoke(new Action(() =>
{
EnableTouchSupportForControls(this);
}), System.Windows.Threading.DispatcherPriority.Loaded);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"启用触摸支持时出错: {ex.Message}");
}
}
/// <summary>
/// 为控件树中的所有交互控件启用触摸支持
/// </summary>
private void EnableTouchSupportForControls(DependencyObject parent)
{
if (parent == null) return;
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)
{
var child = VisualTreeHelper.GetChild(parent, i);
// 为 Border 控件(ToggleSwitch、选项按钮等)启用触摸支持
if (child is Border border)
{
// 检查是否是交互控件(有 Tag 或 Cursor 为 Hand
if (border.Tag != null || border.Cursor == Cursors.Hand)
{
border.IsManipulationEnabled = true;
// 添加触摸事件支持,将触摸事件转换为鼠标事件
border.TouchDown += Border_TouchDown;
border.PreviewTouchDown += Border_PreviewTouchDown;
}
}
// 为 Button 控件启用触摸支持
else if (child is Button button)
{
button.IsManipulationEnabled = true;
}
// 为 ComboBox 启用触摸支持
else if (child is ComboBox comboBox)
{
comboBox.IsManipulationEnabled = true;
}
// 为 Slider 启用触摸支持
else if (child is Slider slider)
{
slider.IsManipulationEnabled = true;
}
// 为 TextBox 启用触摸支持
else if (child is TextBox textBox)
{
textBox.IsManipulationEnabled = true;
}
// 递归处理子元素
EnableTouchSupportForControls(child);
}
}
/// <summary>
/// Border 触摸按下事件处理
/// </summary>
private void Border_TouchDown(object sender, TouchEventArgs e)
{
var border = sender as Border;
if (border == null) return;
// 获取触摸点位置
var touchPoint = e.GetTouchPoint(border);
// 创建模拟的鼠标事件
var mouseButtonEventArgs = new MouseButtonEventArgs(Mouse.PrimaryDevice, Environment.TickCount, MouseButton.Left)
{
RoutedEvent = UIElement.MouseLeftButtonDownEvent,
Source = border
};
// 触发鼠标按下事件
border.RaiseEvent(mouseButtonEventArgs);
// 捕获触摸设备
border.CaptureTouch(e.TouchDevice);
e.Handled = true;
}
/// <summary>
/// Border 预览触摸按下事件处理
/// </summary>
private void Border_PreviewTouchDown(object sender, TouchEventArgs e)
{
var border = sender as Border;
if (border == null) return;
// 获取触摸点位置
var touchPoint = e.GetTouchPoint(border);
// 创建模拟的鼠标事件
var mouseButtonEventArgs = new MouseButtonEventArgs(Mouse.PrimaryDevice, Environment.TickCount, MouseButton.Left)
{
RoutedEvent = UIElement.PreviewMouseLeftButtonDownEvent,
Source = border
};
// 触发预览鼠标按下事件
border.RaiseEvent(mouseButtonEventArgs);
e.Handled = true;
}
/// <summary>
/// 加载设置到UI - 子类需要实现
/// </summary>
public abstract void LoadSettings();
/// <summary>
/// 查找ToggleSwitch控件
/// </summary>
protected Border FindToggleSwitch(string name)
{
return this.FindDescendantByName(name) as Border;
}
/// <summary>
/// 设置ToggleSwitch状态
/// </summary>
protected void SetToggleSwitchState(Border toggleSwitch, bool isOn)
{
if (toggleSwitch == null) return;
toggleSwitch.Background = isOn
? new SolidColorBrush(Color.FromRgb(53, 132, 228))
: (ThemeHelper.IsDarkTheme ? ThemeHelper.GetButtonBackgroundBrush() : new SolidColorBrush(Color.FromRgb(225, 225, 225)));
var innerBorder = toggleSwitch.Child as Border;
if (innerBorder != null)
{
innerBorder.HorizontalAlignment = isOn ? HorizontalAlignment.Right : HorizontalAlignment.Left;
innerBorder.Background = new SolidColorBrush(Colors.White);
}
}
/// <summary>
/// 通用的ToggleSwitch点击事件处理
/// </summary>
protected virtual void ToggleSwitch_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
bool isOn = border.Background.ToString() == "#FF3584E4";
bool newState = !isOn;
SetToggleSwitchState(border, newState);
string tag = border.Tag?.ToString();
if (string.IsNullOrEmpty(tag)) return;
HandleToggleSwitchChange(tag, newState);
}
/// <summary>
/// 处理ToggleSwitch变化 - 子类需要实现
/// </summary>
protected abstract void HandleToggleSwitchChange(string tag, bool newState);
/// <summary>
/// 处理选项按钮变化 - 子类可以重写
/// </summary>
protected virtual void HandleOptionButtonChange(object sender, string tag)
{
// 默认实现:清除同组其他按钮的选中状态
var border = sender as Border;
if (border == null) return;
string[] parts = tag.Split('_');
if (parts.Length >= 2)
{
string group = parts[0];
string value = parts[1];
// 清除同组其他按钮的选中状态
var parent = border.Parent as Panel;
if (parent != null)
{
foreach (var child in parent.Children)
{
if (child is Border childBorder && childBorder != border)
{
string childTag = childBorder.Tag?.ToString();
if (!string.IsNullOrEmpty(childTag) && childTag.StartsWith(group + "_"))
{
childBorder.Background = new SolidColorBrush(Colors.Transparent);
var textBlock = childBorder.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Normal;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
}
}
}
bool isDarkTheme = ThemeHelper.IsDarkTheme;
var selectedBrush = isDarkTheme ? new SolidColorBrush(Color.FromRgb(25, 25, 25)) : new SolidColorBrush(Color.FromRgb(225, 225, 225));
border.Background = selectedBrush;
var currentTextBlock = border.Child as TextBlock;
if (currentTextBlock != null)
{
currentTextBlock.FontWeight = FontWeights.Bold;
currentTextBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
HandleOptionChange(group, value);
}
}
protected abstract void HandleOptionChange(string group, string value);
}
}
@@ -1,15 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.ShortcutsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="ScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<!-- 设置项已清空,仅保留页面框架 -->
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,49 +0,0 @@
using System;
using System.Windows;
using System.Windows.Controls;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// ShortcutsPanel.xaml 的交互逻辑
/// </summary>
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());
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"ShortcutsPanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,173 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.SnapshotPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ComboBoxStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- 开关样式模板 -->
<Style x:Key="ToggleSwitchStyle" TargetType="Border">
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="25"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="3,0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,0,15,0"/>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="ScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<!-- 截图设置 -->
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="截图设置" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<!-- Description = 清空画布时自动保存当前画布截图 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="清屏时自动截图" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=SnapshotPanel_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoSaveStrokesAtClear" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="AutoSaveStrokesAtClear" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 截图按日期分类保存到不同文件夹 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="截图分日期文件夹保存" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=SnapshotPanel_Hint_1}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchSaveScreenshotsInDateFolders" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="SaveScreenshotsInDateFolders" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 截图时同时保存当前画布的墨迹数据 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="截图时自动保存墨迹" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=SnapshotPanel_Hint_2}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoSaveStrokesAtScreenshot" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="AutoSaveStrokesAtScreenshot" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 开启后,在幻灯片有墨迹时翻页会自动截屏 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自动幻灯片截屏" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=SnapshotPanel_Hint_3}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoSaveScreenShotInPowerPoint" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="AutoSaveScreenShotInPowerPoint" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 设置自动截图时所需的最小墨迹量 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自动截图最小墨迹量" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=SnapshotPanel_Hint_4}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="SideControlMinimumAutomationSlider" Width="150" Minimum="0.3" Maximum="1" Value="1" TickFrequency="0.05" IsSnapToTickEnabled="True" ValueChanged="SideControlMinimumAutomationSlider_ValueChanged"/>
<TextBlock x:Name="SideControlMinimumAutomationText" Text="1.00" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436" FontFamily="Consolas"/>
</StackPanel>
</Grid>
</StackPanel>
</Border>
<!-- 截图保存路径设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="截图保存路径" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<StackPanel Orientation="Vertical" Margin="0,8,0,0">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="墨迹与截图的保存路径" HorizontalAlignment="Left" Margin="0,0,0,8"/>
<StackPanel Orientation="Horizontal" Margin="0,0,0,8">
<TextBox x:Name="AutoSavedStrokesLocation" Width="320" Text="D:\Ink Canvas" TextWrapping="Wrap" TextChanged="AutoSavedStrokesLocation_TextChanged"/>
<Button x:Name="AutoSavedStrokesLocationButton" Content="浏览" Padding="12,6" Margin="8,0,0,0" Background="#2563eb" Foreground="White" Click="AutoSavedStrokesLocationButton_Click"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,8">
<Button x:Name="SetAutoSavedStrokesLocationToDiskDButton" Content="设置保存到 D:\Ink Canvas" Padding="12,6" Margin="0,0,8,0" Background="#2563eb" Foreground="White" Click="SetAutoSavedStrokesLocationToDiskDButton_Click"/>
<Button x:Name="SetAutoSavedStrokesLocationToDocumentFolderButton" Content="设置保存到 文档" Padding="12,6" Background="#2563eb" Foreground="White" Click="SetAutoSavedStrokesLocationToDocumentFolderButton_Click"/>
</StackPanel>
<TextBlock Text="请注意检查保存文件夹是否有写入权限" TextWrapping="Wrap" Foreground="#9a9996" FontSize="11"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 自动清理设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="自动清理设置" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<!-- Description = 开启后将会删除自动保存目录下所有后缀名为 .icstk 和 .png 的文件 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="定期自动删除超过保存时间的墨迹、截图文件" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=SnapshotPanel__icstk__png_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoDelSavedFiles" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="AutoDelSavedFiles" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<StackPanel Orientation="Vertical" x:Name="AutoDelIntervalPanel" Visibility="Visible">
<StackPanel Orientation="Vertical" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,8,0,12">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="保存时长" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="设置自动删除文件的保存时长" HorizontalAlignment="Left"/>
</StackPanel>
<ComboBox x:Name="ComboBoxAutoDelSavedFilesDaysThreshold"
Style="{StaticResource ComboBoxStyle}"
ItemContainerStyle="{StaticResource ComboBoxItemStyle}"
HorizontalAlignment="Left"
Width="150"
SelectedIndex="4"
SelectionChanged="ComboBoxAutoDelSavedFilesDaysThreshold_SelectionChanged">
<ComboBoxItem Content="1天" Tag="AutoDelSavedFilesDaysThreshold_1"/>
<ComboBoxItem Content="3天" Tag="AutoDelSavedFilesDaysThreshold_3"/>
<ComboBoxItem Content="5天" Tag="AutoDelSavedFilesDaysThreshold_5"/>
<ComboBoxItem Content="7天" Tag="AutoDelSavedFilesDaysThreshold_7"/>
<ComboBoxItem Content="15天" Tag="AutoDelSavedFilesDaysThreshold_15" IsSelected="True"/>
<ComboBoxItem Content="30天" Tag="AutoDelSavedFilesDaysThreshold_30"/>
<ComboBoxItem Content="60天" Tag="AutoDelSavedFilesDaysThreshold_60"/>
<ComboBoxItem Content="100天" Tag="AutoDelSavedFilesDaysThreshold_100"/>
<ComboBoxItem Content="365天" Tag="AutoDelSavedFilesDaysThreshold_365"/>
</ComboBox>
</StackPanel>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,414 +0,0 @@
using iNKORE.UI.WPF.Helpers;
using System;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using Application = System.Windows.Application;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// SnapshotPanel.xaml 的交互逻辑
/// </summary>
public partial class SnapshotPanel : System.Windows.Controls.UserControl
{
private bool _isLoaded = false;
public SnapshotPanel()
{
InitializeComponent();
Loaded += SnapshotPanel_Loaded;
}
private void SnapshotPanel_Loaded(object sender, RoutedEventArgs e)
{
LoadSettings();
// 添加触摸支持
EnableTouchSupport();
// 应用主题
ApplyTheme();
_isLoaded = true;
}
/// <summary>
/// 为面板中的所有交互控件启用触摸支持
/// </summary>
private void EnableTouchSupport()
{
try
{
// 延迟执行,确保所有控件都已加载
Dispatcher.BeginInvoke(new Action(() =>
{
MainWindowSettingsHelper.EnableTouchSupportForControls(this);
}), System.Windows.Threading.DispatcherPriority.Loaded);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"SnapshotPanel 启用触摸支持时出错: {ex.Message}");
}
}
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());
}
}
/// <summary>
/// 加载设置到UI
/// </summary>
public void LoadSettings()
{
if (MainWindow.Settings == null) return;
_isLoaded = false;
try
{
// 清屏时自动截图
if (MainWindow.Settings.Automation != null)
{
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchAutoSaveStrokesAtClear"), MainWindow.Settings.Automation.IsAutoSaveStrokesAtClear);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchSaveScreenshotsInDateFolders"), MainWindow.Settings.Automation.IsSaveScreenshotsInDateFolders);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchAutoSaveStrokesAtScreenshot"), MainWindow.Settings.Automation.IsAutoSaveStrokesAtScreenshot);
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchAutoDelSavedFiles"), MainWindow.Settings.Automation.AutoDelSavedFiles);
// 自动截图最小墨迹量
if (SideControlMinimumAutomationSlider != null)
{
double minValue = MainWindow.Settings.Automation.MinimumAutomationStrokeNumber;
if (minValue == 0) minValue = 1.0;
SideControlMinimumAutomationSlider.Value = minValue;
if (SideControlMinimumAutomationText != null)
{
SideControlMinimumAutomationText.Text = minValue.ToString("F2");
}
}
// 保存路径
if (AutoSavedStrokesLocation != null)
{
AutoSavedStrokesLocation.Text = MainWindow.Settings.Automation.AutoSavedStrokesLocation;
}
// 自动删除保存时长
if (ComboBoxAutoDelSavedFilesDaysThreshold != null)
{
int days = MainWindow.Settings.Automation.AutoDelSavedFilesDaysThreshold;
int selectedIndex = 4; // 默认15天
switch (days)
{
case 1: selectedIndex = 0; break;
case 3: selectedIndex = 1; break;
case 5: selectedIndex = 2; break;
case 7: selectedIndex = 3; break;
case 15: selectedIndex = 4; break;
case 30: selectedIndex = 5; break;
case 60: selectedIndex = 6; break;
case 100: selectedIndex = 7; break;
case 365: selectedIndex = 8; break;
}
ComboBoxAutoDelSavedFilesDaysThreshold.SelectedIndex = selectedIndex;
}
if (AutoDelIntervalPanel != null)
{
AutoDelIntervalPanel.Visibility = MainWindow.Settings.Automation.AutoDelSavedFiles ? Visibility.Visible : Visibility.Collapsed;
}
}
// 自动幻灯片截屏
if (MainWindow.Settings.PowerPointSettings != null)
{
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchAutoSaveScreenShotInPowerPoint"), MainWindow.Settings.PowerPointSettings.IsAutoSaveScreenShotInPowerPoint);
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"加载截图设置时出错: {ex.Message}");
}
_isLoaded = true;
}
/// <summary>
/// 查找ToggleSwitch控件
/// </summary>
private Border FindToggleSwitch(string name)
{
return this.FindDescendantByName(name) as Border;
}
/// <summary>
/// 设置ToggleSwitch状态
/// </summary>
private void SetToggleSwitchState(Border toggleSwitch, bool isOn)
{
if (toggleSwitch == null) return;
toggleSwitch.Background = isOn
? new SolidColorBrush(Color.FromRgb(53, 132, 228))
: (ThemeHelper.IsDarkTheme ? ThemeHelper.GetButtonBackgroundBrush() : new SolidColorBrush(Color.FromRgb(225, 225, 225)));
var innerBorder = toggleSwitch.Child as Border;
if (innerBorder != null)
{
innerBorder.HorizontalAlignment = isOn ? System.Windows.HorizontalAlignment.Right : System.Windows.HorizontalAlignment.Left;
innerBorder.Background = new SolidColorBrush(Colors.White);
}
}
private bool GetCurrentSettingValue(string tag)
{
if (MainWindow.Settings == null) return false;
try
{
switch (tag)
{
case "AutoSaveStrokesAtClear":
return MainWindow.Settings.Automation?.IsAutoSaveStrokesAtClear ?? false;
case "SaveScreenshotsInDateFolders":
return MainWindow.Settings.Automation?.IsSaveScreenshotsInDateFolders ?? false;
case "AutoSaveStrokesAtScreenshot":
return MainWindow.Settings.Automation?.IsAutoSaveStrokesAtScreenshot ?? false;
case "AutoSaveScreenShotInPowerPoint":
return MainWindow.Settings.PowerPointSettings?.IsAutoSaveScreenShotInPowerPoint ?? false;
case "AutoDelSavedFiles":
return MainWindow.Settings.Automation?.AutoDelSavedFiles ?? false;
default:
return false;
}
}
catch
{
return false;
}
}
/// <summary>
/// ToggleSwitch点击事件处理
/// </summary>
private void ToggleSwitch_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
string tag = border.Tag?.ToString();
if (string.IsNullOrEmpty(tag)) return;
bool currentState = GetCurrentSettingValue(tag);
bool newState = !currentState;
SetToggleSwitchState(border, newState);
switch (tag)
{
case "AutoSaveStrokesAtClear":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAutoSaveStrokesAtClear", newState);
break;
case "SaveScreenshotsInDateFolders":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchSaveScreenshotsInDateFolders", newState);
break;
case "AutoSaveStrokesAtScreenshot":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAutoSaveStrokesAtScreenshot", newState);
break;
case "AutoSaveScreenShotInPowerPoint":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAutoSaveScreenShotInPowerPoint", newState);
break;
case "AutoDelSavedFiles":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAutoDelSavedFiles", newState);
// 更新UI状态
if (AutoDelIntervalPanel != null)
{
AutoDelIntervalPanel.Visibility = newState ? Visibility.Visible : Visibility.Collapsed;
}
break;
}
}
/// <summary>
/// Slider值变化事件处理
/// </summary>
private void SideControlMinimumAutomationSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
if (SideControlMinimumAutomationSlider != null && SideControlMinimumAutomationText != null)
{
double value = SideControlMinimumAutomationSlider.Value;
SideControlMinimumAutomationText.Text = value.ToString("F2");
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeSliderValueChanged("SideControlMinimumAutomationSlider", value);
}
}
/// <summary>
/// 保存路径文本框变化事件处理
/// </summary>
private void AutoSavedStrokesLocation_TextChanged(object sender, TextChangedEventArgs e)
{
if (!_isLoaded) return;
if (AutoSavedStrokesLocation != null)
{
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeTextBoxTextChanged("AutoSavedStrokesLocation", AutoSavedStrokesLocation.Text);
}
}
/// <summary>
/// 浏览按钮点击事件处理
/// </summary>
private void AutoSavedStrokesLocationButton_Click(object sender, RoutedEventArgs e)
{
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeMainWindowMethod("AutoSavedStrokesLocationButton_Click", sender, e);
// 同步新面板中的文本框
if (AutoSavedStrokesLocation != null)
{
var mainWindow = Application.Current.MainWindow as MainWindow;
if (mainWindow != null)
{
var textBox = mainWindow.FindName("AutoSavedStrokesLocation") as System.Windows.Controls.TextBox;
if (textBox != null)
{
AutoSavedStrokesLocation.Text = textBox.Text;
}
}
}
}
/// <summary>
/// 设置保存到 D:\Ink Canvas 按钮点击事件处理
/// </summary>
private void SetAutoSavedStrokesLocationToDiskDButton_Click(object sender, RoutedEventArgs e)
{
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeMainWindowMethod("SetAutoSavedStrokesLocationToDiskDButton_Click", sender, e);
// 同步新面板中的文本框
if (AutoSavedStrokesLocation != null)
{
var mainWindow = Application.Current.MainWindow as MainWindow;
if (mainWindow != null)
{
var textBox = mainWindow.FindName("AutoSavedStrokesLocation") as System.Windows.Controls.TextBox;
if (textBox != null)
{
AutoSavedStrokesLocation.Text = textBox.Text;
}
}
}
}
/// <summary>
/// 设置保存到文档按钮点击事件处理
/// </summary>
private void SetAutoSavedStrokesLocationToDocumentFolderButton_Click(object sender, RoutedEventArgs e)
{
if (AutoSavedStrokesLocation != null)
{
string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
AutoSavedStrokesLocation.Text = Path.Combine(documentsPath, "Ink Canvas");
}
}
/// <summary>
/// ComboBox选择变化事件处理
/// </summary>
private void ComboBoxAutoDelSavedFilesDaysThreshold_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!_isLoaded) return;
if (ComboBoxAutoDelSavedFilesDaysThreshold?.SelectedItem is ComboBoxItem selectedItem)
{
// 调用 MainWindow 中的方法
var mainWindow = Application.Current.MainWindow as MainWindow;
if (mainWindow != null)
{
var comboBox = mainWindow.FindName("ComboBoxAutoDelSavedFilesDaysThreshold") as System.Windows.Controls.ComboBox;
if (comboBox != null)
{
// 找到对应的选项并设置
string tag = selectedItem.Tag?.ToString();
if (!string.IsNullOrEmpty(tag) && tag.StartsWith("AutoDelSavedFilesDaysThreshold_"))
{
string daysStr = tag.Replace("AutoDelSavedFilesDaysThreshold_", "");
foreach (ComboBoxItem item in comboBox.Items)
{
if (item.Tag?.ToString() == tag || item.Content?.ToString() == daysStr + "天")
{
comboBox.SelectedItem = item;
MainWindowSettingsHelper.InvokeComboBoxSelectionChanged("ComboBoxAutoDelSavedFilesDaysThreshold", item);
break;
}
}
}
}
else
{
// 如果找不到控件,直接更新设置
string tag = selectedItem.Tag?.ToString();
if (!string.IsNullOrEmpty(tag) && tag.StartsWith("AutoDelSavedFilesDaysThreshold_"))
{
string daysStr = tag.Replace("AutoDelSavedFilesDaysThreshold_", "");
if (int.TryParse(daysStr, out int days))
{
MainWindowSettingsHelper.UpdateSettingDirectly(() =>
{
if (MainWindow.Settings.Automation != null)
{
MainWindow.Settings.Automation.AutoDelSavedFilesDaysThreshold = days;
}
}, "ComboBoxAutoDelSavedFilesDaysThreshold");
}
}
}
}
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
if (_isLoaded)
{
LoadSettings();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"SnapshotPanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,155 +0,0 @@
<UserControl x:Class="Ink_Canvas.Windows.SettingsViews.StartupPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ComboBoxStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- 开关样式模板 -->
<Style x:Key="ToggleSwitchStyle" TargetType="Border">
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="25"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="3,0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,0,15,0"/>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="ScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<!-- 窗口设置 -->
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<!-- Description = 窗口失去焦点时仍可接收输入 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="窗口无焦点模式" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=Startup_NoFocusModeHint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchNoFocusMode" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="NoFocusMode" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 隐藏窗口边框,提供更沉浸的体验 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="窗口无边框模式" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=Startup_NoBorderModeHint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchWindowMode" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="WindowMode" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 窗口始终显示在其他窗口之上 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="窗口置顶" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=Startup_TopMostHint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAlwaysOnTop" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="AlwaysOnTop" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 使用UIA方式实现置顶,需要管理员权限 -->
<Grid Height="54" x:Name="UIAccessTopMostPanel" Visibility="Collapsed">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="UIA置顶" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=Startup_UIAccessTopMostHint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchUIAccessTopMost" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="UIAccessTopMost" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- 启动设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<!-- Description = 系统启动时自动运行软件 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="开机时运行" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=Startup_RunAtStartupHint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchRunAtStartup" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="RunAtStartup" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 开机启动后自动收纳到侧边栏 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="开机运行后收纳到侧边栏" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=Startup_FoldAtStartupHint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchFoldAtStartup" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="FoldAtStartup" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- 模式设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="选择软件运行模式。仅PPT模式下,软件将完全隐藏,仅在PPT放映时出现。(实验性功能,可能不稳定。)"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11" Margin="0,0,0,12"/>
<!-- Description = 启用后,软件将完全隐藏,仅在PPT放映时出现 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="仅PPT模式" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=Startup_PPTOnlyModeHint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchMode" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="Mode" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,305 +0,0 @@
using iNKORE.UI.WPF.Helpers;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// StartupPanel.xaml 的交互逻辑
/// </summary>
public partial class StartupPanel : UserControl
{
private bool _isLoaded = false;
public StartupPanel()
{
InitializeComponent();
Loaded += StartupPanel_Loaded;
}
private void StartupPanel_Loaded(object sender, RoutedEventArgs e)
{
LoadSettings();
// 添加触摸支持
EnableTouchSupport();
// 应用主题
ApplyTheme();
_isLoaded = true;
}
/// <summary>
/// 为面板中的所有交互控件启用触摸支持
/// </summary>
private void EnableTouchSupport()
{
try
{
// 延迟执行,确保所有控件都已加载
Dispatcher.BeginInvoke(new Action(() =>
{
EnableTouchSupportForControls(this);
}), System.Windows.Threading.DispatcherPriority.Loaded);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"StartupPanel 启用触摸支持时出错: {ex.Message}");
}
}
/// <summary>
/// 为控件树中的所有交互控件启用触摸支持
/// </summary>
private void EnableTouchSupportForControls(System.Windows.DependencyObject parent)
{
// 使用 MainWindowSettingsHelper 的通用方法
MainWindowSettingsHelper.EnableTouchSupportForControls(parent);
}
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());
}
}
/// <summary>
/// 加载设置到UI
/// </summary>
public void LoadSettings()
{
if (MainWindow.Settings == null) return;
_isLoaded = false;
try
{
// 开机时运行
var toggleSwitchRunAtStartup = FindToggleSwitch("ToggleSwitchRunAtStartup");
if (toggleSwitchRunAtStartup != null)
{
// 检查启动项是否存在
bool runAtStartup = System.IO.File.Exists(
Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\Ink Canvas Annotation.lnk");
SetToggleSwitchState(toggleSwitchRunAtStartup, runAtStartup);
}
// 启动时折叠
var toggleSwitchFoldAtStartup = FindToggleSwitch("ToggleSwitchFoldAtStartup");
if (toggleSwitchFoldAtStartup != null)
{
SetToggleSwitchState(toggleSwitchFoldAtStartup, MainWindow.Settings.Startup.IsFoldAtStartup);
}
// 窗口无焦点模式
var toggleSwitchNoFocusMode = FindToggleSwitch("ToggleSwitchNoFocusMode");
if (toggleSwitchNoFocusMode != null && MainWindow.Settings.Advanced != null)
{
SetToggleSwitchState(toggleSwitchNoFocusMode, MainWindow.Settings.Advanced.IsNoFocusMode);
}
// 窗口无边框模式
var toggleSwitchWindowMode = FindToggleSwitch("ToggleSwitchWindowMode");
if (toggleSwitchWindowMode != null && MainWindow.Settings.Advanced != null)
{
SetToggleSwitchState(toggleSwitchWindowMode, MainWindow.Settings.Advanced.WindowMode);
}
// 窗口置顶
var toggleSwitchAlwaysOnTop = FindToggleSwitch("ToggleSwitchAlwaysOnTop");
if (toggleSwitchAlwaysOnTop != null && MainWindow.Settings.Advanced != null)
{
SetToggleSwitchState(toggleSwitchAlwaysOnTop, MainWindow.Settings.Advanced.IsAlwaysOnTop);
}
// UIA置顶
var toggleSwitchUIAccessTopMost = FindToggleSwitch("ToggleSwitchUIAccessTopMost");
if (toggleSwitchUIAccessTopMost != null && MainWindow.Settings.Advanced != null)
{
SetToggleSwitchState(toggleSwitchUIAccessTopMost, MainWindow.Settings.Advanced.EnableUIAccessTopMost);
}
// 仅PPT模式
var toggleSwitchMode = FindToggleSwitch("ToggleSwitchMode");
if (toggleSwitchMode != null && MainWindow.Settings.ModeSettings != null)
{
SetToggleSwitchState(toggleSwitchMode, MainWindow.Settings.ModeSettings.IsPPTOnlyMode);
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"加载启动设置时出错: {ex.Message}");
}
_isLoaded = true;
}
/// <summary>
/// 查找ToggleSwitch控件
/// </summary>
private Border FindToggleSwitch(string name)
{
return this.FindDescendantByName(name) as Border;
}
/// <summary>
/// 设置ToggleSwitch状态
/// </summary>
private void SetToggleSwitchState(Border toggleSwitch, bool isOn)
{
if (toggleSwitch == null) return;
toggleSwitch.Background = isOn
? new SolidColorBrush(Color.FromRgb(53, 132, 228))
: (ThemeHelper.IsDarkTheme ? ThemeHelper.GetButtonBackgroundBrush() : new SolidColorBrush(Color.FromRgb(225, 225, 225)));
var innerBorder = toggleSwitch.Child as Border;
if (innerBorder != null)
{
innerBorder.HorizontalAlignment = isOn ? HorizontalAlignment.Right : HorizontalAlignment.Left;
innerBorder.Background = new SolidColorBrush(Colors.White);
}
}
private bool GetCurrentSettingValue(string tag)
{
if (MainWindow.Settings == null) return false;
try
{
switch (tag)
{
case "RunAtStartup":
// 检查启动项是否存在
return System.IO.File.Exists(
Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\Ink Canvas Annotation.lnk");
case "FoldAtStartup":
return MainWindow.Settings.Startup?.IsFoldAtStartup ?? false;
case "NoFocusMode":
return MainWindow.Settings.Advanced?.IsNoFocusMode ?? false;
case "WindowMode":
return MainWindow.Settings.Advanced?.WindowMode ?? false;
case "AlwaysOnTop":
return MainWindow.Settings.Advanced?.IsAlwaysOnTop ?? false;
case "UIAccessTopMost":
return MainWindow.Settings.Advanced?.EnableUIAccessTopMost ?? false;
case "Mode":
return MainWindow.Settings.ModeSettings?.IsPPTOnlyMode ?? false;
default:
return false;
}
}
catch
{
return false;
}
}
/// <summary>
/// ToggleSwitch点击事件处理
/// </summary>
private void ToggleSwitch_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
string tag = border.Tag?.ToString();
if (string.IsNullOrEmpty(tag)) return;
bool currentState = GetCurrentSettingValue(tag);
bool newState = !currentState;
SetToggleSwitchState(border, newState);
switch (tag)
{
case "RunAtStartup":
// 直接调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchRunAtStartup", newState);
break;
case "FoldAtStartup":
// 直接调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchFoldAtStartup", newState);
break;
case "NoFocusMode":
// 窗口无焦点模式
MainWindowSettingsHelper.UpdateSettingDirectly(() =>
{
if (MainWindow.Settings.Advanced != null)
{
MainWindow.Settings.Advanced.IsNoFocusMode = newState;
}
}, "ToggleSwitchNoFocusMode");
// 调用 ApplyNoFocusMode 方法
MainWindowSettingsHelper.InvokeMainWindowMethod("ApplyNoFocusMode");
break;
case "WindowMode":
// 窗口无边框模式
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchWindowMode", newState);
break;
case "AlwaysOnTop":
// 窗口置顶
MainWindowSettingsHelper.UpdateSettingDirectly(() =>
{
if (MainWindow.Settings.Advanced != null)
{
MainWindow.Settings.Advanced.IsAlwaysOnTop = newState;
}
}, "ToggleSwitchAlwaysOnTop");
// 调用 SetAlwaysOnTop 方法(如果存在)
MainWindowSettingsHelper.InvokeMainWindowMethod("SetAlwaysOnTop", newState);
break;
case "UIAccessTopMost":
// UIA置顶
MainWindowSettingsHelper.UpdateSettingDirectly(() =>
{
if (MainWindow.Settings.Advanced != null)
{
MainWindow.Settings.Advanced.EnableUIAccessTopMost = newState;
}
}, "ToggleSwitchUIAccessTopMost");
break;
case "Mode":
// 仅PPT模式
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchMode", newState);
break;
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
if (_isLoaded)
{
LoadSettings();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"StartupPanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,15 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.StoragePanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="ScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<!-- 设置项已清空,仅保留页面框架 -->
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,49 +0,0 @@
using System;
using System.Windows;
using System.Windows.Controls;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// StoragePanel.xaml 的交互逻辑
/// </summary>
public partial class StoragePanel : UserControl
{
public StoragePanel()
{
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());
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"StoragePanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,502 +0,0 @@
using System.Windows.Media;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// 主题辅助类:提供统一的主题颜色资源
/// </summary>
public static class ThemeHelper
{
private static bool IsToggleSwitchThumb(System.Windows.Controls.Border border)
{
try
{
if (border == null) return false;
// ToggleSwitch thumb 常见尺寸:19x19,圆角 10,父级为 48x25 的开关背景
if (border.Width < 16 || border.Width > 24 || border.Height < 16 || border.Height > 24)
return false;
if (border.CornerRadius.TopLeft < 8) return false;
if (border.Parent is System.Windows.Controls.Border parent)
{
if (parent.Width >= 40 && parent.Width <= 60 &&
parent.Height >= 20 && parent.Height <= 35 &&
parent.CornerRadius.TopLeft >= 10)
{
return true;
}
}
return false;
}
catch
{
return false;
}
}
/// <summary>
/// 检查当前是否为深色主题
/// </summary>
public static bool IsDarkTheme
{
get
{
if (MainWindow.Settings?.Appearance == null) return false;
return MainWindow.Settings.Appearance.Theme == 1 ||
(MainWindow.Settings.Appearance.Theme == 2 && !IsSystemThemeLight());
}
}
/// <summary>
/// 检查系统主题是否为浅色
/// </summary>
private static bool IsSystemThemeLight()
{
try
{
var registryKey = Microsoft.Win32.Registry.CurrentUser;
var themeKey = registryKey.OpenSubKey("software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize");
var keyValue = 0;
if (themeKey != null) keyValue = (int)themeKey.GetValue("SystemUsesLightTheme");
return keyValue == 1;
}
catch
{
return true; // 默认返回浅色主题
}
}
// 文字颜色 - 参考 Windows 系统设置
public static Color TextPrimary => IsDarkTheme ? Color.FromRgb(243, 243, 243) : Color.FromRgb(0, 0, 0); // Windows 系统主文字颜色
public static Color TextSecondary => IsDarkTheme ? Color.FromRgb(200, 200, 200) : Color.FromRgb(96, 96, 96); // Windows 系统次要文字颜色
public static Color TextTertiary => IsDarkTheme ? Color.FromRgb(161, 161, 161) : Color.FromRgb(120, 120, 120); // Windows 系统三级文字颜色
// 背景颜色 - 参考 Windows 系统设置
public static Color BackgroundPrimary => IsDarkTheme ? Color.FromRgb(32, 32, 32) : Color.FromRgb(255, 255, 255); // Windows 系统主背景
public static Color BackgroundSecondary => IsDarkTheme ? Color.FromRgb(25, 25, 25) : Color.FromRgb(243, 243, 243); // Windows 系统次要背景(侧边栏等)
public static Color BackgroundTertiary => IsDarkTheme ? Color.FromRgb(43, 43, 43) : Color.FromRgb(237, 237, 237); // Windows 系统三级背景(按钮等)
// 边框颜色 - 参考 Windows 系统设置
public static Color BorderPrimary => IsDarkTheme ? Color.FromRgb(62, 62, 62) : Color.FromRgb(229, 229, 229); // Windows 系统主边框
public static Color BorderSecondary => IsDarkTheme ? Color.FromRgb(55, 55, 55) : Color.FromRgb(220, 220, 220); // Windows 系统次要边框
public static Color BorderTertiary => IsDarkTheme ? Color.FromRgb(70, 70, 70) : Color.FromRgb(211, 211, 211); // Windows 系统三级边框
// 分隔线颜色 - 参考 Windows 系统设置
public static Color Separator => IsDarkTheme ? Color.FromRgb(62, 62, 62) : Color.FromRgb(237, 237, 237); // Windows 系统分隔线
// 选中/高亮颜色 - 参考 Windows 系统设置
public static Color SelectedBackground => IsDarkTheme ? Color.FromRgb(62, 62, 62) : Color.FromRgb(237, 237, 237); // Windows 系统选中背景
public static Color HoverBackground => IsDarkTheme ? Color.FromRgb(43, 43, 43) : Color.FromRgb(243, 243, 243); // Windows 系统悬停背景
// 按钮颜色 - 参考 Windows 系统设置
public static Color ButtonBackground => IsDarkTheme ? Color.FromRgb(43, 43, 43) : Color.FromRgb(237, 237, 237); // Windows 系统按钮背景
public static Color ButtonHoverBackground => IsDarkTheme ? Color.FromRgb(55, 55, 55) : Color.FromRgb(220, 220, 220); // Windows 系统按钮悬停背景
// 文本框颜色 - 参考 Windows 系统设置
public static Color TextBoxBackground => IsDarkTheme ? Color.FromRgb(43, 43, 43) : Color.FromRgb(255, 255, 255); // Windows 系统文本框背景
public static Color TextBoxBorder => IsDarkTheme ? Color.FromRgb(62, 62, 62) : Color.FromRgb(229, 229, 229); // Windows 系统文本框边框
// 滚动条颜色 - 参考 Windows 系统设置
public static Color ScrollBarTrack => IsDarkTheme ? Color.FromRgb(25, 25, 25) : Color.FromRgb(243, 243, 243); // Windows 系统滚动条轨道
public static Color ScrollBarThumb => IsDarkTheme ? Color.FromRgb(122, 122, 122) : Color.FromRgb(191, 191, 191); // Windows 系统滚动条滑块
public static Color ScrollBarThumbHover => IsDarkTheme ? Color.FromRgb(150, 150, 150) : Color.FromRgb(138, 138, 138); // Windows 系统滚动条滑块悬停
// 转换为 SolidColorBrush
public static SolidColorBrush GetTextPrimaryBrush() => new SolidColorBrush(TextPrimary);
public static SolidColorBrush GetTextSecondaryBrush() => new SolidColorBrush(TextSecondary);
public static SolidColorBrush GetTextTertiaryBrush() => new SolidColorBrush(TextTertiary);
public static SolidColorBrush GetBackgroundPrimaryBrush() => new SolidColorBrush(BackgroundPrimary);
public static SolidColorBrush GetBackgroundSecondaryBrush() => new SolidColorBrush(BackgroundSecondary);
public static SolidColorBrush GetBackgroundTertiaryBrush() => new SolidColorBrush(BackgroundTertiary);
public static SolidColorBrush GetBorderPrimaryBrush() => new SolidColorBrush(BorderPrimary);
public static SolidColorBrush GetBorderSecondaryBrush() => new SolidColorBrush(BorderSecondary);
public static SolidColorBrush GetBorderTertiaryBrush() => new SolidColorBrush(BorderTertiary);
public static SolidColorBrush GetSeparatorBrush() => new SolidColorBrush(Separator);
public static SolidColorBrush GetSelectedBackgroundBrush() => new SolidColorBrush(SelectedBackground);
public static SolidColorBrush GetHoverBackgroundBrush() => new SolidColorBrush(HoverBackground);
public static SolidColorBrush GetButtonBackgroundBrush() => new SolidColorBrush(ButtonBackground);
public static SolidColorBrush GetButtonHoverBackgroundBrush() => new SolidColorBrush(ButtonHoverBackground);
public static SolidColorBrush GetTextBoxBackgroundBrush() => new SolidColorBrush(TextBoxBackground);
public static SolidColorBrush GetTextBoxBorderBrush() => new SolidColorBrush(TextBoxBorder);
public static SolidColorBrush GetScrollBarTrackBrush() => new SolidColorBrush(ScrollBarTrack);
public static SolidColorBrush GetScrollBarThumbBrush() => new SolidColorBrush(ScrollBarThumb);
public static SolidColorBrush GetScrollBarThumbHoverBrush() => new SolidColorBrush(ScrollBarThumbHover);
/// <summary>
/// 更新控件的文字颜色
/// </summary>
public static void UpdateTextBlockColors(System.Windows.DependencyObject parent)
{
for (int i = 0; i < System.Windows.Media.VisualTreeHelper.GetChildrenCount(parent); i++)
{
var child = System.Windows.Media.VisualTreeHelper.GetChild(parent, i);
if (child is System.Windows.Controls.TextBlock textBlock)
{
var foreground = textBlock.Foreground as SolidColorBrush;
if (foreground != null)
{
var color = foreground.Color;
// 检查是否是硬编码的浅色主题颜色
if (color.R == 46 && color.G == 52 && color.B == 54) // #2e3436 - 主文字
{
textBlock.Foreground = GetTextPrimaryBrush();
}
else if (color.R == 154 && color.G == 153 && color.B == 150) // #9a9996 - 次要文字
{
textBlock.Foreground = GetTextSecondaryBrush();
}
else if (color.R == 34 && color.G == 34 && color.B == 34) // #222222 - 深色文字
{
textBlock.Foreground = GetTextPrimaryBrush();
}
}
}
UpdateTextBlockColors(child);
}
}
/// <summary>
/// 更新控件的边框和背景颜色
/// </summary>
public static void UpdateBorderColors(System.Windows.DependencyObject parent)
{
for (int i = 0; i < System.Windows.Media.VisualTreeHelper.GetChildrenCount(parent); i++)
{
var child = System.Windows.Media.VisualTreeHelper.GetChild(parent, i);
if (child is System.Windows.Controls.Border border)
{
var background = border.Background as SolidColorBrush;
if (background != null)
{
var color = background.Color;
// 检查是否是硬编码的浅色主题颜色
if (color.R == 235 && color.G == 235 && color.B == 235) // #ebebeb - 分隔线
{
border.Background = GetSeparatorBrush();
}
else if (color.R == 217 && color.G == 217 && color.B == 217) // #d9d9d9 - 按钮背景
{
border.Background = GetButtonBackgroundBrush();
}
else if (color.R == 225 && color.G == 225 && color.B == 225) // #e1e1e1 - 按钮背景/分隔线
{
// 检查是否是按钮(有内边距或特定尺寸)
if (border.Padding.Left > 0 || border.Padding.Top > 0 ||
(border.Width > 0 && border.Height > 0 && border.Width < 200 && border.Height < 100))
{
border.Background = GetButtonBackgroundBrush();
}
else
{
// 可能是分隔线
border.Background = GetSeparatorBrush();
}
}
else if (color.R == 255 && color.G == 255 && color.B == 255) // White - 白色背景
{
// 检查是否是搜索结果项(有圆角和内边距)
if (border.CornerRadius.TopLeft == 6 && border.CornerRadius.TopRight == 6 &&
border.CornerRadius.BottomLeft == 6 && border.CornerRadius.BottomRight == 6 &&
border.Padding.Left > 0 && border.Padding.Top > 0)
{
// 搜索结果项背景
border.Background = IsDarkTheme
? new SolidColorBrush(Color.FromRgb(43, 43, 43)) // 深色主题搜索结果项背景
: new SolidColorBrush(Colors.White);
}
else
{
// ToggleSwitch thumb 应保持白色,不参与主题背景替换
if (!IsToggleSwitchThumb(border))
{
// 其他白色背景(如搜索框)
border.Background = GetTextBoxBackgroundBrush();
}
}
}
else if (color.R == 250 && color.G == 250 && color.B == 250) // #fafafa - 主背景
{
border.Background = GetBackgroundPrimaryBrush();
}
}
var borderBrush = border.BorderBrush as SolidColorBrush;
if (borderBrush != null)
{
var color = borderBrush.Color;
if (color.R == 230 && color.G == 230 && color.B == 230) // #e6e6e6 - 边框
{
border.BorderBrush = GetBorderPrimaryBrush();
}
else if (color.R == 225 && color.G == 225 && color.B == 225) // #e1e1e1 - 边框
{
border.BorderBrush = GetBorderPrimaryBrush();
}
else if (color.R == 211 && color.G == 211 && color.B == 211) // #d3d3d3 - 边框
{
border.BorderBrush = GetBorderTertiaryBrush();
}
}
}
UpdateBorderColors(child);
}
}
/// <summary>
/// 更新控件的线条颜色
/// </summary>
public static void UpdateLineColors(System.Windows.DependencyObject parent)
{
for (int i = 0; i < System.Windows.Media.VisualTreeHelper.GetChildrenCount(parent); i++)
{
var child = System.Windows.Media.VisualTreeHelper.GetChild(parent, i);
if (child is System.Windows.Shapes.Line line)
{
var stroke = line.Stroke as SolidColorBrush;
if (stroke != null)
{
var color = stroke.Color;
if (color.R == 211 && color.G == 211 && color.B == 211) // #d3d3d3 - 分隔线
{
line.Stroke = GetSeparatorBrush();
}
}
}
UpdateLineColors(child);
}
}
/// <summary>
/// 更新控件的文本框和组合框颜色
/// </summary>
public static void UpdateInputControlsColors(System.Windows.DependencyObject parent)
{
for (int i = 0; i < System.Windows.Media.VisualTreeHelper.GetChildrenCount(parent); i++)
{
var child = System.Windows.Media.VisualTreeHelper.GetChild(parent, i);
if (child is System.Windows.Controls.TextBox textBox)
{
var foreground = textBox.Foreground as SolidColorBrush;
if (foreground != null)
{
var color = foreground.Color;
if (color.R == 46 && color.G == 52 && color.B == 54) // #2e3436
{
textBox.Foreground = GetTextPrimaryBrush();
}
}
var background = textBox.Background as SolidColorBrush;
if (background != null)
{
var color = background.Color;
if (color.R == 255 && color.G == 255 && color.B == 255) // 白色背景
{
textBox.Background = IsDarkTheme ? GetBackgroundSecondaryBrush() : new SolidColorBrush(System.Windows.Media.Colors.White);
}
}
}
else if (child is System.Windows.Controls.ComboBox comboBox)
{
var foreground = comboBox.Foreground as SolidColorBrush;
if (foreground != null)
{
var color = foreground.Color;
if (color.R == 46 && color.G == 52 && color.B == 54) // #2e3436
{
comboBox.Foreground = GetTextPrimaryBrush();
}
}
}
UpdateInputControlsColors(child);
}
}
/// <summary>
/// 更新控件的按钮颜色
/// </summary>
public static void UpdateButtonColors(System.Windows.DependencyObject parent)
{
for (int i = 0; i < System.Windows.Media.VisualTreeHelper.GetChildrenCount(parent); i++)
{
var child = System.Windows.Media.VisualTreeHelper.GetChild(parent, i);
if (child is System.Windows.Controls.Button button)
{
var background = button.Background as SolidColorBrush;
if (background != null)
{
var color = background.Color;
// 检查是否是默认按钮(没有特定背景色)或特定颜色的按钮
if (color.R == 37 && color.G == 99 && color.B == 235) // #2563eb - 蓝色按钮(保持原色)
{
// 蓝色按钮保持原色,但更新文字颜色
if (button.Foreground is SolidColorBrush fgBrush &&
fgBrush.Color.R == 255 && fgBrush.Color.G == 255 && fgBrush.Color.B == 255)
{
button.Foreground = new SolidColorBrush(Colors.White); // 保持白色文字
}
}
else if (color.R == 255 && color.G == 255 && color.B == 255) // 白色背景按钮
{
button.Background = GetButtonBackgroundBrush();
button.Foreground = GetTextPrimaryBrush();
}
else if (color.A == 0 || color == System.Windows.Media.Colors.Transparent) // 透明背景
{
// 透明背景按钮,只更新文字颜色
button.Foreground = GetTextPrimaryBrush();
}
}
else
{
// 没有背景色的按钮,更新文字颜色
button.Foreground = GetTextPrimaryBrush();
}
}
UpdateButtonColors(child);
}
}
/// <summary>
/// 更新控件中的图标颜色
/// </summary>
public static void UpdateImageIconColors(System.Windows.DependencyObject parent)
{
for (int i = 0; i < System.Windows.Media.VisualTreeHelper.GetChildrenCount(parent); i++)
{
var child = System.Windows.Media.VisualTreeHelper.GetChild(parent, i);
if (child is System.Windows.Controls.Image image && image.Source is DrawingImage drawingImage)
{
if (drawingImage.Drawing is DrawingGroup drawingGroup)
{
Color iconColor = IsDarkTheme
? Color.FromRgb(243, 243, 243) // 深色主题使用浅色图标 #F3F3F3
: Color.FromRgb(34, 34, 34); // 浅色主题使用深色图标 #222222
// 检查图标是否使用了深色(需要更新的颜色)
bool needsUpdate = false;
foreach (var drawing in drawingGroup.Children)
{
if (drawing is GeometryDrawing geometryDrawing)
{
if (geometryDrawing.Brush is SolidColorBrush brush)
{
var color = brush.Color;
if (color.R == 34 && color.G == 34 && color.B == 34) // #222222
{
needsUpdate = true;
break;
}
}
if (geometryDrawing.Pen?.Brush is SolidColorBrush penBrush)
{
var color = penBrush.Color;
if (color.R == 34 && color.G == 34 && color.B == 34) // #222222
{
needsUpdate = true;
break;
}
}
}
}
if (needsUpdate)
{
// 克隆并更新图标颜色
var clonedDrawing = CloneDrawingGroupForTheme(drawingGroup, iconColor);
image.Source = new DrawingImage { Drawing = clonedDrawing };
}
}
}
UpdateImageIconColors(child);
}
}
/// <summary>
/// 克隆 DrawingGroup 并更新颜色(用于主题适配)
/// </summary>
private static DrawingGroup CloneDrawingGroupForTheme(DrawingGroup source, Color newColor)
{
var cloned = new DrawingGroup();
cloned.ClipGeometry = source.ClipGeometry?.Clone();
cloned.Opacity = source.Opacity;
cloned.Transform = source.Transform?.Clone();
foreach (var drawing in source.Children)
{
if (drawing is GeometryDrawing geometryDrawing)
{
var clonedGeometry = geometryDrawing.Geometry?.Clone();
var clonedBrush = CloneBrushForTheme(geometryDrawing.Brush, newColor);
var clonedPen = geometryDrawing.Pen != null
? ClonePenForTheme(geometryDrawing.Pen, newColor)
: null;
cloned.Children.Add(new GeometryDrawing(clonedBrush, clonedPen, clonedGeometry));
}
else if (drawing is DrawingGroup subGroup)
{
cloned.Children.Add(CloneDrawingGroupForTheme(subGroup, newColor));
}
else
{
cloned.Children.Add(drawing);
}
}
return cloned;
}
/// <summary>
/// 克隆 Brush 并更新颜色(用于主题适配)
/// </summary>
private static Brush CloneBrushForTheme(Brush source, Color newColor)
{
if (source is SolidColorBrush solidBrush)
{
var originalColor = solidBrush.Color;
if (originalColor.R == 34 && originalColor.G == 34 && originalColor.B == 34) // #222222
{
return new SolidColorBrush(newColor) { Opacity = solidBrush.Opacity };
}
else if (originalColor.A > 0 && originalColor != Colors.Transparent &&
originalColor.R < 50 && originalColor.G < 50 && originalColor.B < 50) // 深色
{
return new SolidColorBrush(newColor) { Opacity = solidBrush.Opacity };
}
return new SolidColorBrush(originalColor) { Opacity = solidBrush.Opacity };
}
return source?.Clone();
}
/// <summary>
/// 克隆 Pen 并更新颜色(用于主题适配)
/// </summary>
private static Pen ClonePenForTheme(Pen source, Color newColor)
{
var clonedBrush = CloneBrushForTheme(source.Brush, newColor);
return new Pen(clonedBrush, source.Thickness)
{
StartLineCap = source.StartLineCap,
EndLineCap = source.EndLineCap,
LineJoin = source.LineJoin,
MiterLimit = source.MiterLimit
};
}
/// <summary>
/// 应用主题到整个控件树
/// </summary>
public static void ApplyThemeToControl(System.Windows.DependencyObject control)
{
UpdateTextBlockColors(control);
UpdateBorderColors(control);
UpdateLineColors(control);
UpdateInputControlsColors(control);
UpdateButtonColors(control);
UpdateImageIconColors(control);
}
}
}
@@ -1,495 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.ThemePanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ComboBoxStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!-- 开关样式模板 -->
<Style x:Key="ToggleSwitchStyle" TargetType="Border">
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="25"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="3,0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,0,15,0"/>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="ScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<!-- 主题设置 -->
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<!-- Description = 选择应用程序的主题样式 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="主题" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Border x:Name="ThemeLightBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="Theme_Light" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="浅色主题"/>
</Border>
<Border x:Name="ThemeDarkBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="Theme_Dark" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="深色主题"/>
</Border>
<Border x:Name="ThemeSystemBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="Theme_System" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="跟随系统"/>
</Border>
</WrapPanel>
</Grid>
</StackPanel>
</Border>
<!-- 启动动画设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<!-- Description = 启动时显示动画效果 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用启动动画" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_1}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableSplashScreen" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="EnableSplashScreen" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<StackPanel Margin="18,8,18,8" x:Name="SplashScreenStylePanel">
<StackPanel Orientation="Vertical" Margin="0,0,0,12">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启动动画样式" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_2}" HorizontalAlignment="Left"/>
</StackPanel>
<ComboBox x:Name="ComboBoxSplashScreenStyle"
Style="{StaticResource ComboBoxStyle}"
ItemContainerStyle="{StaticResource ComboBoxItemStyle}"
HorizontalAlignment="Left"
Width="200"
SelectionChanged="ComboBoxSplashScreenStyle_SelectionChanged">
<ComboBoxItem Content="随机" Tag="SplashScreenStyle_Random"/>
<ComboBoxItem Content="跟随四季" Tag="SplashScreenStyle_Season"/>
<ComboBoxItem Content="春季" Tag="SplashScreenStyle_Spring"/>
<ComboBoxItem Content="夏季" Tag="SplashScreenStyle_Summer"/>
<ComboBoxItem Content="秋季" Tag="SplashScreenStyle_Autumn"/>
<ComboBoxItem Content="冬季" Tag="SplashScreenStyle_Winter"/>
<ComboBoxItem Content="马年限定" Tag="SplashScreenStyle_Horse"/>
</ComboBox>
</StackPanel>
</StackPanel>
</Border>
<!-- 浮动工具栏设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical">
<StackPanel Margin="18,8,18,8">
<StackPanel Orientation="Vertical" Margin="0,0,0,12">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="浮动工具栏图标" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_3}" HorizontalAlignment="Left"/>
</StackPanel>
<ComboBox x:Name="ComboBoxFloatingBarImg"
Style="{StaticResource ComboBoxStyle}"
ItemContainerStyle="{StaticResource ComboBoxItemStyle}"
HorizontalAlignment="Left"
Width="250"
SelectedIndex="0"
SelectionChanged="ComboBoxFloatingBarImg_SelectionChanged">
<ComboBoxItem Content="&quot;ICC-CE&quot;默认" Tag="FloatingBarImg_Default" IsSelected="True"/>
<ComboBoxItem Content="&quot;ICC-CE&quot;无阴影" Tag="FloatingBarImg_NoShadow"/>
<ComboBoxItem Content="&quot;ICC-CE&quot;深色" Tag="FloatingBarImg_Dark"/>
<ComboBoxItem Content="&quot;ICC-CE&quot;深色呼吸版" Tag="FloatingBarImg_DarkBreathing"/>
<ComboBoxItem Content="&quot;ICC-CE&quot;白色透明版" Tag="FloatingBarImg_WhiteTransparent"/>
<ComboBoxItem Content="&quot;ICC-CE&quot;黑色透明版" Tag="FloatingBarImg_BlackTransparent"/>
<ComboBoxItem Content="酷安斗鸡眼滑稽" Tag="FloatingBarImg_Kuan1"/>
<ComboBoxItem Content="酷安受虐滑稽" Tag="FloatingBarImg_Kuan2"/>
<ComboBoxItem Content="酷安呲牙笑" Tag="FloatingBarImg_Kuan3"/>
<ComboBoxItem Content="酷安头戴内裤滑稽" Tag="FloatingBarImg_Kuan4"/>
<ComboBoxItem Content="酷安绿帽Doge" Tag="FloatingBarImg_Kuan5"/>
<ComboBoxItem Content="贴吧滑稽" Tag="FloatingBarImg_Tieba"/>
</ComboBox>
</StackPanel>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 调整浮动工具栏的大小 -->
<Grid Height="54">
<StackPanel Orientation="Horizontal" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自定义浮动栏图标" HorizontalAlignment="Left" Margin="0,0,12,0"/>
<Button x:Name="ButtonAddCustomIcon" Content="上传" Padding="10,3"/>
<Button x:Name="ButtonManageCustomIcons" Content="管理" Padding="10,3" Margin="5,0,0,0"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="浮动工具栏缩放" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_4}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="ViewboxFloatingBarScaleTransformValueSlider" Width="150" Minimum="0.5" Maximum="1.25" Value="1" TickFrequency="0.05" IsSnapToTickEnabled="True" ValueChanged="ViewboxFloatingBarScaleTransformValueSlider_ValueChanged"/>
<TextBlock x:Name="ViewboxFloatingBarScaleTransformValueText" Text="1.00" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 调整浮动工具栏的透明度 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="浮动工具栏透明度" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_5}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="ViewboxFloatingBarOpacityValueSlider" Width="150" Minimum="0.3" Maximum="1" Value="1" TickFrequency="0.05" IsSnapToTickEnabled="True" ValueChanged="ViewboxFloatingBarOpacityValueSlider_ValueChanged"/>
<TextBlock x:Name="ViewboxFloatingBarOpacityValueText" Text="1.00" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 在PPT模式下浮动工具栏的透明度(重新进入PPT放映后生效) -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="浮栏在PPT下透明度" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_PPTPPTHint}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="ViewboxFloatingBarOpacityInPPTValueSlider" Width="150" Minimum="0.3" Maximum="1" Value="1" TickFrequency="0.05" IsSnapToTickEnabled="True" ValueChanged="ViewboxFloatingBarOpacityInPPTValueSlider_ValueChanged"/>
<TextBlock x:Name="ViewboxFloatingBarOpacityInPPTValueText" Text="1.00" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 在调色盘窗口中显示笔尖模式切换按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="在调色盘窗口中显示 笔尖模式 按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_6}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableDisPlayNibModeToggle" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="EnableDisPlayNibModeToggle" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb"/>
<!-- Description = 使用旧版浮动栏按钮的界面样式 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="18,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="使用老版浮动栏按钮UI" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_7}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxUseLegacyFloatingBarUI" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
</Grid>
</StackPanel>
</Border>
<!-- 浮动栏按钮显示设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="浮动栏按钮显示" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<!-- Description = 在浮动栏中显示形状按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示形状按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_8}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowShapeButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示撤销按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示撤销按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_9}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowUndoButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示重做按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示重做按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_10}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowRedoButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示清空按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示清空按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_11}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowClearButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示白板按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示白板按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_12}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowWhiteboardButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示隐藏按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示隐藏按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_13}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowHideButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示套索选择按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示套索选择按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_14}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowLassoSelectButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示清并鼠按钮 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示清并鼠按钮" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_15}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowClearAndMouseButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" IsChecked="True" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在浮动栏中显示快捷调色盘 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="显示快捷调色盘" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_16}" HorizontalAlignment="Left"/>
</StackPanel>
<CheckBox x:Name="CheckBoxShowQuickColorPalette" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" Checked="CheckBox_CheckedChanged" Unchecked="CheckBox_CheckedChanged"/>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 选择快捷调色盘的显示模式 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="快捷调色盘显示模式" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_17}" HorizontalAlignment="Left"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Border x:Name="QuickColorPaletteDisplayModeSingleBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="QuickColorPaletteDisplayMode_Single" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="单行显示(6色)"/>
</Border>
<Border x:Name="QuickColorPaletteDisplayModeDoubleBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="QuickColorPaletteDisplayMode_Double" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="双行显示(8色)"/>
</Border>
</WrapPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Vertical" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,8,0,12">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="橡皮按钮显示" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="选择橡皮按钮的显示方式" HorizontalAlignment="Left"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" Margin="0,0,0,8">
<Border x:Name="EraserDisplayOptionBothBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="EraserDisplayOption_Both" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="两个都显示"/>
</Border>
<Border x:Name="EraserDisplayOptionAreaBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="EraserDisplayOption_Area" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="仅显示面积擦"/>
</Border>
<Border x:Name="EraserDisplayOptionLineBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="EraserDisplayOption_Line" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="仅显示线擦"/>
</Border>
<Border x:Name="EraserDisplayOptionNoneBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="EraserDisplayOption_None" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="都不显示"/>
</Border>
</WrapPanel>
</StackPanel>
</StackPanel>
</Border>
<!-- 任务栏托盘图标设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="任务栏托盘图标" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<!-- Description = 在任务栏系统托盘显示图标 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用托盘图标" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_18}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableTrayIcon" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="EnableTrayIcon" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- 白板设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="白板设置" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<!-- Description = 将白板界面缩放至80% -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="白板 UI 80% 缩放" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_80Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableViewboxBlackBoardScaleTransform" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="EnableViewboxBlackBoardScaleTransform" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在白板界面显示当前时间和日期 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="在白板中显示当前时间和日期" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_19}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableTimeDisplayInWhiteboardMode" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="EnableTimeDisplayInWhiteboardMode" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 在白板界面显示励志语句 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="在白板中显示信仰の源1(好喝的/毒的鸡汤)" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_20}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableChickenSoupInWhiteboardMode" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="EnableChickenSoupInWhiteboardMode" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Vertical" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,8,0,12">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="信仰の源出自Where" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" TextWrapping="Wrap" Text="选择励志语句的来源" HorizontalAlignment="Left"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" Margin="0,0,0,8">
<Border x:Name="ChickenSoupSourceOsuBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="ChickenSoupSource_Osu" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="osu!玩家语录"/>
</Border>
<Border x:Name="ChickenSoupSourceMotivationalBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="ChickenSoupSource_Motivational" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="励志立志的名言警句"/>
</Border>
<Border x:Name="ChickenSoupSourceGaokaoBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="ChickenSoupSource_Gaokao" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="高考祝福语"/>
</Border>
<Border x:Name="ChickenSoupSourceHitokotoBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="ChickenSoupSource_Hitokoto" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="一言(Hitokoto API"/>
</Border>
</WrapPanel>
</StackPanel>
</StackPanel>
</Border>
<!-- 收纳模式设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="收纳模式设置" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<!-- Description = 在收纳模式下显示快速操作面板 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="在收纳模式下启用快速面板" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_21}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableQuickPanel" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="EnableQuickPanel" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 选择取消收纳按钮的图标样式 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="取消收纳按钮图标" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_22}" HorizontalAlignment="Left"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Border x:Name="UnFoldBtnImgArrowBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="UnFoldBtnImg_Arrow" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="箭头"/>
</Border>
<Border x:Name="UnFoldBtnImgPenBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="UnFoldBtnImg_Pen" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="笔"/>
</Border>
</WrapPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 开启后,退出收纳模式时将自动切换至批注模式,便于快速批注 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="退出收纳模式时自动切换至批注模式" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_23}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoEnterAnnotationModeWhenExitFoldMode" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="AutoEnterAnnotationModeWhenExitFoldMode" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 开启后,退出PPT放映后会自动收纳浮动栏 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="退出PPT放映后自动收纳浮动栏" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_PPTHint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoFoldAfterPPTSlideShow" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="AutoFoldAfterPPTSlideShow" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 开启后,退出白板模式时会自动收纳到侧边栏 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="退出白板时自动收纳" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=ThemePanel_Hint_24}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchAutoFoldWhenExitWhiteboard" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1" Tag="AutoFoldWhenExitWhiteboard" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,854 +0,0 @@
using H.NotifyIcon;
using iNKORE.UI.WPF.Helpers;
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// ThemePanel.xaml 的交互逻辑
/// </summary>
public partial class ThemePanel : UserControl
{
private bool _isLoaded = false;
public ThemePanel()
{
InitializeComponent();
Loaded += ThemePanel_Loaded;
}
private void ThemePanel_Loaded(object sender, RoutedEventArgs e)
{
LoadSettings();
// 添加触摸支持
EnableTouchSupport();
// 应用主题
ApplyTheme();
_isLoaded = true;
}
/// <summary>
/// 为面板中的所有交互控件启用触摸支持
/// </summary>
private void EnableTouchSupport()
{
try
{
// 延迟执行,确保所有控件都已加载
Dispatcher.BeginInvoke(new Action(() =>
{
MainWindowSettingsHelper.EnableTouchSupportForControls(this);
}), System.Windows.Threading.DispatcherPriority.Loaded);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"ThemePanel 启用触摸支持时出错: {ex.Message}");
}
}
public event EventHandler<RoutedEventArgs> IsTopBarNeedShadowEffect;
public event EventHandler<RoutedEventArgs> IsTopBarNeedNoShadowEffect;
public event EventHandler<RoutedEventArgs> ThemeChanged;
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());
}
}
/// <summary>
/// 加载设置到UI
/// </summary>
public void LoadSettings()
{
if (MainWindow.Settings == null || MainWindow.Settings.Appearance == null) return;
_isLoaded = false;
try
{
var appearance = MainWindow.Settings.Appearance;
// 主题设置
SetOptionButtonState("Theme", appearance.Theme);
// 启用启动动画
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableSplashScreen"), appearance.EnableSplashScreen);
if (SplashScreenStylePanel != null)
{
SplashScreenStylePanel.Visibility = appearance.EnableSplashScreen ? Visibility.Visible : Visibility.Collapsed;
}
// 启动动画样式
if (ComboBoxSplashScreenStyle != null)
{
ComboBoxSplashScreenStyle.SelectedIndex = Math.Min(appearance.SplashScreenStyle, ComboBoxSplashScreenStyle.Items.Count - 1);
}
// 浮动工具栏图标
if (ComboBoxFloatingBarImg != null)
{
// 更新自定义图标列表(如果需要)
// UpdateCustomIconsInComboBox();
int selectedIndex = Math.Min(appearance.FloatingBarImg, ComboBoxFloatingBarImg.Items.Count - 1);
ComboBoxFloatingBarImg.SelectedIndex = selectedIndex;
}
// 浮动工具栏缩放
if (ViewboxFloatingBarScaleTransformValueSlider != null)
{
double val = appearance.ViewboxFloatingBarScaleTransformValue;
if (val == 0) val = 1.0;
ViewboxFloatingBarScaleTransformValueSlider.Value = val;
if (ViewboxFloatingBarScaleTransformValueText != null)
{
ViewboxFloatingBarScaleTransformValueText.Text = val.ToString("F2");
}
}
// 浮动工具栏透明度
if (ViewboxFloatingBarOpacityValueSlider != null)
{
ViewboxFloatingBarOpacityValueSlider.Value = appearance.ViewboxFloatingBarOpacityValue;
if (ViewboxFloatingBarOpacityValueText != null)
{
ViewboxFloatingBarOpacityValueText.Text = appearance.ViewboxFloatingBarOpacityValue.ToString("F2");
}
}
// 浮栏在PPT下透明度
if (ViewboxFloatingBarOpacityInPPTValueSlider != null)
{
ViewboxFloatingBarOpacityInPPTValueSlider.Value = appearance.ViewboxFloatingBarOpacityInPPTValue;
if (ViewboxFloatingBarOpacityInPPTValueText != null)
{
ViewboxFloatingBarOpacityInPPTValueText.Text = appearance.ViewboxFloatingBarOpacityInPPTValue.ToString("F2");
}
}
// 在调色盘窗口中显示笔尖模式按钮
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableDisPlayNibModeToggle"), appearance.IsEnableDisPlayNibModeToggler);
// 使用老版浮动栏按钮UI
if (CheckBoxUseLegacyFloatingBarUI != null)
{
CheckBoxUseLegacyFloatingBarUI.IsChecked = appearance.UseLegacyFloatingBarUI;
}
// 浮动栏按钮显示控制
if (CheckBoxShowShapeButton != null) CheckBoxShowShapeButton.IsChecked = appearance.IsShowShapeButton;
if (CheckBoxShowUndoButton != null) CheckBoxShowUndoButton.IsChecked = appearance.IsShowUndoButton;
if (CheckBoxShowRedoButton != null) CheckBoxShowRedoButton.IsChecked = appearance.IsShowRedoButton;
if (CheckBoxShowClearButton != null) CheckBoxShowClearButton.IsChecked = appearance.IsShowClearButton;
if (CheckBoxShowWhiteboardButton != null) CheckBoxShowWhiteboardButton.IsChecked = appearance.IsShowWhiteboardButton;
if (CheckBoxShowHideButton != null) CheckBoxShowHideButton.IsChecked = appearance.IsShowHideButton;
if (CheckBoxShowQuickColorPalette != null) CheckBoxShowQuickColorPalette.IsChecked = appearance.IsShowQuickColorPalette;
if (CheckBoxShowLassoSelectButton != null) CheckBoxShowLassoSelectButton.IsChecked = appearance.IsShowLassoSelectButton;
if (CheckBoxShowClearAndMouseButton != null) CheckBoxShowClearAndMouseButton.IsChecked = appearance.IsShowClearAndMouseButton;
// 启用系统托盘图标
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableTrayIcon"), appearance.EnableTrayIcon);
// 画板UI缩放
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableViewboxBlackBoardScaleTransform"), appearance.EnableViewboxBlackBoardScaleTransform);
// 白板模式时间显示
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableTimeDisplayInWhiteboardMode"), appearance.EnableTimeDisplayInWhiteboardMode);
// 白板模式鸡汤文
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableChickenSoupInWhiteboardMode"), appearance.EnableChickenSoupInWhiteboardMode);
// 启用快捷面板
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchEnableQuickPanel"), appearance.IsShowQuickPanel);
// 退出折叠模式后自动进入批注模式
if (MainWindow.Settings.Automation != null)
{
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchAutoEnterAnnotationModeWhenExitFoldMode"), MainWindow.Settings.Automation.IsAutoEnterAnnotationModeWhenExitFoldMode);
}
// PPT放映结束后自动折叠
if (MainWindow.Settings.Automation != null)
{
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchAutoFoldAfterPPTSlideShow"), MainWindow.Settings.Automation.IsAutoFoldAfterPPTSlideShow);
}
// 退出白板模式后自动折叠
if (MainWindow.Settings.Automation != null)
{
SetToggleSwitchState(FindToggleSwitch("ToggleSwitchAutoFoldWhenExitWhiteboard"), MainWindow.Settings.Automation.IsAutoFoldWhenExitWhiteboard);
}
// 信仰の源出自Where
SetOptionButtonState("ChickenSoupSource", appearance.ChickenSoupSource);
// 取消收纳按钮图标
SetOptionButtonState("UnFoldBtnImg", appearance.UnFoldButtonImageType);
// 快捷调色盘显示模式
SetOptionButtonState("QuickColorPaletteDisplayMode", appearance.QuickColorPaletteDisplayMode);
// 橡皮按钮显示
SetOptionButtonState("EraserDisplayOption", appearance.EraserDisplayOption);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"加载个性化设置时出错: {ex.Message}");
}
_isLoaded = true;
}
/// <summary>
/// 查找ToggleSwitch控件
/// </summary>
private Border FindToggleSwitch(string name)
{
return this.FindDescendantByName(name) as Border;
}
/// <summary>
/// 设置ToggleSwitch状态
/// </summary>
private void SetToggleSwitchState(Border toggleSwitch, bool isOn)
{
if (toggleSwitch == null) return;
toggleSwitch.Background = isOn
? new SolidColorBrush(Color.FromRgb(53, 132, 228))
: (ThemeHelper.IsDarkTheme ? ThemeHelper.GetButtonBackgroundBrush() : new SolidColorBrush(Color.FromRgb(225, 225, 225)));
var innerBorder = toggleSwitch.Child as Border;
if (innerBorder != null)
{
innerBorder.HorizontalAlignment = isOn ? HorizontalAlignment.Right : HorizontalAlignment.Left;
innerBorder.Background = new SolidColorBrush(Colors.White);
}
}
private bool GetCurrentSettingValue(string tag)
{
if (MainWindow.Settings == null) return false;
try
{
switch (tag)
{
case "EnableSplashScreen":
return MainWindow.Settings.Appearance?.EnableSplashScreen ?? false;
case "EnableDisPlayNibModeToggle":
return MainWindow.Settings.Appearance?.IsEnableDisPlayNibModeToggler ?? false;
case "EnableTrayIcon":
return MainWindow.Settings.Appearance?.EnableTrayIcon ?? false;
case "EnableViewboxBlackBoardScaleTransform":
return MainWindow.Settings.Appearance?.EnableViewboxBlackBoardScaleTransform ?? false;
case "EnableTimeDisplayInWhiteboardMode":
return MainWindow.Settings.Appearance?.EnableTimeDisplayInWhiteboardMode ?? false;
case "EnableChickenSoupInWhiteboardMode":
return MainWindow.Settings.Appearance?.EnableChickenSoupInWhiteboardMode ?? false;
case "EnableQuickPanel":
return MainWindow.Settings.Appearance?.IsShowQuickPanel ?? false;
case "AutoEnterAnnotationModeWhenExitFoldMode":
return MainWindow.Settings.Automation?.IsAutoEnterAnnotationModeWhenExitFoldMode ?? false;
case "AutoFoldAfterPPTSlideShow":
return MainWindow.Settings.Automation?.IsAutoFoldAfterPPTSlideShow ?? false;
case "AutoFoldWhenExitWhiteboard":
return MainWindow.Settings.Automation?.IsAutoFoldWhenExitWhiteboard ?? false;
default:
return false;
}
}
catch
{
return false;
}
}
/// <summary>
/// ToggleSwitch点击事件处理
/// </summary>
private void ToggleSwitch_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
string tag = border.Tag?.ToString();
if (string.IsNullOrEmpty(tag)) return;
bool currentState = GetCurrentSettingValue(tag);
bool newState = !currentState;
SetToggleSwitchState(border, newState);
var appearance = MainWindow.Settings.Appearance;
if (appearance == null) return;
switch (tag)
{
case "EnableSplashScreen":
// 调用 MainWindow 中的方法(带主题检查)
MainWindowSettingsHelper.InvokeToggleSwitchToggledWithThemeCheck("ToggleSwitchEnableSplashScreen", newState);
// 更新UI状态
if (SplashScreenStylePanel != null)
{
SplashScreenStylePanel.Visibility = newState ? Visibility.Visible : Visibility.Collapsed;
}
break;
case "EnableDisPlayNibModeToggle":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableDisPlayNibModeToggle", newState);
break;
case "EnableTrayIcon":
// 调用 MainWindow 中的方法(带主题检查)
MainWindowSettingsHelper.InvokeToggleSwitchToggledWithThemeCheck("ToggleSwitchEnableTrayIcon", newState);
// 更新系统托盘图标可见性
var taskbar = Application.Current.Resources["TaskbarTrayIcon"] as TaskbarIcon;
if (taskbar != null)
{
taskbar.Visibility = newState ? Visibility.Visible : Visibility.Collapsed;
}
break;
case "EnableViewboxBlackBoardScaleTransform":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableViewboxBlackBoardScaleTransform", newState);
break;
case "EnableTimeDisplayInWhiteboardMode":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableTimeDisplayInWhiteboardMode", newState);
break;
case "EnableChickenSoupInWhiteboardMode":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableChickenSoupInWhiteboardMode", newState);
break;
case "EnableQuickPanel":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchEnableQuickPanel", newState);
break;
case "AutoEnterAnnotationModeWhenExitFoldMode":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAutoEnterAnnotationModeWhenExitFoldMode", newState);
break;
case "AutoFoldAfterPPTSlideShow":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAutoFoldAfterPPTSlideShow", newState);
break;
case "AutoFoldWhenExitWhiteboard":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAutoFoldWhenExitWhiteboard", newState);
break;
}
}
/// <summary>
/// ComboBox选择变化事件处理
/// </summary>
private void ComboBoxSplashScreenStyle_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!_isLoaded) return;
if (ComboBoxSplashScreenStyle?.SelectedIndex >= 0)
{
// 调用 MainWindow 中的方法(带主题检查)
MainWindowSettingsHelper.InvokeComboBoxSelectionChangedWithThemeCheck("ComboBoxSplashScreenStyle", ComboBoxSplashScreenStyle.SelectedItem);
}
}
private void ComboBoxFloatingBarImg_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!_isLoaded) return;
if (ComboBoxFloatingBarImg?.SelectedIndex >= 0)
{
// 调用 MainWindow 中的方法(带主题检查)
MainWindowSettingsHelper.InvokeComboBoxSelectionChangedWithThemeCheck("ComboBoxFloatingBarImg", ComboBoxFloatingBarImg.SelectedItem);
}
}
/// <summary>
/// Slider值变化事件处理
/// </summary>
private void ViewboxFloatingBarScaleTransformValueSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
if (ViewboxFloatingBarScaleTransformValueSlider != null && ViewboxFloatingBarScaleTransformValueText != null)
{
double val = ViewboxFloatingBarScaleTransformValueSlider.Value;
ViewboxFloatingBarScaleTransformValueText.Text = val.ToString("F2");
// 调用 MainWindow 中的方法(会自动检查主题更新)
MainWindowSettingsHelper.InvokeSliderValueChanged("ViewboxFloatingBarScaleTransformValueSlider", val);
}
}
private void ViewboxFloatingBarOpacityValueSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
if (ViewboxFloatingBarOpacityValueSlider != null && ViewboxFloatingBarOpacityValueText != null)
{
double val = ViewboxFloatingBarOpacityValueSlider.Value;
ViewboxFloatingBarOpacityValueText.Text = val.ToString("F2");
// 调用 MainWindow 中的方法(会自动检查主题更新)
MainWindowSettingsHelper.InvokeSliderValueChanged("ViewboxFloatingBarOpacityValueSlider", val);
}
}
private void ViewboxFloatingBarOpacityInPPTValueSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_isLoaded) return;
if (ViewboxFloatingBarOpacityInPPTValueSlider != null && ViewboxFloatingBarOpacityInPPTValueText != null)
{
double val = ViewboxFloatingBarOpacityInPPTValueSlider.Value;
ViewboxFloatingBarOpacityInPPTValueText.Text = val.ToString("F2");
// 调用 MainWindow 中的方法(会自动检查主题更新)
MainWindowSettingsHelper.InvokeSliderValueChanged("ViewboxFloatingBarOpacityInPPTValueSlider", val);
}
}
/// <summary>
/// CheckBox变化事件处理
/// </summary>
private void CheckBox_CheckedChanged(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var checkBox = sender as CheckBox;
if (checkBox == null) return;
string name = checkBox.Name;
var appearance = MainWindow.Settings.Appearance;
if (appearance == null) return;
switch (name)
{
case "CheckBoxUseLegacyFloatingBarUI":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeCheckBoxCheckedChanged("CheckBoxUseLegacyFloatingBarUI", checkBox.IsChecked ?? false);
break;
case "CheckBoxShowShapeButton":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeCheckBoxCheckedChanged("CheckBoxShowShapeButton", checkBox.IsChecked ?? false);
break;
case "CheckBoxShowUndoButton":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeCheckBoxCheckedChanged("CheckBoxShowUndoButton", checkBox.IsChecked ?? false);
break;
case "CheckBoxShowRedoButton":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeCheckBoxCheckedChanged("CheckBoxShowRedoButton", checkBox.IsChecked ?? false);
break;
case "CheckBoxShowClearButton":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeCheckBoxCheckedChanged("CheckBoxShowClearButton", checkBox.IsChecked ?? false);
break;
case "CheckBoxShowWhiteboardButton":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeCheckBoxCheckedChanged("CheckBoxShowWhiteboardButton", checkBox.IsChecked ?? false);
break;
case "CheckBoxShowHideButton":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeCheckBoxCheckedChanged("CheckBoxShowHideButton", checkBox.IsChecked ?? false);
break;
case "CheckBoxShowQuickColorPalette":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeCheckBoxCheckedChanged("CheckBoxShowQuickColorPalette", checkBox.IsChecked ?? false);
break;
case "CheckBoxShowLassoSelectButton":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeCheckBoxCheckedChanged("CheckBoxShowLassoSelectButton", checkBox.IsChecked ?? false);
break;
case "CheckBoxShowClearAndMouseButton":
// 调用 MainWindow 中的方法
MainWindowSettingsHelper.InvokeCheckBoxCheckedChanged("CheckBoxShowClearAndMouseButton", checkBox.IsChecked ?? false);
break;
}
}
private void SetOptionButtonState(string group, int selectedIndex)
{
var buttons = new Dictionary<string, string[]>
{
{ "Theme", new[] { "Light", "Dark", "System" } },
{ "ChickenSoupSource", new[] { "Osu", "Motivational", "Gaokao", "Hitokoto" } },
{ "UnFoldBtnImg", new[] { "Arrow", "Pen" } },
{ "QuickColorPaletteDisplayMode", new[] { "Single", "Double" } },
{ "EraserDisplayOption", new[] { "Both", "Area", "Line", "None" } }
};
if (!buttons.ContainsKey(group)) return;
string[] buttonNames = buttons[group];
bool isDarkTheme = ThemeHelper.IsDarkTheme;
var selectedBrush = isDarkTheme ? new SolidColorBrush(Color.FromRgb(25, 25, 25)) : new SolidColorBrush(Color.FromRgb(225, 225, 225));
var unselectedBrush = new SolidColorBrush(Colors.Transparent);
for (int i = 0; i < buttonNames.Length; i++)
{
var button = this.FindDescendantByName($"{group}{buttonNames[i]}Border") as Border;
if (button != null)
{
if (i == selectedIndex)
{
button.Background = selectedBrush;
var textBlock = button.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Bold;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
else
{
button.Background = unselectedBrush;
var textBlock = button.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Normal;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
}
}
}
/// <summary>
/// 选项按钮点击事件处理
/// </summary>
private void OptionButton_Click(object sender, RoutedEventArgs e)
{
if (!_isLoaded) return;
var border = sender as Border;
if (border == null) return;
string tag = border.Tag?.ToString();
if (string.IsNullOrEmpty(tag)) return;
string[] parts = tag.Split('_');
if (parts.Length < 2) return;
string group = parts[0];
string value = parts[1];
bool isDarkTheme = ThemeHelper.IsDarkTheme;
var selectedBrush = isDarkTheme ? new SolidColorBrush(Color.FromRgb(25, 25, 25)) : new SolidColorBrush(Color.FromRgb(225, 225, 225));
var unselectedBrush = new SolidColorBrush(Colors.Transparent);
var parent = border.Parent as Panel;
if (parent != null)
{
foreach (var child in parent.Children)
{
if (child is Border childBorder && childBorder != border)
{
string childTag = childBorder.Tag?.ToString();
if (!string.IsNullOrEmpty(childTag) && childTag.StartsWith(group + "_"))
{
childBorder.Background = unselectedBrush;
var textBlock = childBorder.Child as TextBlock;
if (textBlock != null)
{
textBlock.FontWeight = FontWeights.Normal;
textBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
}
}
}
}
border.Background = selectedBrush;
var currentTextBlock = border.Child as TextBlock;
if (currentTextBlock != null)
{
currentTextBlock.FontWeight = FontWeights.Bold;
currentTextBlock.Foreground = ThemeHelper.GetTextPrimaryBrush();
}
var appearance = MainWindow.Settings.Appearance;
if (appearance == null) return;
switch (group)
{
case "Theme":
// 通过 MainWindowSettingsHelper 调用 ComboBoxTheme 的 SelectionChanged 事件处理器
try
{
var mainWindow = Application.Current.MainWindow as MainWindow;
if (mainWindow != null)
{
var comboBox = mainWindow.FindName("ComboBoxTheme") as System.Windows.Controls.ComboBox;
if (comboBox != null)
{
// 根据 value 找到对应的 ComboBoxItem
int themeIndex;
switch (value)
{
case "Light":
themeIndex = 0;
break;
case "Dark":
themeIndex = 1;
break;
case "System":
themeIndex = 2;
break;
default:
themeIndex = 2;
break;
}
if (comboBox.Items.Count > themeIndex)
{
var selectedItem = comboBox.Items[themeIndex];
MainWindowSettingsHelper.InvokeComboBoxSelectionChangedWithThemeCheck("ComboBoxTheme", selectedItem);
}
else
{
// 如果找不到控件,直接更新设置并通知主题更新
MainWindowSettingsHelper.UpdateSettingSafely(() =>
{
appearance.Theme = themeIndex;
}, "ComboBoxTheme_SelectionChanged", "ComboBoxTheme");
MainWindowSettingsHelper.NotifyThemeUpdateIfNeeded("ComboBoxTheme");
// 触发主题变化事件,通知设置窗口更新主题
ThemeChanged?.Invoke(this, new RoutedEventArgs());
}
}
else
{
// 如果找不到控件,直接更新设置并通知主题更新
int themeIndex;
switch (value)
{
case "Light":
themeIndex = 0;
break;
case "Dark":
themeIndex = 1;
break;
case "System":
themeIndex = 2;
break;
default:
themeIndex = 2;
break;
}
MainWindowSettingsHelper.UpdateSettingSafely(() =>
{
appearance.Theme = themeIndex;
}, "ComboBoxTheme_SelectionChanged", "ComboBoxTheme");
MainWindowSettingsHelper.NotifyThemeUpdateIfNeeded("ComboBoxTheme");
// 触发主题变化事件,通知设置窗口更新主题
ThemeChanged?.Invoke(this, new RoutedEventArgs());
}
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"切换主题时出错: {ex.Message}");
}
break;
case "ChickenSoupSource":
int sourceIndex;
switch (value)
{
case "Osu":
sourceIndex = 0;
break;
case "Motivational":
sourceIndex = 1;
break;
case "Gaokao":
sourceIndex = 2;
break;
case "Hitokoto":
sourceIndex = 3;
break;
default:
sourceIndex = 3;
break;
}
// 调用 MainWindow 中的方法
var mainWindow6 = Application.Current.MainWindow as MainWindow;
if (mainWindow6 != null)
{
var comboBox = mainWindow6.FindName("ComboBoxChickenSoupSource") as System.Windows.Controls.ComboBox;
if (comboBox != null && comboBox.Items.Count > sourceIndex)
{
comboBox.SelectedIndex = sourceIndex;
MainWindowSettingsHelper.InvokeComboBoxSelectionChanged("ComboBoxChickenSoupSource", comboBox.Items[sourceIndex]);
}
else
{
// 如果找不到控件,直接更新设置
MainWindowSettingsHelper.UpdateSettingDirectly(() =>
{
appearance.ChickenSoupSource = sourceIndex;
}, "ComboBoxChickenSoupSource");
}
}
break;
case "UnFoldBtnImg":
int imgType;
switch (value)
{
case "Arrow":
imgType = 0;
break;
case "Pen":
imgType = 1;
break;
default:
imgType = 0;
break;
}
// 调用 MainWindow 中的方法(带主题检查)
var mainWindow3 = Application.Current.MainWindow as MainWindow;
if (mainWindow3 != null)
{
var comboBox = mainWindow3.FindName("ComboBoxUnFoldBtnImg") as System.Windows.Controls.ComboBox;
if (comboBox != null && comboBox.Items.Count > imgType)
{
comboBox.SelectedIndex = imgType;
MainWindowSettingsHelper.InvokeComboBoxSelectionChangedWithThemeCheck("ComboBoxUnFoldBtnImg", comboBox.Items[imgType]);
}
else
{
// 如果找不到控件,直接更新设置并通知主题更新
MainWindowSettingsHelper.UpdateSettingSafely(() =>
{
appearance.UnFoldButtonImageType = imgType;
}, "ComboBoxUnFoldBtnImg_SelectionChanged", "ComboBoxUnFoldBtnImg");
MainWindowSettingsHelper.NotifyThemeUpdateIfNeeded("ComboBoxUnFoldBtnImg");
}
}
break;
case "QuickColorPaletteDisplayMode":
int displayMode;
switch (value)
{
case "Single":
displayMode = 0;
break;
case "Double":
displayMode = 1;
break;
default:
displayMode = 1;
break;
}
// 调用 MainWindow 中的方法
var mainWindow4 = Application.Current.MainWindow as MainWindow;
if (mainWindow4 != null)
{
var comboBox = mainWindow4.FindName("ComboBoxQuickColorPaletteDisplayMode") as System.Windows.Controls.ComboBox;
if (comboBox != null && comboBox.Items.Count > displayMode)
{
comboBox.SelectedIndex = displayMode;
MainWindowSettingsHelper.InvokeComboBoxSelectionChanged("ComboBoxQuickColorPaletteDisplayMode", comboBox.Items[displayMode]);
}
else
{
// 如果找不到控件,直接更新设置
MainWindowSettingsHelper.UpdateSettingDirectly(() =>
{
appearance.QuickColorPaletteDisplayMode = displayMode;
}, "ComboBoxQuickColorPaletteDisplayMode");
}
}
break;
case "EraserDisplayOption":
int eraserOption;
switch (value)
{
case "Both":
eraserOption = 0;
break;
case "Area":
eraserOption = 1;
break;
case "Line":
eraserOption = 2;
break;
case "None":
eraserOption = 3;
break;
default:
eraserOption = 0;
break;
}
// 调用 MainWindow 中的方法
var mainWindow5 = Application.Current.MainWindow as MainWindow;
if (mainWindow5 != null)
{
var comboBox = mainWindow5.FindName("ComboBoxEraserDisplayOption") as System.Windows.Controls.ComboBox;
if (comboBox != null && comboBox.Items.Count > eraserOption)
{
comboBox.SelectedIndex = eraserOption;
MainWindowSettingsHelper.InvokeComboBoxSelectionChanged("ComboBoxEraserDisplayOption", comboBox.Items[eraserOption]);
}
else
{
// 如果找不到控件,直接更新设置
MainWindowSettingsHelper.UpdateSettingDirectly(() =>
{
appearance.EraserDisplayOption = eraserOption;
}, "ComboBoxEraserDisplayOption");
}
}
break;
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
if (_isLoaded)
{
LoadSettings();
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"ThemePanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,150 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.TimerPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<UserControl.Resources>
<!-- 开关样式模板 -->
<Style x:Key="ToggleSwitchStyle" TargetType="Border">
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="25"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="3,0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,0,15,0"/>
</Style>
</UserControl.Resources>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="ScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<!-- 计时器UI设置 -->
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="计时器UI设置" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<!-- Description = 使用旧版本的计时器按钮界面 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="使用老版计时器按钮UI" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=TimerPanel_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchUseLegacyTimerUI" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 使用新样式的计时器界面 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="新计时器UI" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=TimerPanel_Hint_1}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchUseNewStyleUI" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 计时器超时后继续正向计时 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="启用正计时" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=TimerPanel_Hint_2}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableOvertimeCountUp" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 计时器超时后数字显示为红色 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="超时醒目数字" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=TimerPanel_Hint_3}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableOvertimeRedText" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
</StackPanel>
</Border>
<!-- 提醒设置 -->
<Border Margin="0,25,0,0" BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="8">
<StackPanel Orientation="Vertical" Margin="18,18,18,18">
<TextBlock Text="提醒设置" FontWeight="Bold" Foreground="#2e3436" FontSize="18" Margin="0,0,0,12"/>
<!-- Description = 设置计时器提醒音的音量 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="计时器提醒音量" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=TimerPanel_Hint_4}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="TimerVolumeSlider" Width="150" Minimum="0" Maximum="1" Value="1" TickFrequency="0.1" IsSnapToTickEnabled="True"/>
<TextBlock x:Name="TimerVolumeText" Text="100%" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436" FontFamily="Consolas"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<StackPanel Orientation="Horizontal" Margin="0,8,0,0">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自定义提醒铃声" VerticalAlignment="Center" Margin="0,0,12,0"/>
<Button x:Name="ButtonSelectCustomTimerSound" Content="选择文件" Padding="10,3" Margin="0,0,8,0" Background="#2563eb" Foreground="White"/>
<Button x:Name="ButtonResetTimerSound" Content="重置" Padding="10,3" Background="#2563eb" Foreground="White"/>
</StackPanel>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 启用渐进式提醒功能 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="渐进提醒" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=TimerPanel_Hint_5}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchEnableProgressiveReminder" Style="{StaticResource ToggleSwitchStyle}" Background="#e1e1e1">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<!-- Description = 设置渐进提醒音的音量 -->
<Grid Height="54" x:Name="ProgressiveReminderVolumePanel" Visibility="Collapsed">
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="渐进提醒音量" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=TimerPanel_Hint_6}" HorizontalAlignment="Left"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0">
<Slider x:Name="ProgressiveReminderVolumeSlider" Width="150" Minimum="0" Maximum="1" Value="1" TickFrequency="0.1" IsSnapToTickEnabled="True"/>
<TextBlock x:Name="ProgressiveReminderVolumeText" Text="100%" VerticalAlignment="Center" FontSize="14" Margin="12,0,0,0" Foreground="#2e3436" FontFamily="Consolas"/>
</StackPanel>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,8,0,8"/>
<StackPanel Orientation="Horizontal" Margin="0,8,0,0" x:Name="ProgressiveReminderSoundPanel" Visibility="Collapsed">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自定义渐进提醒音频" VerticalAlignment="Center" Margin="0,0,12,0"/>
<Button x:Name="ButtonSelectCustomProgressiveReminderSound" Content="选择文件" Padding="10,3" Margin="0,0,8,0" Background="#2563eb" Foreground="White"/>
<Button x:Name="ButtonResetProgressiveReminderSound" Content="重置" Padding="10,3" Background="#2563eb" Foreground="White"/>
</StackPanel>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -1,49 +0,0 @@
using System;
using System.Windows;
using System.Windows.Controls;
namespace Ink_Canvas.Windows.SettingsViews
{
/// <summary>
/// TimerPanel.xaml 的交互逻辑
/// </summary>
public partial class TimerPanel : UserControl
{
public TimerPanel()
{
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());
}
}
/// <summary>
/// 应用主题
/// </summary>
public void ApplyTheme()
{
try
{
ThemeHelper.ApplyThemeToControl(this);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"TimerPanel 应用主题时出错: {ex.Message}");
}
}
}
}
@@ -1,366 +0,0 @@
<UserControl xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions" x:Class="Ink_Canvas.Windows.SettingsViews.UpdateCenterPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:mdxam="clr-namespace:MdXaml;assembly=MdXaml"
mc:Ignorable="d"
d:DesignHeight="950" d:DesignWidth="640">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ComboBoxStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ToggleSwitchStyle" TargetType="Border">
<Setter Property="Width" Value="48"/>
<Setter Property="Height" Value="25"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Padding" Value="3,0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Margin" Value="0,0,15,0"/>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<ScrollViewer ScrollChanged="ScrollViewerEx_ScrollChanged" IsManipulationEnabled="True" Name="UpdateCenterScrollViewerEx" IsDeferredScrollingEnabled="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" IsTabStop="False" TabIndex="-1" Margin="0,0,2,2" PanningMode="VerticalOnly">
<StackPanel Margin="60,12,60,24">
<TextBlock Foreground="#2e3436" FontSize="28" FontWeight="Bold" Text="更新中心" Margin="0,0,0,24"/>
<StackPanel Orientation="Horizontal" Margin="0,0,0,20">
<Border x:Name="TabUpdate" Padding="20,12" CornerRadius="8,8,0,0" Cursor="Hand" MouseLeftButtonDown="Tab_Click" Tag="Update" Background="#e1e1e1">
<TextBlock Foreground="#2e3436" FontSize="16" FontWeight="Bold" Text="更新"/>
</Border>
<Border x:Name="TabRollback" Padding="20,12" CornerRadius="8,8,0,0" Cursor="Hand" MouseLeftButtonDown="Tab_Click" Tag="Rollback" Background="Transparent" Margin="2,0,0,0">
<TextBlock Foreground="#2e3436" FontSize="16" Text="回滚"/>
</Border>
<Border x:Name="TabSettings" Padding="20,12" CornerRadius="8,8,0,0" Cursor="Hand" MouseLeftButtonDown="Tab_Click" Tag="Settings" Background="Transparent" Margin="2,0,0,0">
<TextBlock Foreground="#2e3436" FontSize="16" Text="设置"/>
</Border>
</StackPanel>
<Border BorderBrush="#e6e6e6" BorderThickness="1.25,1.25,1.25,4" CornerRadius="0,8,8,8" Background="#FAFAFA">
<StackPanel>
<StackPanel x:Name="UpdateTabContent" Margin="18,18,18,18">
<Border BorderBrush="#e6e6e6" BorderThickness="1" CornerRadius="8" Padding="20" Background="#FFFFFF" Margin="0,0,0,20">
<StackPanel>
<TextBlock Name="UpdateStatusText" Foreground="#2e3436" FontSize="18" FontWeight="SemiBold" Text="正在检查更新..." TextWrapping="Wrap" Margin="0,0,0,8"/>
<TextBlock Name="LastCheckTimeText" Foreground="#878787" FontSize="14" Text="上次检查时间: 从未" TextWrapping="Wrap" Margin="0,0,0,8"/>
<StackPanel Orientation="Horizontal" Margin="0,0,0,8">
<TextBlock Name="CurrentVersionText" Foreground="#878787" FontSize="14" Text="当前版本: 正在获取..." TextWrapping="Wrap" VerticalAlignment="Center"/>
<ui:ProgressRing Name="LoadingSpinner" Width="16" Height="16" IsActive="False" Margin="12,0,0,0" VerticalAlignment="Center"/>
</StackPanel>
<Button Name="CheckUpdateButton" Content="检查更新" HorizontalAlignment="Left" Padding="20,10" FontSize="14" Cursor="Hand" Click="CheckUpdateButton_Click" Background="#F3F3F3" Foreground="#2e3436" BorderThickness="1" BorderBrush="#E1E1E1" Margin="0,8,0,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
</Button>
</StackPanel>
</Border>
<StackPanel Name="UpdateAvailablePanel" Visibility="Collapsed" Margin="0,0,0,20">
<Border x:Name="UpdateAvailableBorder" BorderThickness="1" CornerRadius="8" Padding="16">
<StackPanel>
<TextBlock Foreground="#2e3436" FontSize="16" FontWeight="SemiBold" Text="可用更新" Margin="0,0,0,8"/>
<TextBlock Name="LatestVersionText" Foreground="#878787" FontSize="14" Text="" TextWrapping="Wrap" Margin="0,0,0,16"/>
<ikw:SimpleStackPanel Orientation="Vertical" Spacing="12">
<Button Name="UpdateNowButton" Content="立即下载并安装" HorizontalAlignment="Left" Padding="20,10" FontSize="14" FontWeight="SemiBold" Cursor="Hand" Click="UpdateNowButton_Click" Background="#2563eb" Foreground="White" BorderThickness="0" Height="40" MinWidth="200">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#1d4ed8"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#1e40af"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="#9ca3af"/>
<Setter Property="Foreground" Value="#d1d5db"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<Button Name="UpdateLaterButton" Content="下载并在软件关闭时安装" HorizontalAlignment="Left" Padding="20,10" FontSize="14" FontWeight="Medium" Cursor="Hand" Click="UpdateLaterButton_Click" BorderThickness="1" Height="40" MinWidth="200">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6" Padding="{TemplateBinding Padding}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="#2563eb" Opacity="0.1"/>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="#2563eb" Opacity="0.2"/>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<Button Name="SkipVersionButton" Content="跳过该版本" HorizontalAlignment="Left" Padding="20,10" FontSize="14" FontWeight="Medium" Cursor="Hand" Click="SkipVersionButton_Click" Background="Transparent" BorderThickness="0" Height="40" MinWidth="200">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="#2563eb" Opacity="0.1"/>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Color="#2563eb" Opacity="0.2"/>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
</ikw:SimpleStackPanel>
</StackPanel>
</Border>
</StackPanel>
<Border BorderBrush="#e6e6e6" BorderThickness="1" CornerRadius="8" Padding="16" Background="#FFFFFF" Margin="0,0,0,20">
<StackPanel>
<TextBlock Foreground="#2e3436" FontSize="16" FontWeight="SemiBold" Text="更新日志" Margin="0,0,0,12"/>
<ScrollViewer MaxHeight="300" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<mdxam:MarkdownScrollViewer x:Name="UpdateLogViewer" Markdown="暂无更新日志" />
</ScrollViewer>
</StackPanel>
</Border>
<!-- Description = 选择要回滚到的历史版本 -->
<Grid Height="54" Margin="0,0,0,16">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" Margin="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0" MaxWidth="350">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="软件架构" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="选择更新架构" HorizontalAlignment="Left" TextWrapping="Wrap"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" Grid.Column="1">
<Border x:Name="UpdateArchX86Border" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="UpdateArch_X86" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="32 位 (x86)"/>
</Border>
<Border x:Name="UpdateArchX64Border" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="UpdateArch_X64" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="64 位 (x64)"/>
</Border>
</WrapPanel>
</Grid>
<Grid Height="54">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" Margin="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0" MaxWidth="350">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="更新通道" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="选择更新通道:稳定版提供可靠更新,预览版提供新功能体验,测试版提供新功能抢先体验" HorizontalAlignment="Left" TextWrapping="Wrap"/>
</StackPanel>
<WrapPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" Grid.Column="1">
<Border x:Name="UpdateChannelReleaseBorder" Padding="13,7" CornerRadius="8" Background="#e1e1e1" Cursor="Hand" Tag="UpdateChannel_Release" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" FontWeight="Bold" Text="稳定版"/>
</Border>
<Border x:Name="UpdateChannelPreviewBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="UpdateChannel_Preview" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="预览版"/>
</Border>
<Border x:Name="UpdateChannelBetaBorder" Padding="13,7" CornerRadius="8" Cursor="Hand" Tag="UpdateChannel_Beta" Margin="0,0,8,8" MouseLeftButtonDown="OptionButton_Click">
<TextBlock Foreground="#2e3436" FontSize="14" Text="测试版"/>
</Border>
</WrapPanel>
</Grid>
</StackPanel>
<StackPanel x:Name="RollbackTabContent" Visibility="Collapsed" Margin="18,18,18,18">
<Border BorderBrush="#e6e6e6" BorderThickness="1" CornerRadius="8" Padding="16" Background="#FFFFFF" Margin="0,0,0,20">
<StackPanel>
<TextBlock Foreground="#2e3436" FontSize="16" FontWeight="SemiBold" Text="历史版本" Margin="0,0,0,12"/>
<ScrollViewer MaxHeight="300" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<mdxam:MarkdownScrollViewer x:Name="HistoryLogViewer" Markdown="正在加载历史版本..." />
</ScrollViewer>
</StackPanel>
</Border>
<Grid Height="54" Margin="0,0,0,20">
<StackPanel Orientation="Vertical" Margin="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="选择回滚版本" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=UpdateCenterPanel_Hint}" HorizontalAlignment="Left"/>
</StackPanel>
<ComboBox x:Name="RollbackVersionComboBox"
Style="{StaticResource ComboBoxStyle}"
ItemContainerStyle="{StaticResource ComboBoxItemStyle}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Width="200"
Margin="0,0,15,0"
SelectionChanged="RollbackVersionComboBox_SelectionChanged"/>
</Grid>
<!-- Description = 回滚到下拉框中选择的版本 -->
<Grid Height="54" Margin="0,0,0,20">
<StackPanel Orientation="Vertical" Margin="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="回滚到选中版本" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=UpdateCenterPanel_Hint_1}" HorizontalAlignment="Left"/>
</StackPanel>
<Button x:Name="RollbackButton" Content="回滚" Width="120" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" Padding="12,6" Click="RollbackButton_Click"/>
</Grid>
<!-- Description = 根据当前选择的通道下载最新版本并执行安装,可用于修复损坏的安装 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="版本修复" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=UpdateCenterPanel_Hint_2}" HorizontalAlignment="Left"/>
</StackPanel>
<Button x:Name="FixVersionButton" Content="版本修复" Width="120" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,15,0" Padding="12,6" Click="FixVersionButton_Click"/>
</Grid>
</StackPanel>
<StackPanel x:Name="SettingsTabContent" Visibility="Collapsed" Margin="18,18,18,18">
<!-- Description = 定期检查是否有新版本可用 -->
<Grid Height="54">
<StackPanel Orientation="Vertical" Margin="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="自动检查更新" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=UpdateCenterPanel_Hint_3}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsAutoUpdate" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="IsAutoUpdate" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,0,0,0"/>
<!-- Description = 在软件不使用时自动安装更新,无需手动操作 -->
<Grid Height="54" x:Name="AutoUpdateWithSilencePanel">
<StackPanel Orientation="Vertical" Margin="0,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="静默更新" HorizontalAlignment="Left"/>
<TextBlock Foreground="#9a9996" FontSize="11" Margin="0,3.5,0,0" Text="{i18n:I18n Key=UpdateCenterPanel_Hint_4}" HorizontalAlignment="Left"/>
</StackPanel>
<Border x:Name="ToggleSwitchIsAutoUpdateWithSilence" Style="{StaticResource ToggleSwitchStyle}" Background="#3584e4" Tag="IsAutoUpdateWithSilence" MouseLeftButtonDown="ToggleSwitch_Click">
<Border Width="19" Height="19" Background="White" CornerRadius="10" HorizontalAlignment="Right" VerticalAlignment="Center">
<Border.Effect>
<DropShadowEffect BlurRadius="4" Direction="-45" Color="Black" Opacity="0.3" ShadowDepth="0"/>
</Border.Effect>
</Border>
</Border>
</Grid>
<Border Height="1" Background="#ebebeb" Margin="0,0,0,0" x:Name="AutoUpdateTimePeriodSeparator"/>
<Grid Margin="0,12,0,12" x:Name="AutoUpdateTimePeriodBlock">
<StackPanel>
<TextBlock Text="静默更新时间段" FontSize="15" FontWeight="Bold" Foreground="#2e3436" Margin="0,0,0,12"/>
<StackPanel>
<StackPanel Orientation="Vertical" Margin="0,0,0,12">
<TextBlock Text="起始时间" FontSize="14" Foreground="#2e3436" Margin="0,0,0,8"/>
<ComboBox x:Name="AutoUpdateWithSilenceStartTimeComboBox"
Style="{StaticResource ComboBoxStyle}"
ItemContainerStyle="{StaticResource ComboBoxItemStyle}"
HorizontalAlignment="Left"
Width="150"
SelectedIndex="6"
SelectionChanged="AutoUpdateWithSilenceStartTimeComboBox_SelectionChanged">
<ComboBoxItem Content="00:00" Tag="00"/>
<ComboBoxItem Content="01:00" Tag="01"/>
<ComboBoxItem Content="02:00" Tag="02"/>
<ComboBoxItem Content="03:00" Tag="03"/>
<ComboBoxItem Content="04:00" Tag="04"/>
<ComboBoxItem Content="05:00" Tag="05"/>
<ComboBoxItem Content="06:00" Tag="06" IsSelected="True"/>
<ComboBoxItem Content="07:00" Tag="07"/>
<ComboBoxItem Content="08:00" Tag="08"/>
<ComboBoxItem Content="09:00" Tag="09"/>
<ComboBoxItem Content="10:00" Tag="10"/>
<ComboBoxItem Content="11:00" Tag="11"/>
<ComboBoxItem Content="12:00" Tag="12"/>
<ComboBoxItem Content="13:00" Tag="13"/>
<ComboBoxItem Content="14:00" Tag="14"/>
<ComboBoxItem Content="15:00" Tag="15"/>
<ComboBoxItem Content="16:00" Tag="16"/>
<ComboBoxItem Content="17:00" Tag="17"/>
<ComboBoxItem Content="18:00" Tag="18"/>
<ComboBoxItem Content="19:00" Tag="19"/>
<ComboBoxItem Content="20:00" Tag="20"/>
<ComboBoxItem Content="21:00" Tag="21"/>
<ComboBoxItem Content="22:00" Tag="22"/>
<ComboBoxItem Content="23:00" Tag="23"/>
</ComboBox>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,0,0,0">
<TextBlock Text="终止时间" FontSize="14" Foreground="#2e3436" Margin="0,0,0,8"/>
<ComboBox x:Name="AutoUpdateWithSilenceEndTimeComboBox"
Style="{StaticResource ComboBoxStyle}"
ItemContainerStyle="{StaticResource ComboBoxItemStyle}"
HorizontalAlignment="Left"
Width="150"
SelectedIndex="22"
SelectionChanged="AutoUpdateWithSilenceEndTimeComboBox_SelectionChanged">
<ComboBoxItem Content="00:00" Tag="00"/>
<ComboBoxItem Content="01:00" Tag="01"/>
<ComboBoxItem Content="02:00" Tag="02"/>
<ComboBoxItem Content="03:00" Tag="03"/>
<ComboBoxItem Content="04:00" Tag="04"/>
<ComboBoxItem Content="05:00" Tag="05"/>
<ComboBoxItem Content="06:00" Tag="06"/>
<ComboBoxItem Content="07:00" Tag="07"/>
<ComboBoxItem Content="08:00" Tag="08"/>
<ComboBoxItem Content="09:00" Tag="09"/>
<ComboBoxItem Content="10:00" Tag="10"/>
<ComboBoxItem Content="11:00" Tag="11"/>
<ComboBoxItem Content="12:00" Tag="12"/>
<ComboBoxItem Content="13:00" Tag="13"/>
<ComboBoxItem Content="14:00" Tag="14"/>
<ComboBoxItem Content="15:00" Tag="15"/>
<ComboBoxItem Content="16:00" Tag="16"/>
<ComboBoxItem Content="17:00" Tag="17"/>
<ComboBoxItem Content="18:00" Tag="18"/>
<ComboBoxItem Content="19:00" Tag="19"/>
<ComboBoxItem Content="20:00" Tag="20"/>
<ComboBoxItem Content="21:00" Tag="21"/>
<ComboBoxItem Content="22:00" Tag="22" IsSelected="True"/>
<ComboBoxItem Content="23:00" Tag="23"/>
</ComboBox>
</StackPanel>
</StackPanel>
<TextBlock Margin="0,8,0,0" Text="若终止时间小于起始时间,即将终止时间视为第二天的时间。若起始时间与终止时间相同,即视为全天候时间。"
TextWrapping="Wrap" Foreground="#9a9996" FontSize="11"/>
</StackPanel>
</Grid>
</StackPanel>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
</Grid>
</UserControl>
File diff suppressed because it is too large Load Diff
@@ -1,894 +0,0 @@
<Window x:Class="Ink_Canvas.Windows.SettingsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:settingsViews="clr-namespace:Ink_Canvas.Windows.SettingsViews"
WindowStartupLocation="CenterScreen" d:DesignHeight="19198"
mc:Ignorable="d" WindowStyle="None" ResizeMode="CanMinimize" Background="Transparent"
Title="InkCanvasForClass 设置" Height="691" Width="910" UseLayoutRounding="False">
<Window.Resources>
<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="IsTabStop" Value="false"/>
<EventSetter Event="PreviewMouseDown" Handler="ScrollbarThumb_MouseDown"/>
<EventSetter Event="PreviewMouseUp" Handler="ScrollbarThumb_MouseUp"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border Name="ScrollbarThumbEx"
SnapsToDevicePixels="True"
Background="#c3c3c3"
Opacity="0.5"
CornerRadius="1.5"
Height="{TemplateBinding Height}"
Width="3" HorizontalAlignment="Center"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type ScrollBar}">
<EventSetter Event="Scroll" Handler="ScrollBar_Scroll"/>
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
<Setter Property="Width" Value="8"/>
<Setter Property="Margin" Value="-6 3 0 0" />
<Setter Property="MinWidth" Value="{Binding Height, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollBar}">
<Grid x:Name="ScrollbarGrid" SnapsToDevicePixels="true">
<Border Width="3" CornerRadius="1.5" Background="#e0e0e0" Opacity="0" IsHitTestVisible="False" Margin="0 4 -2 4" x:Name="ScrollBarBorderTrackBackground"/>
<Border Padding="0 4" Background="Transparent" MouseEnter="ScrollBarTrack_MouseEnter"
MouseLeave="ScrollBarTrack_MouseLeave">
<Track x:Name="PART_Track"
IsDirectionReversed="true"
IsEnabled="True"
Width="6"
Margin="0,0,0,0"
HorizontalAlignment="Right">
<Track.DecreaseRepeatButton>
<RepeatButton Opacity="0" Command="{x:Static ScrollBar.PageUpCommand}" />
</Track.DecreaseRepeatButton>
<Track.IncreaseRepeatButton>
<RepeatButton Opacity="0" Command="{x:Static ScrollBar.PageDownCommand}" />
</Track.IncreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource ScrollBarThumb }" />
</Track.Thumb>
</Track>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<DrawingImage x:Key="StartupIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V17 H17 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M17,17z M0,0z M8.52827,1.49316C6.4788,1.49316 4.42993,2.27314 2.87202,3.83105 -0.243799,6.94687 -0.243799,12.0277 2.87202,15.1436 3.05955,15.331 3.31387,15.4364 3.57905,15.4364 3.84423,15.4364 4.09855,15.331 4.28608,15.1436 4.40985,15.0194 4.4988,14.865 4.54405,14.6956 4.5893,14.5263 4.58925,14.348 4.5439,14.1787L5.34663,13.376 4.6396,12.6689 3.95015,13.3584C3.11585,12.3755,2.64691,11.1947,2.54585,9.9873L3.52827,9.9873 3.52827,8.9873 2.54585,8.9873C2.64195,7.83886 3.06961,6.7138 3.82905,5.76074 3.8672,5.85753 3.92507,5.94533 3.99897,6.01855L6.68647,8.70605C6.58185,8.95322 6.52805,9.21891 6.52827,9.4873 6.52827,10.0177 6.73898,10.5264 7.11406,10.9015 7.48913,11.2766 7.99784,11.4873 8.52827,11.4873 9.0587,11.4873 9.56741,11.2766 9.94249,10.9015 10.3176,10.5264 10.5283,10.0177 10.5283,9.4873 10.5283,8.95687 10.3176,8.44819 9.94249,8.07312 9.56741,7.69805 9.0587,7.4873 8.52827,7.4873 8.26106,7.48823 7.99674,7.54268 7.75093,7.64746L5.05952,4.95605C4.98554,4.88262 4.89708,4.82542 4.79976,4.78809 5.75309,4.02803 6.87934,3.60104 8.02827,3.50488L8.02827,4.4873 9.02827,4.4873 9.02827,3.50488C10.2357,3.60594,11.4165,4.07488,12.3994,4.90918L11.7099,5.59863 12.4169,6.30566 13.1064,5.61621C13.9407,6.59908,14.4096,7.77986,14.5107,8.9873L13.5283,8.9873 13.5283,9.9873 14.5107,9.9873C14.4096,11.1947,13.9407,12.3755,13.1064,13.3584L12.4169,12.6689 11.7099,13.376 12.5126,14.1787C12.4673,14.348 12.4672,14.5263 12.5125,14.6956 12.5577,14.865 12.6467,15.0194 12.7705,15.1436 12.958,15.331 13.2123,15.4364 13.4775,15.4364 13.7427,15.4364 13.997,15.331 14.1845,15.1436 17.3003,12.0277 17.3003,6.94687 14.1845,3.83105 12.6266,2.27314 10.5777,1.49316 8.52827,1.49316z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="CanvasAndInkIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F0 M16,16z M0,0z M1.03125,3C1.03125,1.33801,2.38486,1E-05,4.18269,0L11.7548,0C12.193,0,12.6249,0.10569,13.0056,0.25L11.6872,2 4.02644,2C3.42716,2.00001,3.0072,2.446,3.00721,3L3.00721,13C3.0072,13.554,3.42716,14,4.02644,14L11.9423,14C12.5416,14,13.024,13.554,13.024,13L13.024,9.2879 15,6.41068 15,13C15,14.662,13.5526,16,11.7548,16L4.18269,16C2.38485,16,1.03125,14.662,1.03125,13L1.03125,3z M9.99966,7.00021C11.5208,4.53767,14.04,1.03125,14.04,1.03125L15.7587,2.09415 11.5737,8.45877 10.9788,9.93973 9.3038,10.4023 8.56352,10.9857 7.86816,10.9867 8.63129,9.74142 8.59399,8.16751 9.99966,7.00021z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="GesturesIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H17 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M17,16z M0,0z M7.4284,3.01515C7.32846,3.01926 7.22971,3.03834 7.13543,3.07175 7.07215,3.09421 7.0113,3.123 6.95379,3.15766 6.92552,3.17515 6.89815,3.19403 6.87176,3.21425 6.79115,3.27422 6.72004,3.34599 6.66082,3.42714 6.58255,3.53542 6.52676,3.65828 6.49676,3.78847 6.48929,3.82072 6.48342,3.85333 6.47918,3.88617 6.47443,3.92378 6.47182,3.96162 6.47137,3.99953L6.47137,8.99953 6.47137,12.3823 3.91863,11.105C3.69517,10.9928 3.43777,10.9683 3.19719,11.0365 2.9566,11.1047 2.75028,11.2605 2.61889,11.4733 2.48751,11.686 2.4406,11.9403 2.48741,12.1859 2.53421,12.4316 2.67134,12.6508 2.87176,12.8003L6.85027,15.7827 6.87175,15.8003C6.88141,15.807 6.89117,15.8135 6.90105,15.8198 6.91638,15.8307 6.93201,15.8411 6.94792,15.851 6.95951,15.8578 6.97123,15.8643 6.98308,15.8705 6.99786,15.8787 7.01284,15.8865 7.028,15.8939 7.04597,15.9029 7.06421,15.9114 7.08269,15.9193 7.09496,15.9248 7.10733,15.93 7.1198,15.9349 7.14039,15.9428 7.16124,15.9499 7.1823,15.9564 7.19203,15.9592 7.2018,15.9619 7.2116,15.9644 7.22843,15.9688 7.24536,15.9727 7.26238,15.9761 7.28179,15.9806 7.30133,15.9845 7.32097,15.9878 7.32942,15.9893 7.33788,15.9906 7.34636,15.9918 7.37361,15.9949 7.40098,15.997 7.42839,15.9978 7.4427,15.9987 7.45703,15.9993 7.47137,15.9995L12.4714,15.9995C12.4714,15.9995 12.9301,16.0133 13.4186,15.7691 13.9071,15.5248 14.4714,14.8329 14.4714,13.9995L14.4714,9.99953C14.4715,9.77638 14.3969,9.5596 14.2596,9.3837 14.1223,9.2078 13.9301,9.08289 13.7136,9.02883L9.71355,8.02883C9.63432,8.00921,9.55299,7.99938,9.47137,7.99953L8.47137,7.99953 8.47137,3.99953C8.46996,3.89933 8.4535,3.79991 8.42254,3.70461 8.39131,3.60915 8.34587,3.51895 8.28777,3.43703 8.26889,3.41001 8.24868,3.38395 8.22722,3.35893 8.16192,3.28284 8.08554,3.21699 8.00066,3.16361 7.97216,3.14652 7.94283,3.13088 7.91277,3.11672 7.88288,3.10152 7.85224,3.08783 7.82097,3.07572 7.78958,3.06436 7.75764,3.05457 7.72527,3.0464 7.69309,3.03761 7.6605,3.03044 7.62761,3.0249 7.5617,3.01494 7.49497,3.01184 7.4284,3.01515z" />
<GeometryDrawing Geometry="F1 M17,16z M0,0z M7.4707,0C5.27341,0 3.4707,1.80271 3.4707,4 3.4707,5.46662 4.28317,6.74314 5.4707,7.43945L5.4707,4C5.4707,2.9093 6.38,2 7.4707,2 8.5614,2 9.4707,2.9093 9.4707,4L9.4707,7C9.55233,6.99985,9.63366,7.00968,9.71289,7.0293L9.96875,7.09381C10.8758,6.35839 11.4707,5.24958 11.4707,4 11.4707,1.80271 9.66799,0 7.4707,0z">
<GeometryDrawing.Brush>
<SolidColorBrush Color="#FF222222" Opacity="0.5" />
</GeometryDrawing.Brush>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="AppearanceIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="Transparent">
<GeometryDrawing.Geometry>
<PathGeometry Figures="M12 21C9.61305 21 7.32387 20.0518 5.63604 18.364C3.94821 16.6761 3 14.3869 3 12C3 9.61305 3.94821 7.32387 5.63604 5.63604C7.32387 3.94821 9.61305 3 12 3C16.97 3 21 6.582 21 11C21 12.06 20.526 13.078 19.682 13.828C18.838 14.578 17.693 15 16.5 15H14C13.5539 14.9928 13.1181 15.135 12.7621 15.404C12.4061 15.673 12.1503 16.0533 12.0353 16.4844C11.9203 16.9155 11.9528 17.3727 12.1276 17.7833C12.3025 18.1938 12.6095 18.5341 13 18.75C13.1997 18.9342 13.3366 19.1764 13.3915 19.4425C13.4465 19.7085 13.4167 19.9851 13.3064 20.2334C13.196 20.4816 13.0107 20.6891 12.7764 20.8266C12.5421 20.9641 12.2705 21.0247 12 21Z" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="#FF222222" Thickness="2" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="Transparent">
<GeometryDrawing.Geometry>
<PathGeometry Figures="M7.5 10.5C7.5 10.7652 7.60536 11.0196 7.79289 11.2071C7.98043 11.3946 8.23478 11.5 8.5 11.5C8.76522 11.5 9.01957 11.3946 9.20711 11.2071C9.39464 11.0196 9.5 10.7652 9.5 10.5C9.5 10.2348 9.39464 9.98043 9.20711 9.79289C9.01957 9.60536 8.76522 9.5 8.5 9.5C8.23478 9.5 7.98043 9.60536 7.79289 9.79289C7.60536 9.98043 7.5 10.2348 7.5 10.5Z" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="#FF222222" Thickness="2" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="Transparent">
<GeometryDrawing.Geometry>
<PathGeometry Figures="M11.5 7.5C11.5 7.76522 11.6054 8.01957 11.7929 8.20711C11.9804 8.39464 12.2348 8.5 12.5 8.5C12.7652 8.5 13.0196 8.39464 13.2071 8.20711C13.3946 8.01957 13.5 7.76522 13.5 7.5C13.5 7.23478 13.3946 6.98043 13.2071 6.79289C13.0196 6.60536 12.7652 6.5 12.5 6.5C12.2348 6.5 11.9804 6.60536 11.7929 6.79289C11.6054 6.98043 11.5 7.23478 11.5 7.5Z" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="#FF222222" Thickness="2" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="Transparent">
<GeometryDrawing.Geometry>
<PathGeometry Figures="M15.5 10.5C15.5 10.7652 15.6054 11.0196 15.7929 11.2071C15.9804 11.3946 16.2348 11.5 16.5 11.5C16.7652 11.5 17.0196 11.3946 17.2071 11.2071C17.3946 11.0196 17.5 10.7652 17.5 10.5C17.5 10.2348 17.3946 9.98043 17.2071 9.79289C17.0196 9.60536 16.7652 9.5 16.5 9.5C16.2348 9.5 15.9804 9.60536 15.7929 9.79289C15.6054 9.98043 15.5 10.2348 15.5 10.5Z" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="#FF222222" Thickness="2" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="InkRecognitionIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,16z M0,0z M14,16C15.0986,16 16,15.0986 16,14 16,13.265 15.5961,12.6191 15,12.2715L15,8.72852C15.5961,8.38094 16,7.73502 16,7 16,5.90141 15.0986,5 14,5 13.265,5 12.6191,5.4039 12.2715,6L10,6 10,3.72852C10.5961,3.38094 11,2.73502 11,2 11,0.90141 10.0986,0 9,0 8.26498,0 7.61906,0.4039 7.27148,1L3.72852,1C3.38094,0.4039 2.73502,0 2,0 0.90141,0 0,0.90141 0,2 0,2.73502 0.4039,3.38094 1,3.72852L1,7.27148C0.4039,7.61906 0,8.26498 0,9 0,10.0986 0.90141,11 2,11 2.73502,11 3.38094,10.5961 3.72852,10L6,10 6,12.2715C5.4039,12.6191 5,13.265 5,14 5,15.0986 5.90141,16 7,16 7.73502,16 8.38094,15.5961 8.72852,15L12.2715,15C12.6191,15.5961,13.265,16,14,16z M14,15C13.4419,15 13,14.5581 13,14 13,13.4419 13.4419,13 14,13 14.5581,13 15,13.4419 15,14 15,14.5581 14.5581,15 14,15z M7,15C6.44185,15 6,14.5581 6,14 6,13.4419 6.44185,13 7,13 7.55815,13 8,13.4419 8,14 8,14.5581 7.55815,15 7,15z M12.2715,13L8.72852,13C8.55286,12.6988,8.30124,12.4471,8,12.2715L8,8.72852C8.30151,8.55279,8.55279,8.30151,8.72852,8L12.2715,8C12.4471,8.30124,12.6988,8.55286,13,8.72852L13,12.2715C12.6988,12.4471,12.4471,12.6988,12.2715,13z M2,10C1.44185,10 1,9.55815 1,9 1,8.44185 1.44185,8 2,8 2.55815,8 3,8.44185 3,9 3,9.55815 2.55815,10 2,10z M14,8C13.4419,8 13,7.55815 13,7 13,6.44185 13.4419,6 14,6 14.5581,6 15,6.44185 15,7 15,7.55815 14.5581,8 14,8z M9,3C8.44185,3 8,2.55815 8,2 8,1.44185 8.44185,1 9,1 9.55815,1 10,1.44185 10,2 10,2.55815 9.55815,3 9,3z M2,3C1.44185,3 1,2.55815 1,2 1,1.44185 1.44185,1 2,1 2.55815,1 3,1.44185 3,2 3,2.55815 2.55815,3 2,3z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="ShapeDrawingIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H17 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F0 M17,16z M0,0z M1.75885,3.2L1.75885,0 4.95885,0 4.95885,3.2 3.89219,3.2 3.89219,6.08542C4.26093,6.19412 4.58486,6.42056 4.81547,6.73079 5.04608,7.04103 5.17094,7.41834 5.17135,7.80625 5.17139,8.19452 5.04673,8.57236 4.81609,8.88301 4.58545,9.19366 4.26127,9.42037 3.89219,9.52917L3.89219,12.8 4.95885,12.8 4.95885,16 1.75885,16 1.75885,12.8 2.82552,12.8 2.82552,9.50417C2.47369,9.38413 2.16793,9.15584 1.9512,8.8513 1.73448,8.54676 1.61767,8.18128 1.61719,7.80625 1.61767,7.43122 1.73448,7.0658 1.9512,6.76126 2.16793,6.45672 2.47369,6.22837 2.82552,6.10833L2.82552,3.2 1.75885,3.2z M9.22552,0L9.22552,2.13333C9.22552,2.13333 7.09219,4.26667 7.09219,8.53333 8.15885,10.2895 8.15885,11.1616 8.15885,11.7333L8.15885,12.8 13.4922,12.8 13.4922,11.7333C13.4922,11.1852 13.4922,10.2188 14.5589,8.53333 14.5589,4.26667 12.4255,2.13333 12.4255,2.13333L12.4255,0 11.3589,0 11.3589,5.3C12.0185,5.51903 12.4922,6.13353 12.4922,6.86667 12.4922,7.78254 11.7414,8.53333 10.8255,8.53333 9.90965,8.53333 9.15885,7.78254 9.15885,6.86667 9.15885,6.1407 9.64262,5.52467 10.2922,5.3L10.2922,0 9.22552,0z M8.15885,16L8.15885,13.8667 13.4922,13.8667 13.4922,16 8.15885,16z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="AutomationIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V17 H17 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F0 M17,17z M0,0z M0.0556641,3.20703C0.0556641,1.54503,1.39366,0.207031,3.05566,0.207031L13.0557,0.207031C14.7177,0.207031,16.0557,1.54503,16.0557,3.20703L16.0557,10.207C16.0557,11.869,14.7177,13.207,13.0557,13.207L3.05566,13.207C1.39366,13.207,0.0556641,11.869,0.0556641,10.207L0.0556641,3.20703z M13.0557,2.20703L3.05566,2.20703C2.50166,2.20703,2.05566,2.65303,2.05566,3.20703L2.05566,10.207C2.05566,10.761,2.50166,11.207,3.05566,11.207L13.0557,11.207C13.6097,11.207,14.0557,10.761,14.0557,10.207L14.0557,3.20703C14.0557,2.65303,13.6097,2.20703,13.0557,2.20703z M5.05566,5.20703C5.05566,4.65475 5.50338,4.20703 6.05566,4.20703 6.60794,4.20703 7.05566,4.65475 7.05566,5.20703 7.05566,5.75931 6.60794,6.20703 6.05566,6.20703 5.50338,6.20703 5.05566,5.75931 5.05566,5.20703z M9.05566,5.20703C9.05566,4.65475 9.50338,4.20703 10.0557,4.20703 10.6079,4.20703 11.0557,4.65475 11.0557,5.20703 11.0557,5.75931 10.6079,6.20703 10.0557,6.20703 9.50338,6.20703 9.05566,5.75931 9.05566,5.20703z M3.64145,14.7928C4.01652,14.4178,4.52523,14.207,5.05566,14.207L11.0557,14.207C11.5861,14.207 12.0948,14.4178 12.4699,14.7928 12.845,15.1679 13.0557,15.6766 13.0557,16.207L11.0557,16.207 5.05566,16.207 3.05566,16.207C3.05566,15.6766,3.26638,15.1679,3.64145,14.7928z M8.05643,9.95801C9.48469,9.95801 10.8071,9.19492 11.5213,7.95801 11.6596,7.71858 11.5774,7.4123 11.3377,7.27441 11.0983,7.13604 10.792,7.21832 10.6541,7.45801 10.1178,8.38691 9.12903,8.95801 8.05643,8.95801 6.98383,8.95801 5.99508,8.38691 5.45878,7.45801 5.32089,7.21832 5.01461,7.13604 4.77518,7.27441 4.53549,7.4123 4.45322,7.71858 4.59159,7.95801 5.30572,9.19492 6.62817,9.95801 8.05643,9.95801z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="PowerPointIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F0 M16,16z M0,0z M4.79961,16C3.02692,16,1.59961,14.5727,1.59961,12.8L1.59961,3.2C1.59961,1.42731,3.02692,0,4.79961,0L7.99961,0C8.96563,0,9.89167,0.383595,10.5747,1.06667L13.3329,3.82485C14.016,4.50792,14.3996,5.43398,14.3996,6.4L14.3996,12.8C14.3996,14.5727,12.9723,16,11.1996,16L4.79961,16z M7.99961,2.13333L4.79961,2.13333C4.21589,2.13333,3.73294,2.61628,3.73294,3.2L3.73294,12.8C3.73294,13.3837,4.21589,13.8667,4.79961,13.8667L11.1996,13.8667C11.7833,13.8667,12.2663,13.3837,12.2663,12.8L12.2663,6.4 9.06628,6.4 9.06628,2.57515C8.78348,2.29236,8.39955,2.13333,7.99961,2.13333z M4.79961,4.8C4.79961,3.92267 5.52228,3.2 6.39961,3.2 7.27694,3.2 7.99961,3.92267 7.99961,4.8 7.99961,5.67733 7.27694,6.4 6.39961,6.4 5.52228,6.4 4.79961,5.67733 4.79961,4.8z M6.93294,4.8C6.93294,4.49914 6.70047,4.26667 6.39961,4.26667 6.09875,4.26667 5.86628,4.49914 5.86628,4.8 5.86628,5.10086 6.09875,5.33333 6.39961,5.33333 6.70047,5.33333 6.93294,5.10086 6.93294,4.8z M4.79961,8.53333L4.79961,7.46667 11.1996,7.46667 11.1996,8.53333 4.79961,8.53333z M4.79961,10.6667L4.79961,9.6 11.1996,9.6 11.1996,10.6667 4.79961,10.6667z M4.79961,12.8L4.79961,11.7333 11.1996,11.7333 11.1996,12.8 4.79961,12.8z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="ExtensionsIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,16z M0,0z M6.28571,0C5.336,0,4.57143,0.764571,4.57143,1.71429L4.57143,3.42857 1.14286,3.42857C0.509714,3.42857,0,3.93829,0,4.57143L0,8 1.71429,8C2.664,8 3.42857,8.76457 3.42857,9.71429 3.42857,10.664 2.664,11.4286 1.71429,11.4286L0,11.4286 0,14.8571C0,15.4903,0.509714,16,1.14286,16L4.57143,16 4.57143,14.2857C4.57143,13.336 5.336,12.5714 6.28571,12.5714 7.23543,12.5714 8,13.336 8,14.2857L8,16 11.4286,16C12.0617,16,12.5714,15.4903,12.5714,14.8571L12.5714,11.4286 14.2857,11.4286C15.2354,11.4286 16,10.664 16,9.71429 16,8.76457 15.2354,8 14.2857,8L12.5714,8 12.5714,4.57143C12.5714,3.93829,12.0617,3.42857,11.4286,3.42857L8,3.42857 8,1.71429C8,0.764571,7.23543,0,6.28571,0z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="StorageIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V17 H17 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M17,17z M0,0z M4.11328,0.236328C2.46858,0.236328,1.11328,1.59163,1.11328,3.23633L1.11328,13.2363C1.11328,14.881,2.46858,16.2363,4.11328,16.2363L12.1133,16.2363C13.758,16.2363,15.1133,14.881,15.1133,13.2363L15.1133,3.23633C15.1133,1.59163,13.758,0.236328,12.1133,0.236328L4.11328,0.236328z M4.11328,2.23633L12.1133,2.23633C12.6846,2.23633,13.1133,2.66503,13.1133,3.23633L13.1133,8.23633 13.1133,12.2363C13.1133,12.8076,12.6846,13.2363,12.1133,13.2363L4.11328,13.2363C3.55928,13.2363,3.11328,12.7903,3.11328,12.2363L3.11328,3.23633C3.11328,2.68233,3.55928,2.23633,4.11328,2.23633z M8.11328,3.23633C5.90414,3.23633,4.11327,5.02719,4.11328,7.23633L4.11328,11.2363 8.11328,11.2363C10.6133,11.2363 12.1133,9.44547 12.1133,7.23633 12.1133,5.02719 10.3224,3.23633 8.11328,3.23633z M8.11328,5.23633C9.21785,5.23633 10.1133,6.13176 10.1133,7.23633 10.1133,8.3409 9.21785,9.23633 8.11328,9.23633 7.00871,9.23633 6.11328,8.3409 6.11328,7.23633 6.11328,6.13176 7.00871,5.23633 8.11328,5.23633z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="SnapshotIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F0 M16,16z M0,0z M7,1L7,2 8,2 8,1 7,1z M9,1L9,2 10,2 10,1 9,1z M11,1L11,2 12,2 12,1 11,1z M13,1L13,2 14,2 14,1 13,1z M15,1L15,2 16,2 16,1 15,1z M7,3L7,4 8,4 8,3 7,3z M7,5L7,6 8,6 8,5 7,5z M12,10C11.2211,10,10.5116,10.2968,9.97827,10.7835L9.23626,9.91891 13.0241,4.88107C13.5487,4.21716,13.2521,3.38331,12.3434,3L8.14135,8.53514 3.93925,3C3.03058,3.38331,2.73402,4.21716,3.25863,4.88107L7.04644,9.91891 6.14654,10.9042C5.60177,10.3463 4.84133,10 4,10 2.34315,10 1,11.3432 1,13 1,14.6568 2.34315,16 4,16 5.65685,16 7,14.6568 7,13 7,12.9054 6.99562,12.8117 6.98704,12.7193L8.14135,11.2811 9.05242,12.4387C9.01801,12.6205 9,12.8082 9,13 9,14.6568 10.3432,16 12,16 13.6568,16 15,14.6568 15,13 15,11.3432 13.6568,10 12,10z M12,12C12.5523,12 13,12.4477 13,13 13,13.5523 12.5523,14 12,14 11.4477,14 11,13.5523 11,13 11,12.4477 11.4477,12 12,12z M5,13C5,12.4477 4.55228,12 4,12 3.44772,12 3,12.4477 3,13 3,13.5523 3.44772,14 4,14 4.55228,14 5,13.5523 5,13z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="LuckyRandomIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V17 H17 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M17,17z M0,0z M5.8252,1.52246C5.16215,1.52246 4.52627,1.78586 4.05743,2.2547 3.58859,2.72354 3.3252,3.35942 3.3252,4.02246 3.3252,4.6855 3.58859,5.32138 4.05743,5.79022 4.52627,6.25906 5.16215,6.52246 5.8252,6.52246 6.48824,6.52246 7.12412,6.25906 7.59296,5.79022 8.0618,5.32138 8.3252,4.6855 8.3252,4.02246 8.3252,3.35942 8.0618,2.72354 7.59296,2.2547 7.12412,1.78586 6.48824,1.52246 5.8252,1.52246z M11.8252,4.52246C11.1622,4.52246 10.5263,4.78586 10.0574,5.2547 9.58859,5.72354 9.3252,6.35942 9.3252,7.02246 9.3252,7.6855 9.58859,8.32138 10.0574,8.79022 10.5263,9.25906 11.1622,9.52246 11.8252,9.52246 12.1535,9.52246 12.4786,9.45779 12.7819,9.33215 13.0852,9.20652 13.3608,9.02237 13.593,8.79022 13.8251,8.55808 14.0093,8.28244 14.1349,7.97913 14.2605,7.67581 14.3252,7.35077 14.3252,7.02246 14.3252,6.69416 14.2605,6.36905 14.1349,6.06573 14.0093,5.76242 13.8251,5.48685 13.593,5.2547 13.3608,5.02255 13.0852,4.83841 12.7819,4.71277 12.4786,4.58713 12.1535,4.52246 11.8252,4.52246z M3.8252,7.52246C2.1632,7.52246,0.825195,8.86046,0.825195,10.5225L0.825195,12.5225C0.825195,13.0765,1.2712,13.5225,1.8252,13.5225L5.90137,13.5225C5.90137,11.4807 7.48312,9.78977 9.48145,9.61426 8.89007,9.08006 8.49871,8.36004 8.37208,7.57324 8.19489,7.54084 8.01203,7.5224 7.8252,7.5224L3.8252,7.52246z M9.8252,10.5225C8.1632,10.5225,6.8252,11.8605,6.8252,13.5225L6.8252,15.5225C6.8252,16.0765,7.2712,16.5225,7.8252,16.5225L15.8252,16.5225C16.3792,16.5225,16.8252,16.0765,16.8252,15.5225L16.8252,13.5225C16.8252,11.8605,15.4872,10.5225,13.8252,10.5225L9.8252,10.5225z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="AdvancedIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H17 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M17,16z M0,0z M4.55176,1C2.61275,1 1.05176,2.561 1.05176,4.5 1.05176,6.439 2.61275,8 4.55176,8L11.5518,8C13.4908,8 15.0518,6.439 15.0518,4.5 15.0518,2.561 13.4908,1 11.5518,1L4.55176,1z M11.5518,2C12.9365,2 14.0518,3.11517 14.0518,4.5 14.0518,5.88467 12.9365,7 11.5518,7 10.167,7 9.05176,5.88467 9.05176,4.5 9.05176,3.11517 10.167,2 11.5518,2z" />
<GeometryDrawing Geometry="F1 M17,16z M0,0z M4.55176,9C2.61275,9 1.05176,10.561 1.05176,12.5 1.05176,14.439 2.61275,16 4.55176,16L11.5518,16C13.4908,16 15.0518,14.439 15.0518,12.5 15.0518,10.561 13.4908,9 11.5518,9L4.55176,9z M4.55176,10C5.93647,10 7.05176,11.1152 7.05176,12.5 7.05176,13.8847 5.93647,15 4.55176,15 3.16702,15 2.05176,13.8847 2.05176,12.5 2.05176,11.1152 3.16702,10 4.55176,10z">
<GeometryDrawing.Brush>
<SolidColorBrush Color="#FF222222" Opacity="0.35" />
</GeometryDrawing.Brush>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="SecurityIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="Transparent">
<GeometryDrawing.Geometry>
<PathGeometry Figures="M12,3 C14.3358,5.06658 17.3844,6.14257 20.5,6 C20.9535,7.54302 21.0923,9.16147 20.9081,10.7592 C20.7238,12.3569 20.2203,13.9013 19.4274,15.3005 C18.6344,16.6998 17.5683,17.9254 16.2924,18.9045 C15.0165,19.8836 13.5567,20.5962 12,21 C10.4432,20.5962 8.98344,19.8836 7.7075,18.9045 C6.43157,17.9254 5.36547,16.6998 4.57255,15.3005 C3.77964,13.9013 3.27609,12.3569 3.09183,10.7592 C2.90757,9.16147 3.04636,7.54302 3.49996,6 C6.61548,6.14257 9.66413,5.06658 12,3 Z" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="#FF222222" Thickness="2" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="UpdateCenterIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,16z M0,0z M10.2929,8.70711L7.29288,5.70711H8.70712L5.70712,8.70711C5.51959,8.89465 5.26522,9.00001 5,9.00001C4.73478,9.00001 4.48044,8.89465 4.29291,8.70711C4.10537,8.51958 4,8.26522 4,8.00001C4,7.73479 4.10534,7.48043 4.29288,7.2929L7.29288,4.2929C7.38574,4.20004 7.49598,4.12638 7.61731,4.07612C7.73864,4.02587 7.86868,4 8,4C8.13132,4 8.26136,4.02587 8.38269,4.07612C8.50402,4.12638 8.61426,4.20004 8.70712,4.2929L11.7071,7.2929C11.8947,7.48043 12,7.73479 12,8.00001C12,8.26522 11.8946,8.51958 11.7071,8.70711C11.5196,8.89465 11.2652,9.00001 11,9.00001C10.7348,9.00001 10.4804,8.89465 10.2929,8.70711z"/>
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,16z M0,0z M9,5V11C9,11.2652 8.89463,11.5196 8.70709,11.7071C8.51956,11.8946 8.26522,12 8,12C7.73478,12 7.48044,11.8946 7.29291,11.7071C7.10537,11.5196 7,11.2652 7,11V5C7,4.73478 7.10537,4.48043 7.29291,4.29289C7.48044,4.10536 7.73478,4 8,4C8.26522,4 8.51956,4.10536 8.70709,4.29289C8.89463,4.48043 9,4.73478 9,5z"/>
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,16z M0,0z M2,8C2,11.3087 4.69134,14 8,14C11.3087,14 14,11.3087 14,8C14,4.69133 11.3087,2 8,2C4.69134,2 2,4.69133 2,8ZM16,8C16,12.4233 12.4233,16 8,16C3.57668,16 0,12.4233 0,8C0,3.57668 3.57668,0 8,0C12.4233,0 16,3.57668 16,8z"/>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="AboutIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F0 M16,16z M0,0z M2.35343,2.37395C5.46789,-0.74052 10.5333,-0.740541 13.6478,2.37392 16.7623,5.48839 16.7623,10.5539 13.6478,13.6683 10.5333,16.7828 5.46789,16.7828 2.35343,13.6683 -0.761038,10.5539 -0.761039,5.48841 2.35343,2.37395z M12.0389,12.0594C14.2904,9.80781 14.2904,6.23442 12.0389,3.98287 9.78731,1.73169 6.21255,1.72957 3.96099,3.98113 1.70944,6.23268 1.70944,9.80882 3.96099,12.0604 6.21254,14.3123 9.7873,14.3109 12.0389,12.0594z M10.1211,3.87906C9.58613,3.34403 8.88007,3.04362 8.15234,3.00601 7.71571,2.98341 7.27096,3.05492 6.85156,3.22867 5.73316,3.69199 5,4.78958 5,6.00015L7,6.00015C7,5.59265 7.24089,5.23221 7.61719,5.07632 7.99349,4.92043 8.41898,5.00502 8.70703,5.29312 8.99503,5.58121 9.07974,6.0065 8.92383,6.38296 8.76792,6.75942 8.40728,7.00015 8,7.00015 7.44771,7.00015 7,7.44786 7,8.00015L7,10.0002 9,10.0002 9,8.82046C9.7862,8.54081 10.4413,7.94595 10.7715,7.14859 11.2347,6.03014 10.977,4.73513 10.1211,3.87906z M9,12.0002C9,11.4479 8.55229,11.0002 8,11.0002 7.44771,11.0002 7,11.4479 7,12.0002 7,12.5524 7.44771,13.0002 8,13.0002 8.55229,13.0002 9,12.5524 9,12.0002z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="ShortcutsIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<!-- 键盘外框 -->
<GeometryDrawing Brush="Transparent">
<GeometryDrawing.Geometry>
<PathGeometry Figures="M2,8 C2,7.46957 2.21071,6.96086 2.58579,6.58579 C2.96086,6.21071 3.46957,6 4,6 L20,6 C20.5304,6 21.0391,6.21071 21.4142,6.58579 C21.7893,6.96086 22,7.46957 22,8 L22,16 C22,16.5304 21.7893,17.0391 21.4142,17.4142 C21.0391,17.7893 20.5304,18 20,18 L4,18 C3.46957,18 2.96086,17.7893 2.58579,17.4142 C2.21071,17.0391 2,16.5304 2,16 L2,8 Z" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="#FF222222" Thickness="2" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<!-- 第一行按键点 -->
<GeometryDrawing>
<GeometryDrawing.Geometry>
<PathGeometry Figures="M6,10 L6,10.01" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="#FF222222" Thickness="2" StartLineCap="Round" EndLineCap="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<PathGeometry Figures="M10,10 L10,10.01" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="#FF222222" Thickness="2" StartLineCap="Round" EndLineCap="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<PathGeometry Figures="M14,10 L14,10.01" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="#FF222222" Thickness="2" StartLineCap="Round" EndLineCap="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<PathGeometry Figures="M18,10 L18,10.01" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="#FF222222" Thickness="2" StartLineCap="Round" EndLineCap="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<!-- 第二行按键 -->
<GeometryDrawing>
<GeometryDrawing.Geometry>
<PathGeometry Figures="M6,14 L6,14.01" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="#FF222222" Thickness="2" StartLineCap="Round" EndLineCap="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<PathGeometry Figures="M18,14 L18,14.01" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="#FF222222" Thickness="2" StartLineCap="Round" EndLineCap="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<!-- 中间长按键 -->
<GeometryDrawing>
<GeometryDrawing.Geometry>
<PathGeometry Figures="M10,14 L14,14" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="#FF222222" Thickness="2" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="CrashActionIcon">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="Transparent">
<GeometryDrawing.Geometry>
<PathGeometry Figures="M17.6698,17.667 C16.1271,19.2844 14.1634,20.4387 11.9998,21 C10.443,20.5962 8.98331,19.8836 7.70738,18.9045 C6.43144,17.9254 5.36534,16.6998 4.57243,15.3005 C3.77952,13.9013 3.27597,12.3569 3.09171,10.7592 C2.90745,9.16147 3.04624,7.54302 3.49983,6 C4.29383,6.036 5.08283,5.994 5.85683,5.876 M8.98483,4.95 C10.082,4.45493 11.0983,3.79757 11.9998,3 C14.3357,5.06658 17.3843,6.14257 20.4998,6 C20.9575,7.55707 21.0946,9.19081 20.9028,10.8024 C20.7109,12.4139 20.1942,13.9699 19.3838,15.376" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="#FF222222" Thickness="2" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<PathGeometry Figures="M3,3 L21,21" />
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Brush="#FF222222" Thickness="2" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="TwoFingerMoveImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V256 H256 V0 H0 Z">
<GeometryDrawing Brush="#FF99C1F1" Geometry="F1 M256,256z M0,0z M107.776,62.2862C101.407,62.3087 95.2876,64.7719 90.6787,69.169 87.4741,67.7312 84.0016,66.9877 80.4893,66.9873 73.8863,66.9873 67.5538,69.6104 62.8848,74.2794 58.2158,78.9484 55.5928,85.2809 55.5928,91.8838 55.5928,98.4868 58.2158,104.819 62.8848,109.488 67.5538,114.157 73.8863,116.78 80.4893,116.78 86.8895,116.78 93.0439,114.315 97.6748,109.897 100.879,111.335 104.352,112.079 107.864,112.079 111.134,112.079 114.371,111.435 117.392,110.184 120.412,108.933 123.157,107.099 125.469,104.787 127.781,102.475 129.614,99.7307 130.866,96.7101 132.117,93.6896 132.761,90.4521 132.761,87.1827 132.761,83.9132 132.117,80.6758 130.866,77.6552 129.614,74.6346 127.781,71.89 125.469,69.5782 123.157,67.2663 120.412,65.4325 117.392,64.1813 114.371,62.9301 111.134,62.2862 107.864,62.2862 107.835,62.2861 107.806,62.2861 107.776,62.2862z">
<GeometryDrawing.Pen>
<Pen Brush="#FF3584E4" Thickness="10" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M256,256z M0,0z M80.6081,82.2521L81.0942,82.2521C84.0761,82.2521 86.9358,83.4366 89.0443,85.5451 91.1528,87.6536 92.3373,90.5133 92.3373,93.4952L92.3373,147.462C92.3373,147.757 92.3955,148.05 92.5085,148.323 92.6215,148.595 92.7871,148.843 92.9959,149.052 93.2047,149.261 93.4526,149.426 93.7254,149.539 93.9982,149.652 94.2907,149.711 94.586,149.711L95.5855,149.711C96.1819,149.711 96.7538,149.474 97.1755,149.052 97.5972,148.63 97.8341,148.058 97.8341,147.462L97.8341,89.2973C97.8341,86.5142 98.9397,83.8451 100.908,81.8772 102.876,79.9093 105.545,78.8037 108.328,78.8037 111.111,78.8037 113.78,79.9093 115.748,81.8772 117.716,83.8451 118.821,86.5142 118.821,89.2973L118.821,147.462C118.821,148.058 119.058,148.63 119.48,149.052 119.902,149.474 120.473,149.711 121.07,149.711L121.819,149.711C122.416,149.711 122.988,149.474 123.409,149.052 123.831,148.63 124.068,148.058 124.068,147.462L124.068,145.528C124.068,142.745 125.174,140.076 127.141,138.108 129.109,136.14 131.778,135.035 134.562,135.035 137.345,135.035 140.014,136.14 141.982,138.108 143.95,140.076 145.055,142.745 145.055,145.528L145.055,147.462C145.055,148.058 145.292,148.63 145.714,149.052 146.135,149.474 146.707,149.711 147.304,149.711L148.053,149.711C148.65,149.711 149.222,149.474 149.643,149.052 150.065,148.63 150.302,148.058 150.302,147.462L150.302,146.713C150.302,143.929 151.407,141.26 153.375,139.292 155.343,137.325 158.012,136.219 160.795,136.219 163.579,136.219 166.248,137.325 168.215,139.292 170.183,141.26 171.289,143.929 171.289,146.713L171.289,202.178C171.289,205.131 170.707,208.055 169.577,210.784 168.447,213.512 166.791,215.991 164.703,218.079 162.615,220.167 160.136,221.823 157.408,222.953 154.68,224.083 151.756,224.665 148.803,224.665L88.8396,224.665C84.087,224.665 79.3808,223.729 74.9899,221.91 70.599,220.091 66.6094,217.425 63.2487,214.065L27.6374,178.453C25.901,176.717 24.8492,174.412 24.6751,171.963 24.501,169.513 25.2163,167.083 26.6898,165.119L27.3155,164.284C28.7347,162.392 30.838,161.13 33.1756,160.768 35.5133,160.406 37.8997,160.973 39.8248,162.348L60.215,176.907C61.0803,177.524 62.099,177.892 63.1595,177.969 64.2199,178.046 65.2811,177.829 66.2264,177.342 67.1717,176.856 67.9648,176.118 68.5184,175.21 69.0721,174.303 69.365,173.26 69.365,172.197L69.365,93.4952C69.365,90.5133 70.5495,87.6536 72.658,85.5451 74.7665,83.4366 77.6262,82.2521 80.6081,82.2521z">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="4" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FF3584E4" Geometry="F1 M256,256z M0,0z M189.114,31.3359L171.437,49.0137 181.792,49.0137 181.792,55.0508 181.792,68.9297 181.792,95.9668 171.437,95.9668 189.114,113.645 206.792,95.9668 196.905,95.9668 196.905,68.9297 196.905,55.0508 196.905,49.0137 206.792,49.0137 189.114,31.3359z" />
<GeometryDrawing Brush="#FF3584E4" Geometry="F1 M256,256z M0,0z M149.042,72.4902L166.72,90.168 166.72,79.8125 172.757,79.8125 186.636,79.8125 213.673,79.8125 213.673,90.168 231.351,72.4902 213.673,54.8125 213.673,64.6992 186.636,64.6992 172.757,64.6992 166.72,64.6992 166.72,54.8125 149.042,72.4902z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="TwoFingerPinchToZoomImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V256 H256 V0 H0 Z">
<GeometryDrawing Brush="#FF99C1F1" Geometry="F1 M256,256z M0,0z M122.759,98.1016C136.509,98.1016 147.655,86.955 147.655,73.2051 147.655,59.4551 136.509,48.3086 122.759,48.3086 109.009,48.3086 97.8623,59.4551 97.8623,73.2051 97.8623,86.955 109.009,98.1016 122.759,98.1016z">
<GeometryDrawing.Pen>
<Pen Brush="#FF3584E4" Thickness="10" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FF99C1F1" Geometry="F1 M256,256z M0,0z M87.2422,178.199C100.992,178.199 112.139,167.053 112.139,153.303 112.139,139.553 100.992,128.406 87.2422,128.406 73.4922,128.406 62.3457,139.553 62.3457,153.303 62.3457,167.053 73.4922,178.199 87.2422,178.199z">
<GeometryDrawing.Pen>
<Pen Brush="#FF3584E4" Thickness="10" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M256,256z M0,0z M120.46,65.342L120.929,65.2162C123.827,64.4397 126.914,64.8322 129.525,66.3091 132.137,67.786 134.063,70.2293 134.891,73.1129L144.181,105.475 144.181,130.489C144.181,131.085 144.417,131.657 144.839,132.079 145.261,132.501 145.833,132.738 146.429,132.738L147.429,132.738C148.025,132.738 148.597,132.501 149.019,132.079 149.44,131.657 149.677,131.085 149.677,130.489L149.677,124.493C149.677,123.115 149.949,121.75 150.476,120.477 151.003,119.204 151.776,118.047 152.751,117.073 153.725,116.098 154.882,115.325 156.155,114.798 157.428,114.271 158.793,113.999 160.171,113.999 162.954,113.999 165.623,115.105 167.591,117.073 169.559,119.041 170.664,121.71 170.664,124.493L170.664,130.489C170.664,131.085 170.901,131.657 171.323,132.079 171.745,132.501 172.317,132.738 172.913,132.738L173.663,132.738C174.259,132.738 174.831,132.501 175.253,132.079 175.674,131.657 175.911,131.085 175.911,130.489L175.911,124.493C175.911,123.115 176.183,121.75 176.71,120.477 177.237,119.204 178.01,118.047 178.985,117.073 179.959,116.098 181.116,115.325 182.389,114.798 183.662,114.271 185.027,113.999 186.405,113.999 189.188,113.999 191.857,115.105 193.825,117.073 195.793,119.041 196.898,121.71 196.898,124.493L196.898,130.489C196.898,131.085 197.135,131.657 197.557,132.079 197.979,132.501 198.551,132.738 199.147,132.738L199.897,132.738C200.493,132.738 201.065,132.501 201.487,132.079 201.908,131.657 202.145,131.085 202.145,130.489L202.145,129.739C202.145,126.956 203.251,124.287 205.219,122.319 207.187,120.351 209.856,119.246 212.639,119.246 215.422,119.246 218.091,120.351 220.059,122.319 222.027,124.287 223.132,126.956 223.132,129.739L223.132,185.205C223.132,188.158 222.551,191.082 221.421,193.811 220.291,196.539 218.634,199.018 216.546,201.106 214.458,203.194 211.979,204.85 209.251,205.98 206.523,207.11 203.599,207.692 200.646,207.692L140.683,207.692C135.93,207.692 131.224,206.756 126.833,204.937 122.442,203.118 118.453,200.452 115.092,197.092L79.4807,161.48C77.7443,159.744 76.6924,157.439 76.5184,154.99 76.3443,152.54 77.0596,150.11 78.533,148.146L79.1587,147.311C80.578,145.419 82.6813,144.157 85.0189,143.795 87.3565,143.433 89.743,144 91.6681,145.375L112.058,159.934C112.924,160.551 113.942,160.919 115.003,160.996 116.063,161.073 117.124,160.856 118.07,160.369 119.015,159.883 119.808,159.145 120.362,158.237 120.915,157.33 121.208,156.287 121.208,155.224L121.208,105.475 112.947,78.9852C112.514,77.5965 112.366,76.1346 112.512,74.6873 112.658,73.24 113.095,71.8371 113.796,70.5629 114.498,69.2886 115.45,68.1693 116.595,67.2722 117.74,66.375 119.055,65.7185 120.46,65.342z">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="4" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FF3584E4" Geometry="F1 M256,256z M0,0z M76.2194,63.6475L51.2193,63.6475 58.5417,70.9699 54.2729,75.2388 44.459,85.0526 40.1901,89.3215 32.8677,81.9991 32.8677,106.999 57.8678,106.999 50.8768,100.008 55.1457,95.7393 64.9596,85.9255 69.2284,81.6566 76.2194,88.6476 76.2194,63.6475z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="TwoFingerRotateImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V256 H256 V0 H0 Z">
<GeometryDrawing Brush="#FF99C1F1" Geometry="F1 M256,256z M0,0z M138.412,97.8573C150.32,104.732 165.547,100.652 172.422,88.7446 179.297,76.8368 175.217,61.6103 163.309,54.7354 151.401,47.8604 136.175,51.9403 129.3,63.8481 122.425,75.7559 126.505,90.9824 138.412,97.8573z">
<GeometryDrawing.Pen>
<Pen Brush="#FF3584E4" Thickness="10" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FF99C1F1" Geometry="F1 M256,256z M0,0z M67.6047,149.466C79.5125,156.341 94.7389,152.261 101.614,140.353 108.489,128.445 104.409,113.219 92.5012,106.344 80.5934,99.4688 65.3669,103.549 58.4919,115.456 51.617,127.364 55.6969,142.591 67.6047,149.466z">
<GeometryDrawing.Pen>
<Pen Brush="#FF3584E4" Thickness="10" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M256,256z M0,0z M152.801,68.3374L153.27,68.4632C156.168,69.2397 158.645,71.123 160.168,73.7077 161.691,76.2925 162.138,79.3719 161.413,82.283L153.277,114.955 140.77,136.617C140.472,137.133 140.391,137.747 140.546,138.323 140.7,138.899 141.077,139.39 141.593,139.689L142.459,140.188C142.975,140.487 143.589,140.567 144.165,140.413 144.741,140.259 145.232,139.882 145.531,139.365L148.529,134.172C149.218,132.979 150.135,131.933 151.228,131.094 152.322,130.255 153.569,129.64 154.9,129.283 156.232,128.926 157.62,128.835 158.986,129.015 160.352,129.195 161.67,129.642 162.863,130.331 165.273,131.723 167.032,134.015 167.752,136.703 168.473,139.391 168.096,142.256 166.704,144.666L163.706,149.859C163.408,150.375 163.327,150.989 163.481,151.565 163.636,152.141 164.013,152.632 164.529,152.93L165.178,153.305C165.695,153.603 166.308,153.684 166.884,153.53 167.46,153.376 167.952,152.999 168.25,152.482L171.248,147.289C171.937,146.096 172.854,145.05 173.948,144.211 175.041,143.372 176.289,142.757 177.62,142.4 178.951,142.043 180.339,141.952 181.705,142.132 183.072,142.312 184.389,142.759 185.582,143.448 187.993,144.84 189.751,147.132 190.472,149.82 191.192,152.508 190.815,155.373 189.423,157.783L186.425,162.976C186.127,163.492 186.046,164.106 186.2,164.682 186.355,165.258 186.732,165.749 187.248,166.047L187.897,166.422C188.414,166.72 189.028,166.801 189.604,166.647 190.18,166.493 190.671,166.116 190.969,165.599L191.344,164.95C192.735,162.54 195.027,160.781 197.716,160.061 200.404,159.341 203.268,159.718 205.678,161.109 208.088,162.501 209.847,164.793 210.567,167.481 211.288,170.169 210.911,173.033 209.519,175.444L181.786,223.479C180.31,226.036 178.344,228.277 176.001,230.075 173.659,231.873 170.985,233.191 168.132,233.955 165.28,234.72 162.305,234.915 159.378,234.529 156.45,234.144 153.627,233.185 151.069,231.709L99.1398,201.727C95.0239,199.351 91.4163,196.187 88.5231,192.417 85.6298,188.646 83.5076,184.343 82.2775,179.752L69.2429,131.106C68.6073,128.734 68.8486,126.212 69.9226,124.004 70.9966,121.796 72.8312,120.049 75.0895,119.084L76.0485,118.674C78.2238,117.745 80.6763,117.704 82.8817,118.559 85.0871,119.415 86.8704,121.099 87.8503,123.252L98.2292,146.055C98.6696,147.023 99.3681,147.851 100.248,148.448 101.128,149.044 102.155,149.387 103.217,149.439 104.279,149.49 105.335,149.247 106.268,148.738 107.202,148.229 107.977,147.472 108.508,146.552L133.382,103.468 139.473,76.3964C139.792,74.9772 140.395,73.6372 141.245,72.4568 142.095,71.2764 143.175,70.2799 144.42,69.5272 145.665,68.7745 147.049,68.2812 148.489,68.0767 149.929,67.8722 151.396,67.9609 152.801,68.3374z">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="4" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FF3584E4" Geometry="F1 M256,256z M0,0z M90,20.6172L90,30.9727 90,31 83.0195,31C64.5133,31,49.3496,46.1617,49.3496,64.668L49.3496,70.4492 49.1602,70.4492 39.2734,70.4492 56.9512,88.127 74.6289,70.4492 64.3496,70.4492 64.3496,64.668C64.3496,54.2683,72.6199,46,83.0195,46L90,46 90,46.0859 90,55.9727 107.678,38.2949 90,20.6172z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="MouseRightButtonMoveImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V84 H118 V0 H0 Z">
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M118,84z M0,0z M91.2918,2.84009L91.2918,2.88813C91.1165,2.8804 90.9389,2.88067 90.7737,2.87614 90.7658,2.87595 90.7573,2.87612 90.749,2.87614L90.749,2.86415C76.7473,2.86415 70.1762,9.85088 67.646,16.52 66.0017,20.8537 66.6333,25.9674 67.2882,31.1487 67.5319,33.076 67.8366,35.1373 68.1764,37.262 68.197,37.8516 68.214,38.4233 68.201,38.8954 68.0108,45.8257 65.5413,54.3246 65.6847,59.5533 65.9503,69.2341 71.273,75.6244 78.3526,78.89 78.4639,78.9414 78.5734,78.9963 78.6856,79.0462 86.7899,82.8798 96.3851,83.1579 104.157,78.2775 110.869,74.8009 115.752,68.5166 115.752,59.5533 115.752,54.3228 113.426,45.8257 113.235,38.8954 113.158,36.0823 113.803,30.4761 113.803,30.4761 114.409,27.6924 114.845,24.7011 114.728,21.7926 114.726,21.7528 114.73,21.7122 114.728,21.6724 114.684,20.1904 114.475,18.7659 114.062,17.4328 114.015,17.2825 113.966,17.136 113.914,16.9884 113.874,16.8634 113.846,16.7401 113.803,16.6161 113.563,15.9275 113.241,15.2289 112.865,14.5383 112.839,14.4851 112.806,14.4348 112.779,14.3821 108.105,5.23774 100.145,2.84009 91.2918,2.84009z">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="3.95257" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M118,84z M0,0z M104.885,69.1824L111.877,31.518C112.731,26.8039 113.55,21.4244 111.911,17.2838 107.767,6.81594 99.9756,4.15649 91.2401,4.15649L90.7398,4.17573C77.8333,4.17573 71.7762,10.9297 69.4438,17.3766 67.9282,21.566 68.5104,26.5094 69.1141,31.518 70.0946,39.6534 72.0479,50.0504 73.8542,58.8341">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="0.658761" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M118,84z M0,0z M90.7148,2.86035L90.7148,33.1634">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="0.658761" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M118,84z M0,0z M90.7791,8.02271L90.6503,8.02271C88.2158,8.02271,86.2422,9.9963,86.2422,12.4308L86.2422,26.7551C86.2422,29.1896,88.2158,31.1632,90.6503,31.1632L90.7791,31.1632C93.2136,31.1632,95.1872,29.1896,95.1872,26.7551L95.1872,12.4308C95.1872,9.9963,93.2136,8.02271,90.7791,8.02271z">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="2.28315" StartLineCap="Square" EndLineCap="Square" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M118,84z M0,0z M68.9756,36.4574C75.7537,34.7352 82.0644,33.1578 90.7052,33.1636 99.346,33.1578 105.657,34.7352 112.435,36.4574">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="0.658761" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FF457BBB" Geometry="F1 M118,84z M0,0z M91.374,32.846L91.374,31.1668C93.6851,31.0297,95.517,29.112,95.517,26.7665L95.517,12.4423C95.517,10.0968,93.6851,8.17909,91.374,8.04199L91.374,4.50407 91.5752,4.49634C95.9106,4.49698 99.9779,5.15819 103.467,7.0932 106.949,9.02501 109.886,12.2432 111.933,17.4154 112.729,19.4255 112.934,21.7535 112.828,24.182 112.723,26.6091 112.308,29.1129 111.881,31.469L111.095,35.7067C105.038,34.1863,99.1402,32.8781,91.374,32.846z">
<GeometryDrawing.Pen>
<Pen Brush="#FF457BBB" Thickness="1" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FF3584E4" Geometry="F0 M118,84z M0,0z M11.6876,13.0008L20.5319,4.15649 29.3762,13.0008 24.4298,13.0008 24.4298,16.0212 24.4298,20.8484 32.8188,20.8484 32.8188,15.902 41.6631,24.7463 32.8188,33.5907 32.8188,28.4097 24.4298,28.4097 24.4298,36.4919 29.3762,36.4919 20.5319,45.3362 11.6876,36.4919 16.8685,36.4919 16.8685,28.4097 12.3481,28.4097 9.32772,28.4097 9.32772,33.5907 0.483398,24.7463 9.32772,15.902 9.32772,20.8484 12.3481,20.8484 16.8685,20.8484 16.8685,16.0212 16.8685,13.0008 11.6876,13.0008z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="MouseWheelZoomImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V90 H118 V0 H0 Z">
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M118,90z M0,0z M91.0994,8.84009L91.0994,8.88813C90.9242,8.8804 90.7465,8.88067 90.5813,8.87614 90.5734,8.87595 90.5649,8.87612 90.5566,8.87614L90.5566,8.86415C76.555,8.86415 69.9838,15.8509 67.4536,22.52 65.8093,26.8537 66.441,31.9674 67.0959,37.1487 67.3395,39.076 67.6443,41.1373 67.984,43.262 68.0046,43.8516 68.0216,44.4233 68.0086,44.8954 67.8184,51.8257 65.3489,60.3246 65.4923,65.5533 65.7579,75.2341 71.0807,81.6244 78.1602,84.89 78.2715,84.9414 78.381,84.9963 78.4932,85.0462 86.5975,88.8798 96.1927,89.1579 103.965,84.2775 110.677,80.8009 115.559,74.5166 115.559,65.5533 115.559,60.3228 113.233,51.8257 113.043,44.8954 112.966,42.0823 113.61,36.4761 113.61,36.4761 114.217,33.6924 114.653,30.7011 114.535,27.7926 114.534,27.7528 114.537,27.7122 114.535,27.6724 114.491,26.1904 114.283,24.7659 113.869,23.4328 113.823,23.2825 113.774,23.136 113.721,22.9884 113.682,22.8634 113.654,22.7401 113.61,22.6161 113.371,21.9275 113.048,21.2289 112.673,20.5383 112.646,20.4851 112.614,20.4348 112.587,20.3821 107.913,11.2377 99.9525,8.84009 91.0994,8.84009z">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="3.95257" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M118,90z M0,0z M104.693,75.1824L111.684,37.518C112.539,32.8039 113.357,27.4244 111.718,23.2838 107.575,12.8159 99.7832,10.1565 91.0477,10.1565L90.5474,10.1757C77.6409,10.1757 71.5838,16.9297 69.2515,23.3766 67.7358,27.566 68.318,32.5094 68.9217,37.518 69.9023,45.6534 71.8555,56.0504 73.6618,64.8341">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="0.658761" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M118,90z M0,0z M90.5225,8.86035L90.5225,39.1634">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="0.658761" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M118,90z M0,0z M90.5867,14.0227L90.458,14.0227C88.0234,14.0227,86.0498,15.9963,86.0498,18.4308L86.0498,32.7551C86.0498,35.1896,88.0234,37.1632,90.458,37.1632L90.5867,37.1632C93.0213,37.1632,94.9949,35.1896,94.9949,32.7551L94.9949,18.4308C94.9949,15.9963,93.0213,14.0227,90.5867,14.0227z">
<GeometryDrawing.Pen>
<Pen Brush="#FF457BBB" Thickness="2.28315" StartLineCap="Square" EndLineCap="Square" LineJoin="Round" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M118,90z M0,0z M68.7832,42.4574C75.5614,40.7352 81.872,39.1578 90.5128,39.1636 99.1536,39.1578 105.464,40.7352 112.242,42.4574">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="0.658761" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M118,90z M0,0z M90.5232,48.009L83.9355,40.1038 87.8881,40.1038 90.5232,30.9224 93.1582,40.1038 97.1108,40.1038 90.5232,48.009z">
<GeometryDrawing.Pen>
<Pen Brush="#FFFFFFFF" Thickness="3.95257" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FF457BBB" Geometry="F1 M118,90z M0,0z M90.5232,48.009L83.9355,40.1038 87.8881,40.1038 90.5232,30.9224 93.1582,40.1038 97.1108,40.1038 90.5232,48.009z">
<GeometryDrawing.Pen>
<Pen Brush="#FF457BBB" Thickness="1.31752" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M118,90z M0,0z M90.5237,3.19903L97.1113,11.1042 93.1588,11.1042 90.5237,20.2856 87.8887,11.1042 83.9361,11.1042 90.5237,3.19903z">
<GeometryDrawing.Pen>
<Pen Brush="#FFFFFFFF" Thickness="3.95257" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FF457BBB" Geometry="F1 M118,90z M0,0z M90.5237,3.19903L97.1113,11.1042 93.1588,11.1042 90.5237,20.2856 87.8887,11.1042 83.9361,11.1042 90.5237,3.19903z">
<GeometryDrawing.Pen>
<Pen Brush="#FF457BBB" Thickness="1.31752" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FF3584E4" Geometry="F1 M118,90z M0,0z M41.5977,7.33594L17.8501,7.33594 24.8057,14.2915 20.7507,18.3465 11.4285,27.6687 7.37352,31.7237 0.417976,24.7681 0.417969,48.5156 24.1655,48.5156 17.5248,41.8749 21.5798,37.8199 30.902,28.4978 34.957,24.4428 41.5977,31.0835 41.5977,7.33594z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="GnomeSliderThumb">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V26 H23 V0 H0 Z">
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M23,26z M0,0z M22.4786,11.0274C22.4786,16.8264 16.782,20.2307 11.9786,24.5271 7.16102,20.2439 1.47852,16.8264 1.47852,11.0274 1.47852,5.22838 6.17959,0.527344 11.9786,0.527344 17.7776,0.527306 22.4786,5.22835 22.4786,11.0274z">
<GeometryDrawing.Pen>
<Pen Brush="#FFD5D5D5" Thickness="1" StartLineCap="Round" EndLineCap="Round" LineJoin="Miter" MiterLimit="1" />
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="InkRecognitionRectangleImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V273 H520 V0 H0 Z">
<GeometryDrawing Geometry="F1 M520,273z M0,0z M179.577,43.5527C174.714,52.791 167.574,59.0645 159.907,66.0065 148.22,76.5875 136.816,87.83 126.317,99.5963 117.801,109.14 109.772,119.642 101.987,129.373 99.2272,132.823 133.735,133.973 136.485,133.973 153.027,133.973 169.57,133.973 186.113,133.973 219.193,133.973 252.168,132.884 285.248,132.884 287.94,132.884 291.654,133.533 294.085,132.097 301.912,127.471 306.783,116.491 312.423,109.643 319.423,101.143 326.535,92.721 333.545,84.2237 335.906,81.3625 339.264,79.1631 340.808,75.69 342.205,72.5465 344.647,69.5564 346.255,66.4301 347.651,63.7156 351.018,59.9767 351.641,57.1702 352.573,52.9771 280.08,50.4832 271.631,49.5444 256.503,47.8635 240.773,48.9997 225.573,48.9997 217.995,48.9997 210.64,47.9103 203.059,47.9103 195.3,47.9103 187.445,46.8209 179.577,46.8209">
<GeometryDrawing.Pen>
<Pen Brush="#FF99C1F1" Thickness="6" StartLineCap="Round" EndLineCap="Round" LineJoin="Miter" MiterLimit="1" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M520,273z M0,0z M234.046,7.60198C239.593,29.4826 239.493,53.1802 239.493,75.75 239.493,78.388 238.542,81.4402 241.611,82.3469 260.097,87.8088 281.501,86.1673 300.499,85.9782 324.664,85.7378 348.772,86.0388 372.884,86.0388 377.261,86.0388 381.639,86.0388 386.017,86.0388 390.918,86.0388 390.743,85.7879 390.98,80.3497 391.602,66.0314 394.126,51.4371 395.821,37.1973 396.38,32.5087 398.273,22.6347 396.245,18.0723 395.556,16.5216 388.055,17.2341 386.925,17.1645 378.09,16.6208 369.208,16.273 360.416,15.2278 348.792,13.8459 337.141,12.6018 325.555,11.1123 310.497,9.17625 294.561,8.67703 279.8,5.18109 264.664,1.59614 246.356,4.33378 230.777,4.33378">
<GeometryDrawing.Pen>
<Pen Brush="#FF3584E4" Thickness="6" StartLineCap="Round" EndLineCap="Round" LineJoin="Miter" MiterLimit="1" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M520,273z M0,0z M380.999,70.7164L381.367,70.4774C383.626,69.0108 386.374,68.5014 389.008,69.0613 391.642,69.6211 393.945,71.2043 395.412,73.4626L421.954,114.334C422.099,114.558 422.287,114.75 422.507,114.902 422.727,115.053 422.974,115.159 423.235,115.214 423.496,115.27 423.765,115.273 424.027,115.225 424.289,115.176 424.539,115.076 424.763,114.931L425.52,114.439C425.971,114.146 426.288,113.685 426.4,113.159 426.512,112.632 426.41,112.082 426.117,111.631L423.168,107.089C422.49,106.046 422.024,104.879 421.798,103.655 421.571,102.432 421.587,101.175 421.846,99.9582 422.105,98.741 422.601,97.5866 423.306,96.5611 424.01,95.5355 424.91,94.6588 425.954,93.9811 428.062,92.6123 430.627,92.1369 433.085,92.6594 435.543,93.1819 437.693,94.6596 439.062,96.7673L442.011,101.309C442.305,101.76 442.765,102.077 443.292,102.189 443.819,102.301 444.369,102.199 444.82,101.906L445.388,101.537C445.84,101.244 446.156,100.783 446.268,100.256 446.38,99.7294 446.278,99.1798 445.985,98.7281L443.036,94.1868C442.358,93.1432 441.892,91.9763 441.666,90.7527 441.439,89.5292 441.455,88.2729 441.714,87.0557 441.973,85.8385 442.469,84.6842 443.174,83.6586 443.878,82.6331 444.778,81.7564 445.822,81.0786 447.93,79.7099 450.495,79.2344 452.953,79.757 455.411,80.2795 457.561,81.7571 458.93,83.8649L461.879,88.4061C462.173,88.8578 462.633,89.1744 463.16,89.2864 463.687,89.3984 464.237,89.2965 464.688,89.0032L465.256,88.6345C465.708,88.3412 466.024,87.8805 466.136,87.3537 466.248,86.827 466.146,86.2773 465.853,85.8256L465.484,85.258C464.116,83.1503 463.64,80.5851 464.163,78.1268 464.685,75.6686 466.163,73.5186 468.271,72.1498 470.378,70.781 472.943,70.3056 475.402,70.8281 477.86,71.3506 480.01,72.8283 481.379,74.936L508.658,116.943C510.111,119.179 511.108,121.68 511.594,124.302 512.08,126.924 512.045,129.615 511.49,132.224 510.936,134.832 509.873,137.306 508.363,139.503 506.853,141.701 504.924,143.579 502.688,145.032L457.275,174.523C453.676,176.861 449.651,178.466 445.431,179.248 441.211,180.03 436.879,179.974 432.681,179.081L388.196,169.626C386.027,169.165 384.097,167.937 382.76,166.167 381.424,164.398 380.77,162.206 380.92,159.993L380.984,159.054C381.128,156.922 382.1,154.932 383.692,153.508 385.285,152.084 387.371,151.34 389.505,151.434L412.108,152.432C413.067,152.475 414.019,152.252 414.86,151.788 415.701,151.325 416.398,150.639 416.875,149.806 417.351,148.972 417.589,148.024 417.562,147.064 417.535,146.104 417.244,145.17 416.721,144.365L378.014,84.761C376.547,82.5027 376.038,79.7543 376.598,77.1204 377.158,74.4866 378.741,72.183 380.999,70.7164z">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="4" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M520,273z M0,0z M108.229,119.987L108.609,120.206C110.941,121.553 112.643,123.77 113.34,126.371 114.037,128.972 113.672,131.743 112.325,134.075L87.9586,176.28C87.8253,176.511 87.7387,176.766 87.7039,177.03 87.6691,177.294 87.6867,177.563 87.7557,177.821 87.8247,178.078 87.9438,178.32 88.1062,178.531 88.2685,178.743 88.4709,178.92 88.7018,179.054L89.4835,179.505C89.9499,179.774 90.5041,179.847 91.0243,179.708 91.5445,179.568 91.988,179.228 92.2573,178.762L94.9647,174.072C95.5869,172.995 96.4153,172.05 97.4026,171.293 98.3898,170.535 99.5166,169.979 100.719,169.657 101.921,169.335 103.174,169.253 104.408,169.415 105.642,169.578 106.831,169.982 107.909,170.604 110.086,171.86 111.674,173.93 112.324,176.358 112.975,178.785 112.634,181.372 111.378,183.548L108.67,188.238C108.401,188.704 108.328,189.258 108.467,189.779 108.607,190.299 108.947,190.742 109.413,191.011L110,191.35C110.466,191.619 111.02,191.692 111.54,191.553 112.061,191.413 112.504,191.073 112.773,190.607L115.481,185.917C116.103,184.84 116.931,183.895 117.919,183.137 118.906,182.38 120.033,181.824 121.235,181.502 122.437,181.18 123.69,181.098 124.924,181.26 126.158,181.423 127.348,181.827 128.425,182.449 130.602,183.705 132.19,185.775 132.84,188.203 133.491,190.63 133.15,193.217 131.894,195.393L129.186,200.083C128.917,200.549 128.844,201.103 128.983,201.623 129.123,202.144 129.463,202.587 129.93,202.856L130.516,203.195C130.982,203.464 131.536,203.537 132.057,203.398 132.577,203.258 133.02,202.918 133.289,202.452L133.628,201.865C134.884,199.689 136.954,198.101 139.382,197.45 141.809,196.8 144.396,197.14 146.572,198.397 148.749,199.654 150.337,201.723 150.987,204.151 151.638,206.578 151.297,209.165 150.041,211.341L124.997,254.718C123.664,257.028 121.889,259.052 119.773,260.675 117.658,262.298 115.243,263.489 112.667,264.179 110.092,264.869 107.405,265.045 104.762,264.697 102.118,264.349 99.5684,263.484 97.2591,262.151L50.3652,235.076C46.6484,232.931 43.3906,230.074 40.778,226.669 38.1653,223.264 36.2489,219.378 35.1381,215.232L23.3674,171.303C22.7935,169.161 23.0114,166.884 23.9813,164.89 24.9511,162.896 26.6078,161.318 28.6471,160.447L29.5131,160.077C31.4774,159.238 33.6921,159.201 35.6837,159.973 37.6752,160.746 39.2856,162.267 40.1705,164.211L49.5428,184.803C49.9406,185.677 50.5714,186.424 51.366,186.963 52.1606,187.502 53.0883,187.812 54.0473,187.858 55.0063,187.904 55.9595,187.686 56.8024,187.226 57.6452,186.766 58.345,186.083 58.8251,185.251L94.36,123.703C95.7063,121.371 97.9239,119.669 100.525,118.973 103.126,118.276 105.897,118.64 108.229,119.987z">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="4" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="InkRecognitionTriangleImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V368 H560 V0 H0 Z">
<GeometryDrawing Geometry="F1 M560,368z M0,0z M171.142,28.6018C171.982,42.0313 168.127,52.9126 163.547,65.4907 151.631,98.2182 141.468,131.34 130.456,164.378 123.932,183.949 118.864,204.555 112.011,223.741 111.031,226.487 124.128,225.291 125.883,225.291 139.623,225.291 151.494,222.654 164.942,220.331 175.858,218.446 187.66,217.34 198.731,216.999 206.343,216.765 213.917,216.847 221.516,216.224 223.69,216.046 231.318,216.7 233.296,215.217 233.979,214.704 221.425,184.425 220.586,181.893 214.88,164.668 209.376,147.087 204.621,129.581 198.668,107.663 187.757,86.9745 182.922,64.8708 181.587,58.7699 179.435,50.3078 176.722,44.7213 173.194,37.4572 172.795,28.2907 168.352,21.627">
<GeometryDrawing.Pen>
<Pen Brush="#FF99C1F1" Thickness="6" StartLineCap="Round" EndLineCap="Round" LineJoin="Miter" MiterLimit="1" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M560,368z M0,0z M116.897,215.356L117.252,215.614C119.431,217.197 120.891,219.58 121.312,222.24 121.734,224.9 121.081,227.617 119.498,229.796L90.8535,269.222C90.6967,269.438 90.584,269.682 90.5218,269.942 90.4595,270.201 90.449,270.47 90.4907,270.733 90.5324,270.997 90.6256,271.249 90.7649,271.477 90.9042,271.704 91.087,271.902 91.3027,272.059L92.0329,272.589C92.4686,272.906 93.0122,273.036 93.5441,272.952 94.076,272.868 94.5527,272.576 94.8692,272.14L98.052,267.759C98.7834,266.752 99.706,265.9 100.767,265.249 101.828,264.599 103.007,264.164 104.236,263.97 105.465,263.775 106.72,263.824 107.93,264.115 109.14,264.405 110.281,264.931 111.288,265.663 113.321,267.14 114.684,269.364 115.078,271.847 115.471,274.329 114.862,276.866 113.384,278.899L110.202,283.28C109.885,283.715 109.755,284.259 109.839,284.791 109.923,285.323 110.215,285.799 110.651,286.116L111.198,286.514C111.634,286.83 112.178,286.961 112.71,286.876 113.242,286.792 113.718,286.5 114.035,286.064L117.218,281.684C117.949,280.677 118.872,279.824 119.933,279.174 120.994,278.524 122.172,278.089 123.401,277.894 124.63,277.7 125.886,277.749 127.096,278.039 128.306,278.33 129.447,278.856 130.454,279.587 132.487,281.065 133.85,283.289 134.243,285.771 134.636,288.253 134.027,290.79 132.55,292.823L129.367,297.204C129.051,297.64 128.92,298.183 129.004,298.715 129.089,299.247 129.381,299.724 129.816,300.04L130.364,300.438C130.8,300.755 131.343,300.885 131.875,300.801 132.407,300.717 132.884,300.425 133.2,299.989L133.598,299.441C135.075,297.408 137.3,296.045 139.782,295.652 142.264,295.259 144.801,295.868 146.834,297.345 148.867,298.822 150.231,301.047 150.624,303.529 151.017,306.011 150.408,308.548 148.931,310.581L119.49,351.103C117.923,353.26 115.946,355.087 113.672,356.481 111.398,357.874 108.873,358.806 106.239,359.223 103.605,359.64 100.915,359.534 98.3222,358.912 95.7293,358.289 93.2844,357.162 91.1271,355.595L47.3201,323.767C43.848,321.245 40.9067,318.063 38.6642,314.403 36.4218,310.744 34.9221,306.679 34.2507,302.44L27.1363,257.521C26.7894,255.331 27.2442,253.089 28.4172,251.207 29.5902,249.325 31.4026,247.93 33.5218,247.277L34.4217,246.999C36.4631,246.37 38.6695,246.564 40.5694,247.541 42.4693,248.517 43.9119,250.198 44.5887,252.224L51.7572,273.683C52.0615,274.594 52.6107,275.403 53.3446,276.022 54.0785,276.641 54.9688,277.046 55.9177,277.192 56.8666,277.339 57.8375,277.221 58.7238,276.851 59.61,276.482 60.3775,275.876 60.9418,275.099L102.716,217.603C104.298,215.424 106.682,213.964 109.341,213.542 112.001,213.121 114.719,213.774 116.897,215.356z">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="4" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M560,368z M0,0z M434.79,179.258C432.384,176.55 425.776,176.942 422.701,176.778 410.024,176.103 397.259,176.468 384.572,176.468 319.548,176.468 254.501,178.976 189.587,182.745 179.504,183.331 169.351,183.869 159.363,185.458 152.584,186.536 155.726,183.033 159.208,178.638 171.643,162.941 186.652,149.227 200.902,135.239 222.838,113.706 244.93,92.3705 267.24,71.226 288.63,50.9532 311.594,33.5293 333.811,14.3426 337.699,10.9848 341.186,7.54448 344.66,3.80286 347.073,1.20424 350.348,10.1925 351.093,11.5526 363.094,33.4782 376.973,54.3193 387.362,77.1158 391.494,86.1842 398.129,95.8508 400.536,105.48 404.178,120.045 409.07,135.074 414.563,149.111 418.38,158.864 423.312,167.461 427.815,176.468">
<GeometryDrawing.Pen>
<Pen Brush="#FF3584E4" Thickness="6" StartLineCap="Round" EndLineCap="Round" LineJoin="Miter" MiterLimit="1" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M560,368z M0,0z M420.644,158.132L421.012,157.893C423.27,156.427 426.018,155.917 428.652,156.477 431.286,157.037 433.59,158.62 435.056,160.879L461.598,201.75C461.744,201.974 461.932,202.167 462.151,202.318 462.371,202.469 462.618,202.575 462.879,202.63 463.14,202.686 463.409,202.689 463.671,202.641 463.934,202.592 464.184,202.492 464.407,202.347L465.164,201.855C465.616,201.562 465.933,201.101 466.045,200.575 466.157,200.048 466.055,199.498 465.761,199.047L462.812,194.505C462.135,193.462 461.669,192.295 461.442,191.071 461.215,189.848 461.232,188.591 461.491,187.374 461.749,186.157 462.245,185.003 462.95,183.977 463.655,182.952 464.555,182.075 465.599,181.397 467.706,180.028 470.271,179.553 472.73,180.075 475.188,180.598 477.338,182.076 478.707,184.183L481.656,188.725C481.949,189.176 482.41,189.493 482.937,189.605 483.463,189.717 484.013,189.615 484.465,189.322L485.032,188.953C485.484,188.66 485.801,188.199 485.913,187.672 486.025,187.145 485.923,186.596 485.629,186.144L482.68,181.603C482.003,180.559 481.537,179.392 481.31,178.169 481.083,176.945 481.1,175.689 481.359,174.472 481.617,173.255 482.113,172.1 482.818,171.075 483.523,170.049 484.423,169.172 485.467,168.495 487.574,167.126 490.139,166.65 492.598,167.173 495.056,167.696 497.206,169.173 498.575,171.281L501.524,175.822C501.817,176.274 502.278,176.59 502.805,176.702 503.331,176.814 503.881,176.713 504.333,176.419L504.9,176.051C505.352,175.757 505.669,175.297 505.781,174.77 505.893,174.243 505.791,173.693 505.497,173.242L505.129,172.674C503.76,170.566 503.285,168.001 503.807,165.543 504.33,163.085 505.807,160.935 507.915,159.566 510.023,158.197 512.588,157.722 515.046,158.244 517.504,158.767 519.655,160.244 521.023,162.352L548.303,204.359C549.755,206.595 550.753,209.096 551.239,211.718 551.725,214.34 551.689,217.031 551.135,219.64 550.581,222.248 549.518,224.722 548.007,226.919 546.497,229.117 544.569,230.995 542.332,232.448L496.92,261.939C493.32,264.277 489.296,265.882 485.076,266.664 480.856,267.446 476.523,267.39 472.325,266.497L427.841,257.042C425.672,256.581 423.742,255.353 422.405,253.583 421.068,251.814 420.415,249.622 420.565,247.409L420.628,246.47C420.772,244.338 421.745,242.348 423.337,240.924 424.929,239.501 427.016,238.756 429.15,238.85L451.752,239.848C452.712,239.891 453.664,239.668 454.505,239.205 455.346,238.741 456.043,238.055 456.519,237.222 456.996,236.388 457.234,235.44 457.207,234.48 457.18,233.52 456.889,232.586 456.366,231.781L417.658,172.177C416.192,169.919 415.682,167.17 416.242,164.536 416.802,161.903 418.385,159.599 420.644,158.132z">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="4" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="InkRecognitionEllipseImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V350 H693 V0 H0 Z">
<GeometryDrawing Geometry="F1 M693,350z M0,0z M570.27,140.874C561.456,124.225 538.192,105.117 522.042,95.9207 492.165,78.9076 447.864,87.6872 416.257,94.8291 357.076,108.202 303.329,153.694 299.16,217.483 296.112,264.125 333.277,300.245 369.418,323.665 407.341,348.239 456.376,354.91 497.034,334.581 544.701,310.747 561.833,261.014 571.262,212.522 576.039,187.955 574.952,167.727 566.697,143.553 562.105,130.104 555.488,116.729 543.476,108.722">
<GeometryDrawing.Pen>
<Pen Brush="#FF3584E4" Thickness="6" StartLineCap="Round" EndLineCap="Round" LineJoin="Miter" MiterLimit="1" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M693,350z M0,0z M563.484,146.953L563.19,146.627C561.389,144.626 560.456,141.991 560.597,139.302 560.737,136.613 561.941,134.09 563.942,132.288L600.158,99.6791C600.356,99.5007 600.517,99.285 600.632,99.0443 600.747,98.8036 600.813,98.5427 600.827,98.2764 600.841,98.0101 600.802,97.7437 600.713,97.4923 600.624,97.241 600.487,97.0096 600.308,96.8114L599.704,96.1407C599.344,95.7404 598.839,95.4998 598.302,95.4716 597.764,95.4434 597.237,95.63 596.837,95.9904L592.813,99.6136C591.888,100.446 590.808,101.089 589.635,101.504 588.462,101.919 587.219,102.1 585.976,102.035 584.733,101.969 583.516,101.66 582.392,101.124 581.269,100.589 580.263,99.837 579.43,98.9122 577.748,97.0446 576.877,94.5854 577.009,92.0756 577.14,89.5659 578.264,87.2112 580.131,85.5296L584.155,81.9063C584.556,81.546 584.796,81.0414 584.824,80.5036 584.853,79.9658 584.666,79.4388 584.306,79.0386L583.853,78.5356C583.492,78.1354 582.988,77.8947 582.45,77.8665 581.912,77.8384 581.385,78.025 580.985,78.3853L576.961,82.0085C576.036,82.8412 574.956,83.4836 573.783,83.899 572.61,84.3144 571.367,84.4946 570.124,84.4295 568.882,84.3644 567.664,84.0551 566.541,83.5194 565.418,82.9837 564.411,82.232 563.578,81.3072 561.897,79.4395 561.026,76.9803 561.157,74.4706 561.289,71.9609 562.412,69.6062 564.28,67.9245L568.304,64.3013C568.704,63.9409 568.945,63.4363 568.973,62.8985 569.001,62.3607 568.814,61.8338 568.454,61.4336L568.001,60.9306C567.641,60.5303 567.136,60.2897 566.598,60.2615 566.06,60.2333 565.534,60.4199 565.133,60.7803L564.63,61.2332C562.763,62.9148 560.303,63.7857 557.794,63.6541 555.284,63.5226 552.929,62.3995 551.248,60.5318 549.566,58.6642 548.695,56.205 548.827,53.6952 548.958,51.1855 550.081,48.8308 551.949,47.1491L589.171,13.6342C591.153,11.8499 593.466,10.4734 595.98,9.5833 598.494,8.69318 601.158,8.30686 603.821,8.44642 606.484,8.58598 609.093,9.24865 611.5,10.3966 613.907,11.5446 616.064,13.1555 617.848,15.1371L654.081,55.3772C656.952,58.5666 659.168,62.2905 660.6,66.3361 662.033,70.3817 662.655,74.6699 662.43,78.9558L660.05,124.372C659.934,126.586 659.023,128.685 657.484,130.282 655.946,131.878 653.883,132.867 651.674,133.065L650.736,133.149C648.609,133.34 646.491,132.691 644.835,131.341 643.18,129.991 642.118,128.047 641.878,125.925L639.327,103.444C639.219,102.49 638.85,101.584 638.261,100.826 637.672,100.068 636.885,99.4871 635.987,99.1467 635.09,98.8063 634.116,98.7198 633.172,98.8967 632.228,99.0737 631.351,99.5071 630.638,100.15L577.823,147.705C575.822,149.506 573.187,150.439 570.498,150.298 567.809,150.158 565.286,148.954 563.484,146.953z">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="4" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M693,350z M0,0z M229.1,162.31C215.012,163.92 201.174,166.829 187.322,169.852 169.46,173.749 147.518,176.525 131.552,186.424 105.561,202.539 132.494,230.065 147.132,243.484 189.466,282.29 240.706,287.868 295.191,275.041 342.656,263.866 395.043,239.561 432.333,207.561 449.223,193.068 435.54,183.174 418.937,177.394 391.108,167.705 361.468,163.85 332.205,161.913 289.788,159.105 246.516,158.373 204.093,161.317 176.78,163.213 149.873,167.364 123.316,174.02 112.731,176.672 94.9942,179.695 86.0035,187.317 79.4819,192.846 87.7362,197.908 91.5606,199.821">
<GeometryDrawing.Pen>
<Pen Brush="#FF99C1F1" Thickness="6" StartLineCap="Round" EndLineCap="Round" LineJoin="Miter" MiterLimit="1" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M693,350z M0,0z M88.5336,191.045L88.9511,191.181C91.512,192.013 93.6375,193.828 94.86,196.227 96.0824,198.627 96.3017,201.413 95.4697,203.974L80.4102,250.322C80.3278,250.576 80.2961,250.843 80.317,251.109 80.338,251.375 80.411,251.634 80.5321,251.872 80.6531,252.109 80.8198,252.321 81.0226,252.494 81.2253,252.667 81.4603,252.799 81.7139,252.881L82.5723,253.16C83.0845,253.326 83.6418,253.282 84.1216,253.038 84.6015,252.794 84.9645,252.368 85.1309,251.856L86.8042,246.706C87.1888,245.523 87.8026,244.427 88.6108,243.48 89.419,242.534 90.4056,241.756 91.5144,241.191 92.6232,240.627 93.8324,240.286 95.0729,240.188 96.3135,240.09 97.5612,240.238 98.7446,240.622 101.135,241.399 103.119,243.093 104.26,245.333 105.401,247.572 105.605,250.173 104.829,252.563L103.155,257.713C102.989,258.225 103.033,258.782 103.277,259.262 103.522,259.742 103.947,260.105 104.459,260.271L105.103,260.481C105.615,260.647 106.172,260.603 106.652,260.359 107.132,260.114 107.495,259.689 107.661,259.177L109.335,254.027C109.719,252.844 110.333,251.747 111.141,250.801 111.949,249.855 112.936,249.077 114.045,248.512 115.154,247.947 116.363,247.606 117.603,247.508 118.844,247.411 120.092,247.559 121.275,247.943 123.665,248.72 125.649,250.414 126.79,252.653 127.931,254.893 128.136,257.493 127.359,259.883L125.686,265.033C125.519,265.545 125.563,266.103 125.808,266.583 126.052,267.062 126.477,267.426 126.989,267.592L127.633,267.801C128.145,267.968 128.703,267.924 129.183,267.679 129.662,267.435 130.025,267.01 130.192,266.497L130.401,265.854C131.178,263.464 132.872,261.48 135.111,260.339 137.35,259.198 139.951,258.993 142.341,259.77 144.732,260.546 146.715,262.241 147.856,264.48 148.997,266.719 149.202,269.32 148.425,271.71L132.948,319.346C132.124,321.882 130.808,324.231 129.076,326.259 127.344,328.286 125.23,329.953 122.854,331.164 120.478,332.374 117.887,333.105 115.229,333.314 112.571,333.523 109.897,333.207 107.361,332.383L55.8628,315.65C51.781,314.324 48.0005,312.207 44.737,309.42 41.4735,306.632 38.7909,303.229 36.8425,299.405L16.1958,258.884C15.189,256.908 14.9288,254.635 15.4628,252.483 15.9969,250.331 17.2893,248.443 19.1029,247.167L19.8731,246.625C21.6201,245.396 23.7787,244.899 25.8873,245.241 27.9959,245.582 29.8873,246.735 31.157,248.453L44.606,266.646C45.1767,267.419 45.9491,268.018 46.8384,268.38 47.7277,268.742 48.6995,268.852 49.6472,268.698 50.5948,268.544 51.4817,268.132 52.2105,267.507 52.9393,266.882 53.4819,266.068 53.7785,265.155L75.7403,197.564C76.5724,195.003 78.3877,192.877 80.7869,191.655 83.1862,190.432 85.9727,190.213 88.5336,191.045z">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="4" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="InkRecognitionLineImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V412 H631 V0 H0 Z">
<GeometryDrawing Geometry="F1 M631,412z M0,0z M52.543,160.071C96.191,160.071 138.304,156.252 181.391,148.635 260.473,134.653 340.27,123.49 420.535,119.409 448.687,117.977 475.464,119.859 503.13,114.326">
<GeometryDrawing.Pen>
<Pen Brush="#FF3584E4" Thickness="6" StartLineCap="Round" EndLineCap="Round" LineJoin="Miter" MiterLimit="1" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M631,412z M0,0z M491.591,105.222L491.959,104.983C494.217,103.517 496.966,103.007 499.6,103.567 502.233,104.127 504.537,105.71 506.004,107.968L532.546,148.84C532.691,149.064 532.879,149.256 533.099,149.407 533.318,149.558 533.566,149.665 533.827,149.72 534.087,149.776 534.357,149.779 534.619,149.731 534.881,149.682 535.131,149.582 535.355,149.437L536.112,148.945C536.563,148.652 536.88,148.191 536.992,147.665 537.104,147.138 537.002,146.588 536.709,146.136L533.76,141.595C533.082,140.552 532.616,139.385 532.389,138.161 532.163,136.937 532.179,135.681 532.438,134.464 532.697,133.247 533.193,132.092 533.897,131.067 534.602,130.041 535.502,129.165 536.546,128.487 538.654,127.118 541.219,126.643 543.677,127.165 546.135,127.688 548.285,129.165 549.654,131.273L552.603,135.814C552.896,136.266 553.357,136.583 553.884,136.695 554.411,136.807 554.96,136.705 555.412,136.412L555.98,136.043C556.431,135.75 556.748,135.289 556.86,134.762 556.972,134.235 556.87,133.686 556.577,133.234L553.628,128.693C552.95,127.649 552.484,126.482 552.257,125.259 552.031,124.035 552.047,122.779 552.306,121.562 552.565,120.344 553.061,119.19 553.765,118.164 554.47,117.139 555.37,116.262 556.414,115.584 558.522,114.216 561.087,113.74 563.545,114.263 566.003,114.785 568.153,116.263 569.522,118.371L572.471,122.912C572.764,123.364 573.225,123.68 573.752,123.792 574.279,123.904 574.828,123.802 575.28,123.509L575.848,123.14C576.299,122.847 576.616,122.386 576.728,121.86 576.84,121.333 576.738,120.783 576.445,120.332L576.076,119.764C574.707,117.656 574.232,115.091 574.754,112.633 575.277,110.174 576.755,108.024 578.862,106.656 580.97,105.287 583.535,104.811 585.993,105.334 588.452,105.856 590.602,107.334 591.971,109.442L619.25,151.449C620.702,153.685 621.7,156.186 622.186,158.807 622.672,161.429 622.637,164.121 622.082,166.73 621.528,169.338 620.465,171.812 618.955,174.009 617.444,176.207 615.516,178.085 613.28,179.538L567.867,209.029C564.267,211.366 560.243,212.972 556.023,213.754 551.803,214.536 547.47,214.48 543.272,213.587L498.788,204.132C496.619,203.671 494.689,202.443 493.352,200.673 492.016,198.904 491.362,196.711 491.512,194.499L491.575,193.559C491.72,191.428 492.692,189.438 494.284,188.014 495.877,186.59 497.963,185.846 500.097,185.94L522.7,186.938C523.659,186.98 524.611,186.758 525.452,186.294 526.293,185.831 526.99,185.145 527.467,184.311 527.943,183.478 528.181,182.529 528.154,181.57 528.127,180.61 527.836,179.676 527.313,178.871L488.606,119.267C487.139,117.009 486.63,114.26 487.19,111.626 487.749,108.992 489.333,106.689 491.591,105.222z">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="4" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M631,412z M0,0z M349.47,3.39453C289.98,62.8845 220.883,115.103 168.778,181.291 145.074,211.401 120.158,239.802 97.873,271.002">
<GeometryDrawing.Pen>
<Pen Brush="#FF99C1F1" Thickness="6" StartLineCap="Round" EndLineCap="Round" LineJoin="Miter" MiterLimit="1" />
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M631,412z M0,0z M98.7065,261.153L99.1075,261.331C101.567,262.427 103.491,264.454 104.456,266.968 105.421,269.482 105.348,272.276 104.253,274.736L84.4313,319.256C84.3229,319.5 84.2634,319.763 84.2565,320.029 84.2495,320.296 84.2951,320.561 84.3906,320.81 84.4862,321.059 84.6299,321.287 84.8134,321.48 84.997,321.673 85.2168,321.829 85.4604,321.937L86.285,322.304C86.777,322.523 87.3358,322.538 87.8386,322.345 88.3414,322.152 88.7469,321.767 88.9659,321.275L91.1683,316.329C91.6745,315.192 92.3996,314.166 93.3022,313.309 94.2049,312.453 95.2674,311.782 96.4292,311.336 97.5909,310.89 98.8291,310.678 100.073,310.71 101.317,310.743 102.542,311.02 103.679,311.526 105.975,312.548 107.771,314.441 108.672,316.787 109.572,319.133 109.504,321.741 108.482,324.037L106.279,328.984C106.06,329.476 106.046,330.035 106.239,330.537 106.432,331.04 106.817,331.446 107.308,331.665L107.927,331.94C108.419,332.159 108.978,332.174 109.48,331.981 109.983,331.788 110.389,331.403 110.608,330.911L112.81,325.964C113.316,324.827 114.041,323.801 114.944,322.945 115.847,322.088 116.909,321.418 118.071,320.972 119.233,320.526 120.471,320.313 121.715,320.346 122.959,320.378 124.184,320.656 125.321,321.162 127.617,322.184 129.413,324.076 130.313,326.423 131.214,328.769 131.146,331.377 130.124,333.673L127.921,338.619C127.702,339.111 127.688,339.67 127.881,340.173 128.074,340.676 128.458,341.081 128.95,341.3L129.569,341.576C130.061,341.795 130.619,341.809 131.122,341.616 131.625,341.423 132.031,341.038 132.25,340.546L132.525,339.928C133.547,337.632 135.439,335.836 137.786,334.936 140.132,334.035 142.74,334.103 145.036,335.126 147.332,336.148 149.128,338.04 150.028,340.386 150.929,342.733 150.861,345.341 149.838,347.637L129.466,393.394C128.381,395.83 126.828,398.028 124.893,399.864 122.959,401.699 120.682,403.136 118.193,404.091 115.703,405.047 113.05,405.503 110.384,405.433 107.719,405.363 105.093,404.769 102.657,403.685L53.1898,381.661C49.269,379.915 45.7305,377.414 42.7762,374.301 39.822,371.188 37.5098,367.523 35.9718,363.516L19.6738,321.059C18.8791,318.989 18.8578,316.701 19.6139,314.616 20.37,312.532 21.8527,310.79 23.7898,309.71L24.6124,309.252C26.4783,308.212 28.6769,307.943 30.7383,308.503 32.7997,309.063 34.5602,310.408 35.6434,312.249L47.1169,331.749C47.6038,332.576 48.3093,333.253 49.1559,333.706 50.0025,334.159 50.9575,334.37 51.9161,334.316 52.8747,334.262 53.7998,333.945 54.5899,333.399 55.3801,332.854 56.0047,332.101 56.3952,331.224L85.3019,266.298C86.3971,263.839 88.4246,261.914 90.9385,260.95 93.4523,259.985 96.2466,260.058 98.7065,261.153z">
<GeometryDrawing.Pen>
<Pen Brush="#FF98C1F1" Thickness="4" StartLineCap="Flat" EndLineCap="Flat" LineJoin="Miter" />
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="CursorIconImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#2e3436" Geometry="F1 M24,24z M0,0z M22.7989,10.1653L1.14304,1.14304 10.1653,22.7989 12.8305,14.9518 19.6892,21.8105 21.8105,19.6892 14.9518,12.8305 22.7989,10.1653z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="PanningIconImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#2e3436" Geometry="F1 M24,24z M0,0z M12.1286,0.106764C12.3007,0.0362808 12.4851,0 12.6713,0 12.8575,0 13.0419,0.0362803 13.2139,0.106757 13.386,0.17727 13.5424,0.280597 13.674,0.410823 13.8056,0.541031 13.9101,0.695722 13.9814,0.865884 14.0526,1.03602 14.0893,1.2184 14.0893,1.4026L14.0893,12C14.0893,12.2582 14.3009,12.4675 14.562,12.4675 14.823,12.4675 15.0347,12.2582 15.0347,12L15.0347,3.8961C15.0347,3.52408 15.184,3.16733 15.4499,2.90432 15.7158,2.6413 16.0766,2.49351 16.4527,2.49351 16.8288,2.49351 17.1895,2.6413 17.4554,2.90432 17.7213,3.16733 17.8707,3.52408 17.8707,3.8961L17.8707,12C17.8707,12.2582 18.0823,12.4675 18.3434,12.4675 18.6044,12.4675 18.8161,12.2582 18.8161,12L18.8161,6.38961C18.8161,6.01759 18.9655,5.66083 19.2314,5.39782 19.4973,5.13481 19.858,4.98701 20.2341,4.98701 20.6102,4.98701 20.9709,5.13481 21.2368,5.39782 21.5027,5.66083 21.6521,6.01759 21.6521,6.38961L21.6521,16.987C21.6521,18.847 20.9051,20.6308 19.5754,21.9459 18.2458,23.2611 16.4425,24 14.562,24L12.3007,24 11.9104,23.9893C10.8722,23.9325 9.85756,23.6504 8.9393,23.1611 7.90551,22.6102 7.02629,21.8141 6.38051,20.8442L6.04494,20.3319C5.76921,19.8931,5.21091,18.9445,4.37144,17.4884L2.00874,13.3566C1.82765,13.0382 1.77929,12.6626 1.87391,12.3096 1.96854,11.9564 2.19866,11.6538 2.51547,11.4659 2.8751,11.2525 3.29636,11.1641 3.71242,11.2146 4.12852,11.2652 4.51562,11.4518 4.81224,11.7448L6.66493,13.5773C6.9627,13.8719,7.47184,13.6633,7.47184,13.2468L7.47184,3.8961C7.47184,3.52412 7.62124,3.16735 7.88717,2.90432 8.15309,2.64128 8.51379,2.49351 8.88986,2.49351 9.26595,2.49351 9.62663,2.64128 9.89256,2.90432 10.1585,3.16735 10.3079,3.52411 10.3079,3.8961L10.3079,12C10.3079,12.2582 10.5195,12.4675 10.7806,12.4675 11.0416,12.4675 11.2532,12.2582 11.2532,12L11.2532,1.4026C11.2532,1.21841 11.2899,1.03601 11.3612,0.865835 11.4324,0.695679 11.5369,0.541056 11.6686,0.410811 11.8003,0.280567 11.9566,0.17725 12.1286,0.106764z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="UndoIconImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#2e3436" Geometry="F1 M24,24z M0,0z M8.71408,16.8493L0.874451,9.00964 8.71408,1.17001 8.71408,7.42358 15.7239,7.42358C16.7074,7.42358 17.6791,7.62744 18.583,8.02124 19.4866,8.41493 20.3023,8.98966 20.9857,9.70849 21.6689,10.4271 22.2069,11.276 22.5726,12.2047 22.9383,13.1333 23.1256,14.126 23.1256,15.1268 23.1256,16.1276 22.9383,17.1203 22.5726,18.0489 22.2069,18.9776 21.6689,19.8264 20.9857,20.5451 20.3023,21.2639 19.4866,21.8387 18.583,22.2324 17.6791,22.6262 16.7074,22.83 15.7239,22.83L10.437,22.83 10.437,19.6579 15.7239,19.6579C16.2679,19.6579 16.8086,19.5453 17.3159,19.3243 17.8235,19.1031 18.29,18.7767 18.6867,18.3594 19.0835,17.942 19.4023,17.4422 19.6211,16.8866 19.8399,16.3308 19.9534,15.7326 19.9534,15.1268 19.9534,14.5209 19.8399,13.9227 19.6211,13.367 19.4023,12.8114 19.0835,12.3115 18.6867,11.8941 18.29,11.4769 17.8235,11.1505 17.3159,10.9293 16.8086,10.7083 16.2679,10.5957 15.7239,10.5957L8.71408,10.5957 8.71408,16.8493z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="RedoIconImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#FF000000" Geometry="F1 M24,24z M0,0z M15.2859,16.8493L23.1255,9.00964 15.2859,1.17001 15.2859,7.42358 8.27607,7.42358C7.29262,7.42358 6.32086,7.62744 5.41703,8.02124 4.51341,8.41493 3.69773,8.98966 3.01434,9.70849 2.33111,10.4271 1.79312,11.276 1.42741,12.2047 1.06174,13.1333 0.874422,14.126 0.874422,15.1268 0.874422,16.1276 1.06174,17.1203 1.42741,18.0489 1.79312,18.9776 2.33111,19.8264 3.01434,20.5451 3.69773,21.2639 4.51341,21.8387 5.41703,22.2324 6.32086,22.6262 7.29262,22.83 8.27607,22.83L13.563,22.83 13.563,19.6579 8.27607,19.6579C7.7321,19.6579 7.19139,19.5453 6.68406,19.3243 6.17652,19.1031 5.70999,18.7767 5.31333,18.3594 4.91651,17.942 4.59775,17.4422 4.37894,16.8866 4.1601,16.3308 4.04656,15.7326 4.04656,15.1268 4.04656,14.5209 4.1601,13.9227 4.37894,13.367 4.59775,12.8114 4.91651,12.3115 5.31333,11.8941 5.70999,11.4769 6.17652,11.1505 6.68406,10.9293 7.19139,10.7083 7.7321,10.5957 8.27607,10.5957L15.2859,10.5957 15.2859,16.8493z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="ErrorIconImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<DrawingGroup.Transform>
<TranslateTransform X="1.2107193470001221E-07" Y="0" />
</DrawingGroup.Transform>
<GeometryDrawing Brush="#e01b24" Geometry="F1 M16,16z M0,0z M7.99988,0C7.74396,0,7.48812,0.0976987,7.29285,0.292969L0.292852,7.29297C-0.0976175,7.68352,-0.0976175,8.31648,0.292852,8.70703L7.29285,15.707C7.6834,16.0975,8.31636,16.0975,8.70691,15.707L15.705,8.70703C16.0954,8.31648,16.0954,7.68352,15.705,7.29297L8.70691,0.292969C8.51164,0.0977287,8.2558,0,7.99988,0z M6.99988,3L8.99988,3 8.99988,9C8.99988,9 8.99988,10 7.99988,10 6.99988,10 6.99988,9 6.99988,9L6.99988,3z M6.99988,11L8.99988,11 8.99988,13 6.99988,13 6.99988,11z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="SuccessIconImage">
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<DrawingGroup.Transform>
<TranslateTransform X="0.0063476599752902985" Y="0" />
</DrawingGroup.Transform>
<GeometryDrawing Brush="#26a269" Geometry="F0 M16,16z M0,0z M-0.00634766,8C-0.00634766,3.59388 3.58698,0 7.99365,0 12.4003,0 15.9937,3.59388 15.9937,8 15.9937,12.4061 12.4003,16 7.99365,16 3.58698,16 -0.00634766,12.4061 -0.00634766,8z M11.6391,7.14113C12.0955,6.68617 11.8035,5.90575 11.1604,5.86185 10.9434,5.84603 10.7302,5.92512 10.5761,6.07863L7.46503,9.18821 5.8187,7.60897C5.11019,6.90064,4.04717,7.96314,4.75569,8.67147L6.93352,10.782C7.22677,11.0761,7.7033,11.0761,7.99654,10.782L11.6391,7.14113z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Window.Resources>
<WindowChrome.WindowChrome>
<WindowChrome GlassFrameThickness="-1" ResizeBorderThickness="0" CaptionHeight="0" CornerRadius="0" />
</WindowChrome.WindowChrome>
<Grid>
<Border x:Name="MainBorder" Background="#fafafa" CornerRadius="7" BorderBrush="#3584e4" BorderThickness="2" Margin="8">
<Grid>
<!--Sidebar-->
<Border x:Name="SidebarBorder" Width="250" Background="#ebebeb" BorderBrush="#e1e1e1" CornerRadius="7,0,0,7" BorderThickness="0,0,2,0" HorizontalAlignment="Left">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Height="48" VerticalAlignment="Top" Grid.Row="0"
Background="Transparent"
MouseLeftButtonDown="SidebarTopBar_MouseLeftButtonDown">
<Border x:Name="SearchButtonBorder" CornerRadius="8" Background="#d9d9d9" Width="34" Height="34" Margin="8,0,0,0" HorizontalAlignment="Left" MouseLeftButtonDown="SearchButton_Click" Cursor="Hand">
<Image Width="16" Height="16">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V17 H16 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F1 M16,17z M0,0z M6.9333,0.111572C3.11689,0.111572 -5.16259E-07,3.22999 -5.16259E-07,7.04827 -5.16259E-07,10.8665 3.11689,13.9829 6.9333,13.9829 8.45757,13.9829 9.86954,13.4831 11.0166,12.6427L14.1583,15.7858C15.1805,16.7869,16.6805,15.2528,15.6583,14.2518L12.5333,11.1252C13.3704,9.97933 13.8666,8.57003 13.8666,7.04827 13.8666,3.22999 10.7497,0.111572 6.9333,0.111572z M6.9333,2.24594C9.59676,2.24594 11.7333,4.38351 11.7333,7.04827 11.7333,9.71302 9.59676,11.8485 6.9333,11.8485 4.26985,11.8485 2.13332,9.71302 2.13332,7.04827 2.13332,4.38351 4.26985,2.24594 6.9333,2.24594z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Border>
<TextBlock x:Name="TitleTextBlock" FontSize="15" Text="软件设置" Foreground="#2e3436" FontWeight="Bold"
VerticalAlignment="Center" HorizontalAlignment="Center" IsHitTestVisible="False"/>
<Border CornerRadius="8" Background="#d9d9d9" Width="34" Height="34" Margin="0,0,8,0" HorizontalAlignment="Right" PreviewMouseLeftButtonDown="MenuButton_Click" Cursor="Hand" x:Name="MenuButtonBorder">
<Image Width="16" Height="16">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V16 H16 V0 H0 Z">
<GeometryDrawing Brush="#FF222222" Geometry="F0 M16,16z M0,0z M15,2L1,2 1,4 15,4 15,2z M15,7L1,7 1,9 15,9 15,7z M1,12L15,12 15,14 1,14 1,12z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<Border.ContextMenu>
<ContextMenu x:Name="MenuButtonContextMenu" ui:ThemeManager.RequestedTheme="Light" Padding="6">
<MenuItem Header="退出软件" Click="MenuItemExit_Click">
<MenuItem.Icon>
<Image Width="16" Height="16">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#FF222222"
Geometry="F1 M24,24z M0,0z M13,2C13,1.44772 12.5523,1 12,1 11.4477,1 11,1.44772 11,2L11,12C11,12.5523 11.4477,13 12,13 12.5523,13 13,12.5523 13,12L13,2z" />
<GeometryDrawing Brush="#FF222222"
Geometry="F1 M24,24z M0,0z M19.1073,5.89303C18.7168,5.50243 18.0837,5.50232 17.6931,5.89277 17.3025,6.28322 17.3024,6.91639 17.6928,7.30698 18.8098,8.42441 19.571,9.84758 19.8802,11.397 20.1894,12.9464 20.0329,14.5528 19.4305,16.0134 18.828,17.474 17.8065,18.7235 16.4948,19.6043 15.1831,20.4851 13.64,20.9578 12.06,20.9628 10.48,20.9677 8.93392,20.5047 7.61674,19.6321 6.29956,18.7595 5.27025,17.5164 4.65863,16.0596 4.04701,14.6028 3.88046,12.9975 4.17999,11.4462 4.47952,9.89485 5.23171,8.46694 6.3417,7.34254 6.7297,6.9495 6.72562,6.31635 6.33258,5.92835 5.93955,5.54036 5.3064,5.54444 4.9184,5.93747 3.5309,7.34298 2.59067,9.12786 2.21626,11.067 1.84185,13.0062 2.05003,15.0128 2.81456,16.8338 3.57909,18.6549 4.86572,20.2087 6.5122,21.2994 8.15867,22.3902 10.0913,22.9689 12.0662,22.9627 14.0412,22.9566 15.9701,22.3657 17.6098,21.2647 19.2494,20.1637 20.5262,18.6018 21.2793,16.776 22.0324,14.9502 22.2281,12.9424 21.8415,11.0056 21.455,9.06878 20.5036,7.28981 19.1073,5.89303z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="重启软件" Click="MenuItemRestart_Click">
<MenuItem.Icon>
<Image Width="16" Height="16">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#FF222222"
Geometry="F1 M24,24z M0,0z M6.34315,6.34315C7.84299,4.8433 9.87707,4.0005 11.9981,4 14.2527,4.00897 16.4167,4.88785 18.039,6.45324L18.5858,7 16,7C15.4477,7 15,7.44772 15,8 15,8.55228 15.4477,9 16,9L21,9C21.1356,9 21.2649,8.97301 21.3828,8.92412 21.5007,8.87532 21.6112,8.80298 21.7071,8.70711 21.8902,8.52405 21.9874,8.28768 21.9989,8.04797 21.9996,8.03199 22,8.016 22,8L22,3C22,2.44772 21.5523,2 21,2 20.4477,2 20,2.44772 20,3L20,5.58579 19.4471,5.03289 19.435,5.02103C17.4405,3.09289,14.7779,2.01044,12.0038,2L12,2C9.34784,2 6.8043,3.05357 4.92893,4.92893 3.05357,6.8043 2,9.34784 2,12 2,12.5523 2.44772,13 3,13 3.55228,13 4,12.5523 4,12 4,9.87827 4.84285,7.84344 6.34315,6.34315z" />
<GeometryDrawing Brush="#FF222222"
Geometry="F1 M24,24z M0,0z M22,12C22,14.6522 20.9464,17.1957 19.0711,19.0711 17.1957,20.9464 14.6522,22 12,22L11.9962,22C9.22213,21.9896,6.55946,20.9071,4.56496,18.979L4.55289,18.9671 4,18.4142 4,21C4,21.5523 3.55228,22 3,22 2.44772,22 2,21.5523 2,21L2,16.0002C2,15.8646 2.02699,15.7351 2.07588,15.6172 2.12432,15.5001 2.19595,15.3904 2.29078,15.295 2.29219,15.2936 2.2936,15.2922 2.29502,15.2908 2.48924,15.0977 2.74301,15.0008 2.997,15 2.998,15 2.999,15 3,15L8,15C8.55228,15 9,15.4477 9,16 9,16.5523 8.55228,17 8,17L5.41421,17 5.96095,17.5467C7.5833,19.1122 9.74736,19.9911 12.002,20 14.123,19.9995 16.157,19.1567 17.6569,17.6569 19.1571,16.1566 20,14.1217 20,12 20,11.4477 20.4477,11 21,11 21.5523,11 22,11.4477 22,12z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="重置配置" Click="MenuItemReset_Click">
<MenuItem.Icon>
<Image Width="16" Height="16">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#FF222222"
Geometry="F1 M24,24z M0,0z M2,6C2,5.44772,2.44772,5,3,5L21,5C21.5523,5 22,5.44772 22,6 22,6.55228 21.5523,7 21,7L3,7C2.44772,7,2,6.55228,2,6z" />
<GeometryDrawing Brush="#FF222222"
Geometry="F1 M24,24z M0,0z M2,12C2,11.4477,2.44772,11,3,11L7,11C7.55228,11 8,11.4477 8,12 8,12.5523 7.55228,13 7,13L3,13C2.44772,13,2,12.5523,2,12z" />
<GeometryDrawing Brush="#FF222222"
Geometry="F1 M24,24z M0,0z M3,17C2.44772,17 2,17.4477 2,18 2,18.5523 2.44772,19 3,19L7,19C7.55228,19 8,18.5523 8,18 8,17.4477 7.55228,17 7,17L3,17z" />
<GeometryDrawing Brush="#FF222222"
Geometry="F1 M24,24z M0,0z M12.3829,11.2029C13.4335,10.1522 14.8952,9.5 16.5,9.5 17.9587,9.5 19.3576,10.0795 20.3891,11.1109 21.4205,12.1424 22,13.5413 22,15 22,16.2593 21.6038,17.4867 20.8675,18.5083 20.1311,19.5299 19.092,20.2939 17.8974,20.6921 16.7027,21.0903 15.413,21.1026 14.211,20.7271 13.009,20.3516 11.9556,19.6074 11.2,18.6 10.8686,18.1582 10.9582,17.5314 11.4,17.2 11.8418,16.8686 12.4686,16.9582 12.8,17.4 13.3037,18.0716 14.006,18.5677 14.8073,18.8181 15.6087,19.0684 16.4685,19.0602 17.2649,18.7947 18.0614,18.5292 18.7541,18.0199 19.245,17.3388 19.7359,16.6578 20,15.8395 20,15 20,14.0717 19.6313,13.1815 18.9749,12.5251 18.3185,11.8687 17.4283,11.5 16.5,11.5 15.4448,11.5 14.4865,11.9278 13.7971,12.6171L13.4142,13 15,13C15.5523,13 16,13.4477 16,14 16,14.5523 15.5523,15 15,15L11.0007,15C10.9997,15 10.998,15 10.997,15 10.8625,14.9996 10.7343,14.9727 10.6172,14.9241 10.5001,14.8757 10.3904,14.804 10.295,14.7092 10.2936,14.7078 10.2922,14.7064 10.2908,14.705 10.196,14.6096 10.1243,14.4999 10.0759,14.3828 10.027,14.2649 10,14.1356 10,14L10,10C10,9.44772 10.4477,9 11,9 11.5523,9 12,9.44772 12,10L12,11.5858 12.3829,11.2029z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</MenuItem.Icon>
</MenuItem>
<Separator/>
<MenuItem Header="切换到老设置" Click="MenuItemSwitchToOldSettings_Click"/>
</ContextMenu>
</Border.ContextMenu>
</Border>
</Grid>
<ScrollViewer Margin="0,0,0,6"
VerticalScrollBarVisibility="Hidden"
HorizontalScrollBarVisibility="Disabled"
IsManipulationEnabled="True"
PanningMode="VerticalOnly"
CanContentScroll="True"
Grid.Row="1">
<ItemsControl Name="SidebarItemsControl">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Margin="0,6,0,0"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Line Visibility="{Binding _spVisibility}" Margin="0,6" HorizontalAlignment="Center" X1="0" X2="234" Y1="0" Y2="0" Stroke="{Binding _spStroke}" StrokeThickness="1" StrokeStartLineCap="Round" StrokeEndLineCap="Round"/>
<Border MouseDown="SidebarItem_MouseDown" MouseUp="SidebarItem_MouseUp" MouseLeave="SidebarItem_MouseLeave"
Tag="{Binding}" Visibility="{Binding _siVisibility}" Background="{Binding _siBackground}" Height="40" Margin="6,0,6,0" CornerRadius="7">
<Grid>
<Border Height="40" CornerRadius="7" Background="#09090b" IsHitTestVisible="false" Opacity="0" Name="MouseFeedbackBorder"/>
<StackPanel Orientation="Horizontal">
<Image Width="18" Height="18" Margin="14,0,9,0" VerticalAlignment="Center" Source="{Binding IconSource}"/>
<TextBlock FontSize="14" VerticalAlignment="Center" Text="{Binding Title}" Foreground="{Binding _siForeground}"/>
</StackPanel>
</Grid>
</Border>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</Border>
<!--SecurityPanel-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="SecurityPane">
<settingsViews:SecurityPanel x:Name="SecurityPanel"/>
</Grid>
<!--UpdateCenterPanel-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="UpdateCenterPane">
<settingsViews:UpdateCenterPanel x:Name="UpdateCenterPanel"/>
</Grid>
<!--AboutPanel-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="AboutPane">
<settingsViews:AboutPanel x:Name="SettingsAboutPanel"/>
</Grid>
<!--CanvasAndInkPanel-->
<Grid Margin="250,48,0,0" Visibility="Visible" Name="CanvasAndInkPane">
<settingsViews:CanvasAndInkPanel x:Name="CanvasAndInkPanel"/>
</Grid>
<!--GesturesPanel-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="GesturesPane">
<settingsViews:GesturesPanel x:Name="GesturesPanel"/>
</Grid>
<!--StartupPanel-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="StartupPane">
<settingsViews:StartupPanel x:Name="StartupPanel"/>
</Grid>
<!--AppearancePanel-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="AppearancePane">
<settingsViews:AppearancePanel x:Name="AppearancePanel"/>
</Grid>
<!--InkRecognitionPanel-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="InkRecognitionPane">
<settingsViews:InkRecognitionPanel x:Name="InkRecognitionPanel"/>
</Grid>
<!--AutomationPanel-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="AutomationPane">
<settingsViews:AutomationPanel x:Name="AutomationPanel"/>
</Grid>
<!--PowerPointPanel-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="PowerPointPane">
<settingsViews:PowerPointPanel x:Name="PowerPointPanel"/>
</Grid>
<!--个性化设置面板-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="ThemePane">
<settingsViews:ThemePanel x:Name="ThemePanel"/>
</Grid>
<!--快捷键设置面板-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="ShortcutsPane">
<settingsViews:ShortcutsPanel x:Name="ShortcutsPanel"/>
</Grid>
<!--崩溃处理面板-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="CrashActionPane">
<settingsViews:CrashActionPanel x:Name="CrashActionPanel"/>
</Grid>
<!--幸运随机面板-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="LuckyRandomPane">
<settingsViews:LuckyRandomPanel x:Name="LuckyRandomPanel"/>
</Grid>
<!--高级面板-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="AdvancedPane">
<settingsViews:AdvancedPanel x:Name="AdvancedPanel"/>
</Grid>
<!--截图面板-->
<Grid Margin="250,48,0,0" Visibility="Collapsed" Name="SnapshotPane">
<settingsViews:SnapshotPanel x:Name="SnapshotPanel"/>
</Grid>
<!--SearchPanel-->
<Grid Margin="0,0,0,0" Visibility="Collapsed" Name="SearchPane" ZIndex="1000">
<settingsViews:SearchPanel x:Name="SearchPanelControl"/>
</Grid>
<!--Topbar-->
<Grid Height="48" VerticalAlignment="Top" Margin="250,0,0,0">
<Border x:Name="TopBarBorder" Height="48" CornerRadius="0,6,0,0" Background="#fafafa"
MouseLeftButtonDown="TopBarBorder_MouseLeftButtonDown">
<Border.Clip>
<RectangleGeometry Rect="0,0,640,56"/>
</Border.Clip>
<Border x:Name="TopBarBackgroundBorder" Height="48" CornerRadius="0,6,0,0" Background="#fafafa" >
<Border.Effect>
<DropShadowEffect Direction="-90" ShadowDepth="3" BlurRadius="4" Color="#000000" Opacity="0.25" x:Name="DropShadowEffectTopBar"/>
</Border.Effect>
</Border>
</Border>
<TextBlock FontSize="16" Text="设置标题" Name="SettingsWindowTitle" Foreground="#2e3436" FontWeight="Bold"
VerticalAlignment="Center" HorizontalAlignment="Center" IsHitTestVisible="False"/>
<Border CornerRadius="8" Background="#33ef4444" Width="34" Height="34" Margin="0,0,8,0" HorizontalAlignment="Right" MouseLeftButtonDown="CloseButton_Click" Cursor="Hand">
<Image Width="12" Height="12">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V12 H12 V0 H0 Z">
<GeometryDrawing Brush="#991b1b" Geometry="F1 M12,12z M0,0z M0.999846,0C0.734646,4.07258E-05 0.480321,0.105424 0.292816,0.29297 0.105327,0.4805 0,0.734821 0,1 0,1.26518 0.105327,1.5195 0.292816,1.70703L4.58579,6 0.292816,10.293C0.105327,10.4805 0,10.7348 0,11 0,11.2652 0.105327,11.5195 0.292816,11.707 0.480347,11.8945 0.734668,11.9998 0.999846,11.9998 1.26503,11.9998 1.51935,11.8945 1.70688,11.707L5.99985,7.41406 10.2928,11.707C10.4803,11.8945 10.7347,11.9998 10.9998,11.9998 11.265,11.9998 11.5193,11.8945 11.7069,11.707 11.8944,11.5195 11.9997,11.2652 11.9997,11 11.9997,10.7348 11.8944,10.4805 11.7069,10.293L7.41391,6 11.7069,1.70703C11.8944,1.5195 11.9997,1.26518 11.9997,1 11.9997,0.734821 11.8944,0.4805 11.7069,0.29297 11.5194,0.105424 11.265,4.07258E-05 10.9998,0 10.7346,4.07258E-05 10.4803,0.105424 10.2928,0.29297L5.99985,4.58594 1.70688,0.29297C1.51937,0.105424,1.26505,4.07258E-05,0.999846,0z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Border>
</Grid>
</Grid>
</Border>
</Grid>
</Window>
File diff suppressed because it is too large Load Diff
@@ -7,7 +7,7 @@ using System.Windows.Controls;
using System.Windows.Input;
using Media = System.Windows.Media;
namespace Ink_Canvas.Windows.SettingsViews
namespace Ink_Canvas.Windows.SettingsViews2
{
public static class MainWindowSettingsHelper
{
@@ -331,35 +331,10 @@ namespace Ink_Canvas.Windows.SettingsViews
// 查找所有打开的设置窗口
foreach (Window window in Application.Current.Windows)
{
if (window.GetType().Name == "SettingsWindow")
if (window.GetType().Name == "SettingsWindow2")
{
// 根据控件名称确定需要同步的面板
var panelToSync = GetPanelForControl(controlName);
if (panelToSync != null)
{
// 获取对应的面板属性
var panelProp = window.GetType().GetProperty(panelToSync, BindingFlags.Public | BindingFlags.Instance);
if (panelProp != null)
{
var panel = panelProp.GetValue(window) as System.Windows.Controls.UserControl;
if (panel != null)
{
// 调用 LoadSettings 方法重新加载设置
var loadMethod = panel.GetType().GetMethod("LoadSettings",
BindingFlags.Public | BindingFlags.Instance);
if (loadMethod != null)
{
loadMethod.Invoke(panel, null);
}
}
}
}
else
{
// 如果无法确定具体面板,则同步所有面板(保守策略)
SyncAllPanels(window);
}
// 同步所有面板(保守策略)
SyncAllPanels(window);
break; // 通常只有一个设置窗口
}
}
@@ -371,102 +346,6 @@ namespace Ink_Canvas.Windows.SettingsViews
}
}
/// <summary>
/// 根据控件名称获取对应的面板名称
/// </summary>
private static string GetPanelForControl(string controlName)
{
// 定义控件名称到面板名称的映射
var controlToPanel = new Dictionary<string, string>
{
// StartupPanel
{ "ToggleSwitchIsAutoUpdate", "StartupPanel" },
{ "ToggleSwitchIsAutoUpdateWithSilence", "StartupPanel" },
{ "ToggleSwitchRunAtStartup", "StartupPanel" },
{ "ToggleSwitchFoldAtStartup", "StartupPanel" },
{ "AutoUpdateWithSilenceStartTimeComboBox", "StartupPanel" },
{ "AutoUpdateWithSilenceEndTimeComboBox", "StartupPanel" },
// ThemePanel
{ "ComboBoxTheme", "ThemePanel" },
{ "ToggleSwitchEnableSplashScreen", "ThemePanel" },
{ "ComboBoxSplashScreenStyle", "ThemePanel" },
{ "ToggleSwitchEnableTrayIcon", "ThemePanel" },
{ "ComboBoxFloatingBarImg", "ThemePanel" },
{ "ComboBoxUnFoldBtnImg", "ThemePanel" },
{ "ComboBoxChickenSoupSource", "ThemePanel" },
{ "ComboBoxQuickColorPaletteDisplayMode", "ThemePanel" },
{ "ComboBoxEraserDisplayOption", "ThemePanel" },
{ "ToggleSwitchEnableQuickPanel", "ThemePanel" },
{ "ViewboxFloatingBarScaleTransformValueSlider", "ThemePanel" },
{ "ViewboxFloatingBarOpacityValueSlider", "ThemePanel" },
{ "ViewboxFloatingBarOpacityInPPTValueSlider", "ThemePanel" },
// PowerPointPanel
{ "ToggleSwitchSupportPowerPoint", "PowerPointPanel" },
{ "ToggleSwitchShowPPTButton", "PowerPointPanel" },
{ "ToggleSwitchEnablePPTButtonPageClickable", "PowerPointPanel" },
{ "ToggleSwitchShowCanvasAtNewSlideShow", "PowerPointPanel" },
{ "PPTButtonLeftPositionValueSlider", "PowerPointPanel" },
{ "PPTButtonRightPositionValueSlider", "PowerPointPanel" },
// GesturesPanel
{ "ToggleSwitchEnableTwoFingerRotationOnSelection", "GesturesPanel" },
{ "ToggleSwitchEnablePalmEraser", "GesturesPanel" },
{ "ComboBoxPalmEraserSensitivity", "GesturesPanel" },
// CanvasAndInkPanel
{ "ToggleSwitchShowCursor", "CanvasAndInkPanel" },
{ "ToggleSwitchDisablePressure", "CanvasAndInkPanel" },
{ "ToggleSwitchEnablePressureTouchMode", "CanvasAndInkPanel" },
{ "ToggleSwitchLaunchSeewoVideoShowcaseForWhiteboardBooth", "CanvasAndInkPanel" },
{ "ComboBoxEraserSize", "CanvasAndInkPanel" },
{ "ComboBoxHyperbolaAsymptoteOption", "CanvasAndInkPanel" },
{ "ComboBoxAutoSaveStrokesInterval", "CanvasAndInkPanel" },
// SnapshotPanel
{ "AutoSavedStrokesLocation", "SnapshotPanel" },
{ "ComboBoxAutoDelSavedFilesDaysThreshold", "SnapshotPanel" },
{ "ToggleSwitchAutoDelSavedFiles", "SnapshotPanel" },
// AdvancedPanel
{ "ComboBoxAutoBackupInterval", "AdvancedPanel" },
{ "ToggleSwitchIsQuadIR", "AdvancedPanel" },
{ "ToggleSwitchIsLogEnabled", "AdvancedPanel" },
{ "ToggleSwitchIsSaveLogByDate", "AdvancedPanel" },
{ "ToggleSwitchIsSecondConfimeWhenShutdownApp", "AdvancedPanel" },
{ "ToggleSwitchIsEnableFullScreenHelper", "AdvancedPanel" },
{ "ToggleSwitchIsEnableAvoidFullScreenHelper", "AdvancedPanel" },
{ "ToggleSwitchIsEnableEdgeGestureUtil", "AdvancedPanel" },
{ "ToggleSwitchIsEnableForceFullScreen", "AdvancedPanel" },
{ "ToggleSwitchIsEnableDPIChangeDetection", "AdvancedPanel" },
{ "ToggleSwitchIsEnableResolutionChangeDetection", "AdvancedPanel" },
{ "ToggleSwitchIsAutoBackupBeforeUpdate", "AdvancedPanel" },
{ "ToggleSwitchIsAutoBackupEnabled", "AdvancedPanel" },
{ "ToggleSwitchIsEnableUriScheme", "AdvancedPanel" },
// LuckyRandomPanel
{ "ToggleSwitchDisplayRandWindowNamesInputBtn", "LuckyRandomPanel" },
{ "ToggleSwitchShowRandomAndSingleDraw", "LuckyRandomPanel" },
{ "ToggleSwitchEnableQuickDraw", "LuckyRandomPanel" },
{ "ToggleSwitchExternalCaller", "LuckyRandomPanel" },
{ "ComboBoxExternalCallerType", "LuckyRandomPanel" },
{ "RandWindowOnceCloseLatencySlider", "LuckyRandomPanel" },
{ "RandWindowOnceMaxStudentsSlider", "LuckyRandomPanel" },
};
// 查找匹配的面板
foreach (var kvp in controlToPanel)
{
if (controlName.Contains(kvp.Key) || kvp.Key.Contains(controlName))
{
return kvp.Value;
}
}
return null;
}
/// <summary>
/// 同步所有面板的状态(保守策略)
/// </summary>
@@ -474,36 +353,36 @@ namespace Ink_Canvas.Windows.SettingsViews
{
try
{
// 获取所有面属性
var panelProperties = settingsWindow.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)
.Where(p => p.PropertyType.Name.EndsWith("Panel") &&
p.PropertyType.IsSubclassOf(typeof(System.Windows.Controls.UserControl)));
// 获取所有面属性
var pageProperties = settingsWindow.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)
.Where(p => p.PropertyType.Name.EndsWith("Page") &&
p.PropertyType.IsSubclassOf(typeof(System.Windows.Controls.Page)));
foreach (var panelProp in panelProperties)
foreach (var pageProp in pageProperties)
{
try
{
var panel = panelProp.GetValue(settingsWindow) as System.Windows.Controls.UserControl;
if (panel != null)
var page = pageProp.GetValue(settingsWindow) as System.Windows.Controls.Page;
if (page != null)
{
// 调用 LoadSettings 方法
var loadMethod = panel.GetType().GetMethod("LoadSettings",
var loadMethod = page.GetType().GetMethod("LoadSettings",
BindingFlags.Public | BindingFlags.Instance);
if (loadMethod != null)
{
loadMethod.Invoke(panel, null);
loadMethod.Invoke(page, null);
}
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"同步面 {panelProp.Name} 状态失败: {ex.Message}");
System.Diagnostics.Debug.WriteLine($"同步面 {pageProp.Name} 状态失败: {ex.Message}");
}
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"同步所有面状态失败: {ex.Message}");
System.Diagnostics.Debug.WriteLine($"同步所有面状态失败: {ex.Message}");
}
}
@@ -568,7 +447,7 @@ namespace Ink_Canvas.Windows.SettingsViews
}
/// <summary>
/// 通知设置窗口更新所有面的主题
/// 通知设置窗口更新所有面的主题
/// </summary>
private static void NotifySettingsWindowThemeUpdate()
{
@@ -577,17 +456,9 @@ namespace Ink_Canvas.Windows.SettingsViews
// 查找所有打开的设置窗口
foreach (Window window in Application.Current.Windows)
{
// 使用类型名称匹配,因为 SettingsWindow 在不同的命名空间中
if (window.GetType().Name == "SettingsWindow")
// 使用类型名称匹配,因为 SettingsWindow2 在不同的命名空间中
if (window.GetType().Name == "SettingsWindow2")
{
// 使用反射调用 ApplyThemeToAllPanels 方法
var method = window.GetType().GetMethod("ApplyThemeToAllPanels",
BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
if (method != null)
{
method.Invoke(window, null);
}
// 同时调用 ApplyTheme 方法更新窗口本身
var applyThemeMethod = window.GetType().GetMethod("ApplyTheme",
BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
@@ -607,7 +478,7 @@ namespace Ink_Canvas.Windows.SettingsViews
}
/// <summary>
/// 强制更新所有设置面的主题(公共方法,可在外部调用)
/// 强制更新所有设置面的主题(公共方法,可在外部调用)
/// </summary>
public static void ForceUpdateAllPanelsTheme()
{
@@ -711,4 +582,3 @@ namespace Ink_Canvas.Windows.SettingsViews
}
}
}
@@ -97,7 +97,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
bool newState = ToggleSwitchNoFocusMode.IsOn;
// 使用Helper类更新设置并应用
Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchNoFocusMode", newState);
Windows.SettingsViews2.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchNoFocusMode", newState);
}
catch (Exception ex)
{
@@ -117,7 +117,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
bool newState = ToggleSwitchWindowMode.IsOn;
// 使用Helper类更新设置并应用
Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchWindowMode", newState);
Windows.SettingsViews2.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchWindowMode", newState);
}
catch (Exception ex)
{
@@ -137,7 +137,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
bool newState = ToggleSwitchAlwaysOnTop.IsOn;
// 使用Helper类更新设置并应用
Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAlwaysOnTop", newState);
Windows.SettingsViews2.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchAlwaysOnTop", newState);
}
catch (Exception ex)
{
@@ -166,7 +166,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
MainWindow.SaveSettingsToFile();
// 通知其他面板同步状态
Windows.SettingsViews.MainWindowSettingsHelper.NotifySettingsPanelsSyncState("ToggleSwitchUIAccessTopMost");
Windows.SettingsViews2.MainWindowSettingsHelper.NotifySettingsPanelsSyncState("ToggleSwitchUIAccessTopMost");
}
catch (Exception ex)
{
@@ -190,7 +190,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
bool newState = ToggleSwitchRunAtStartup.IsOn;
// 使用Helper类更新设置并应用
Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchRunAtStartup", newState);
Windows.SettingsViews2.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchRunAtStartup", newState);
}
catch (Exception ex)
{
@@ -210,7 +210,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
bool newState = ToggleSwitchFoldAtStartup.IsOn;
// 使用Helper类更新设置并应用
Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchFoldAtStartup", newState);
Windows.SettingsViews2.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchFoldAtStartup", newState);
}
catch (Exception ex)
{
@@ -234,7 +234,7 @@ namespace Ink_Canvas.Windows.SettingsViews2.Pages
bool newState = ToggleSwitchPPTOnlyMode.IsOn;
// 使用Helper类更新设置并应用
Windows.SettingsViews.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchMode", newState);
Windows.SettingsViews2.MainWindowSettingsHelper.InvokeToggleSwitchToggled("ToggleSwitchMode", newState);
}
catch (Exception ex)
{