Files
community/Ink Canvas/Windows/SettingsViews/Pages/AutomationPage.xaml
T
RedstonCoder da3a1f7dea Use LabeledSettingsCard with i18n and IconSource
Replace multiple ui:SettingsCard blocks with compact controls:LabeledSettingsCard entries. Each card now uses Header bindings to i18n keys and an IconSource attribute instead of nested HeaderIcon content, while preserving existing Toggled event handlers. This refactors and simplifies the XAML, standardizes icon usage, and enables localization for the floating app interceptor settings.
2026-04-26 18:56:21 +08:00

372 lines
24 KiB
XML

<ui:Page x:Class="Ink_Canvas.Windows.SettingsViews.Pages.AutomationPage"
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.Pages"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions"
xmlns:controls="clr-namespace:Ink_Canvas.Controls;assembly=InkCanvas.Controls"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
Title="自动化">
<ScrollViewer PanningMode="VerticalFirst">
<Grid Margin="59,0,59,0">
<FrameworkElement.Resources>
<sys:Double x:Key="SettingsCardSpacing">4</sys:Double>
<sys:Double x:Key="SettingsCardHeaderIconMaxSize">24</sys:Double>
<Style x:Key="SettingsSectionHeaderTextBlockStyle"
BasedOn="{StaticResource BodyStrongTextBlockStyle}"
TargetType="TextBlock">
<Style.Setters>
<Setter Property="Margin" Value="1,30,0,6" />
</Style.Setters>
</Style>
</FrameworkElement.Resources>
<Grid>
<ikw:SimpleStackPanel MaxWidth="1600"
HorizontalAlignment="Stretch"
Spacing="{StaticResource SettingsCardSpacing}">
<TextBlock Text="{i18n:I18n Key=Automation_AutoFoldTitle}" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="114514*" />
<ColumnDefinition Width="114514*" />
</Grid.ColumnDefinitions>
<ui:SettingsExpander Header="{i18n:I18n Key=AutoFold_App_SeewoBoard5}"
x:Name="ExpanderAutoFoldInEasiNote"
d:IsExpanded="True"
Grid.Column="0" VerticalAlignment="Top">
<ui:SettingsExpander.HeaderIcon>
<ui:ImageIcon Source="/Resources/Icons-png/EasiNote.png"/>
</ui:SettingsExpander.HeaderIcon>
<ui:ToggleSwitch x:Name="CardAutoFoldInEasiNote"
OnContent="{DynamicResource Common_On}"
OffContent="{DynamicResource Common_Off}"
Toggled="ToggleSwitchAutoFoldInEasiNote_Toggled"/>
</ui:SettingsExpander>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInEasiCamera"
Header="{i18n:I18n Key=AutoFold_App_SeewoCamera}"
IconSource="/Resources/Icons-png/EasiCamera.png"
Toggled="ToggleSwitchAutoFoldInEasiCamera_Toggled"
Grid.Column="1" VerticalAlignment="Top"/>
</Grid>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInEasiNote3"
Header="{i18n:I18n Key=AutoFold_App_SeewoBoard3}"
IconSource="/Resources/Icons-png/EasiNote3.png"
Toggled="ToggleSwitchAutoFoldInEasiNote3_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInEasiNote3C"
Header="{i18n:I18n Key=AutoFold_App_SeewoLightBoard}"
IconSource="/Resources/Icons-png/EasiNote3C.png"
Toggled="ToggleSwitchAutoFoldInEasiNote3C_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInEasiNote5C"
Header="{i18n:I18n Key=AutoFold_App_SeewoLightBoard5C}"
IconSource="/Resources/Icons-png/EasiNote5C.png"
Toggled="ToggleSwitchAutoFoldInEasiNote5C_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInSeewoPincoTeacher"
Header="{i18n:I18n Key=AutoFold_App_SeewoPinco}"
IconSource="/Resources/Icons-png/SeewoPinco.png"
Toggled="ToggleSwitchAutoFoldInSeewoPincoTeacher_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInHiteTouchPro"
Header="{i18n:I18n Key=AutoFold_App_HiteBoard}"
IconSource="/Resources/Icons-png/HiteBoard.png"
Toggled="ToggleSwitchAutoFoldInHiteTouchPro_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInHiteCamera"
Header="{i18n:I18n Key=AutoFold_App_HiteCamera}"
IconSource="/Resources/Icons-png/HiteCamera.png"
Toggled="ToggleSwitchAutoFoldInHiteCamera_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInHiteLightBoard"
Header="{i18n:I18n Key=AutoFold_App_HiteLightBoard}"
IconSource="/Resources/Icons-png/HiteLightBoard.png"
Toggled="ToggleSwitchAutoFoldInHiteLightBoard_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInWxBoardMain"
Header="{i18n:I18n Key=AutoFold_App_WenXiangBoard}"
IconSource="/Resources/Icons-png/WenXiang.png"
Toggled="ToggleSwitchAutoFoldInWxBoardMain_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInMSWhiteboard"
Header="{i18n:I18n Key=AutoFold_App_MSWhiteboard}"
IconSource="/Resources/Icons-png/Whiteboard.png"
Toggled="ToggleSwitchAutoFoldInMSWhiteboard_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInAdmoxWhiteboard"
Header="{i18n:I18n Key=AutoFold_App_AdmoxBoard}"
IconSource="/Resources/Icons-png/AdmoxWhiteboard.png"
Toggled="ToggleSwitchAutoFoldInAdmoxWhiteboard_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInAdmoxBooth"
Header="{i18n:I18n Key=AutoFold_App_AdmoxBooth}"
IconSource="/Resources/Icons-png/AdmoxBooth.png"
Toggled="ToggleSwitchAutoFoldInAdmoxBooth_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInQPoint"
Header="{i18n:I18n Key=AutoFold_App_YiYunBoard}"
IconSource="/Resources/Icons-png/YiYunWhiteboard.png"
Toggled="ToggleSwitchAutoFoldInQPoint_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInYiYunVisualPresenter"
Header="{i18n:I18n Key=AutoFold_App_YiYunBooth}"
IconSource="/Resources/Icons-png/YiYunVisualPresenter.png"
Toggled="ToggleSwitchAutoFoldInYiYunVisualPresenter_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInMaxHubWhiteboard"
Header="{i18n:I18n Key=AutoFold_App_MaxHubBoard}"
IconSource="/Resources/Icons-png/MaxHubWhiteboard.png"
Toggled="ToggleSwitchAutoFoldInMaxHubWhiteboard_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInOldZyBoard"
Header="{i18n:I18n Key=AutoFold_OldZyBoard}"
IconSource="/Resources/Icons-png/Donview.png"
Toggled="ToggleSwitchAutoFoldInOldZyBoard_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldInPPTSlideShow"
Header="{i18n:I18n Key=Automation_AutoFoldInPPT}"
IconSource="/Resources/Icons-png/PPTTools.png"
Toggled="ToggleSwitchAutoFoldInPPTSlideShow_Toggled"/>
<TextBlock Text="{i18n:I18n Key=AutoKill_Title}" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
<controls:LabeledSettingsCard x:Name="CardAutoKillPptService"
Header="{i18n:I18n Key=AutoKill_PptTools}"
Description="{i18n:I18n Key=AutoKill_PptToolsHint}"
IconSource="/Resources/Icons-png/PPTTools.png"
Toggled="ToggleSwitchAutoKillPptService_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoKillEasiNote"
Header="{i18n:I18n Key=AutoKill_EasiNote5}"
IconSource="/Resources/Icons-png/EasiNote.png"
Toggled="ToggleSwitchAutoKillEasiNote_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoKillHiteAnnotation"
Header="{i18n:I18n Key=AutoKill_HiteAnnotation}"
IconSource="/Resources/Icons-png/HiteAnnotation.png"
Toggled="ToggleSwitchAutoKillHiteAnnotation_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoKillVComYouJiao"
Header="{i18n:I18n Key=AutoKill_YouJiao}"
Icon="{x:Static ui:SegoeFluentIcons.Slideshow}"
Toggled="ToggleSwitchAutoKillVComYouJiao_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoKillSeewoLauncher2DesktopAnnotation"
Header="{i18n:I18n Key=AutoKill_SeewoDesktop2Anno}"
Description="{i18n:I18n Key=AutoKill_SeewoDesktop2AnnoHint}"
IconSource="/Resources/Icons-png/Seewo2Annotation.png"
Toggled="ToggleSwitchAutoKillSeewoLauncher2DesktopAnnotation_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoKillInkCanvas"
Header="{i18n:I18n Key=AutoKill_InkCanvasIC}"
Icon="{x:Static ui:SegoeFluentIcons.Slideshow}"
Toggled="ToggleSwitchAutoKillInkCanvas_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoKillICA"
Header="{i18n:I18n Key=AutoKill_ICA}"
Icon="{x:Static ui:SegoeFluentIcons.Slideshow}"
Toggled="ToggleSwitchAutoKillICA_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoKillIDT"
Header="{i18n:I18n Key=AutoKill_Inkeys}"
Icon="{x:Static ui:SegoeFluentIcons.Slideshow}"
Toggled="ToggleSwitchAutoKillIDT_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoEnterAnnotationAfterKillHite"
Header="{i18n:I18n Key=AutoKill_HiteAfterKillEnterAnnotation}"
IconSource="/Resources/Icons-png/HiteAnnotation.png"
Toggled="ToggleSwitchAutoEnterAnnotationAfterKillHite_Toggled"/>
<TextBlock Text="{i18n:I18n Key=AutoFold_Mode}" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
<controls:LabeledSettingsCard x:Name="CardAutoEnterAnnotationModeWhenExitFoldMode"
Header="{i18n:I18n Key=FoldMode_AutoFoldAfterWhiteboard}"
Icon="{x:Static ui:SegoeFluentIcons.Edit}"
Toggled="ToggleSwitchAutoEnterAnnotationModeWhenExitFoldMode_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldWhenExitWhiteboard"
Header="{i18n:I18n Key=FoldMode_AutoFoldAfterWhiteboard}"
Icon="{x:Static ui:SegoeFluentIcons.Back}"
Toggled="ToggleSwitchAutoFoldWhenExitWhiteboard_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoFoldAfterPPTSlideShow"
Header="{i18n:I18n Key=FoldMode_AutoFoldAfterPPT}"
Description="{i18n:I18n Key=FoldMode_AutoFoldAfterPPTHint}"
IconSource="/Resources/Icons-png/PPTTools.png"
Toggled="ToggleSwitchAutoFoldAfterPPTSlideShow_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardKeepFoldAfterSoftwareExit"
Header="{i18n:I18n Key=Automation_KeepFoldAfterExit}"
Description="{i18n:I18n Key=Automation_KeepFoldAfterExitHint}"
Icon="{x:Static ui:SegoeFluentIcons.Pin}"
Toggled="ToggleSwitchKeepFoldAfterSoftwareExit_Toggled"/>
<TextBlock Text="{i18n:I18n Key=AutoSave_Title}" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
<controls:LabeledSettingsCard x:Name="CardSaveScreenshotsInDateFolders"
Header="{i18n:I18n Key=Storage_AutoSaveInkOnScreenshot}"
Icon="{x:Static ui:SegoeFluentIcons.Folder}"
Toggled="ToggleSwitchSaveScreenshotsInDateFolders_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoSaveStrokesAtScreenshot"
Header="{i18n:I18n Key=Storage_AutoSaveInkOnScreenshot}"
Icon="{x:Static ui:SegoeFluentIcons.Save}"
Toggled="ToggleSwitchAutoSaveStrokesAtScreenshot_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAutoSaveStrokesAtClear"
Header="清屏时自动截图"
Icon="{x:Static ui:SegoeFluentIcons.Save}"
Toggled="ToggleSwitchAutoSaveStrokesAtClear_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSaveStrokesAsXML"
Header="墨迹保存为 XML"
Icon="{x:Static ui:SegoeFluentIcons.Save}"
Toggled="ToggleSwitchSaveStrokesAsXML_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardEnableAutoSaveStrokes"
Header="{i18n:I18n Key=Storage_AutoSaveInk}"
Description="{i18n:I18n Key=Storage_AutoSaveHint}"
Icon="{x:Static ui:SegoeFluentIcons.Save}"
Toggled="ToggleSwitchEnableAutoSaveStrokes_Toggled"/>
<ui:SettingsCard Header="{i18n:I18n Key=Storage_AutoSaveInterval}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.QuietHours}"/>
</ui:SettingsCard.HeaderIcon>
<ComboBox x:Name="ComboBoxAutoSaveStrokesInterval"
SelectionChanged="ComboBoxAutoSaveStrokesInterval_SelectionChanged">
<ComboBoxItem Content="{i18n:I18n Key=Storage_AutoSaveInterval_1Min}" Tag="1"/>
<ComboBoxItem Content="{i18n:I18n Key=Storage_AutoSaveInterval_3Min}" Tag="3"/>
<ComboBoxItem Content="{i18n:I18n Key=Storage_AutoSaveInterval_5Min}" Tag="5"/>
<ComboBoxItem Content="{i18n:I18n Key=Storage_AutoSaveInterval_10Min}" Tag="10"/>
<ComboBoxItem Content="{i18n:I18n Key=Storage_AutoSaveInterval_30Min}" Tag="30"/>
</ComboBox>
</ui:SettingsCard>
<controls:LabeledSettingsCard x:Name="CardAutoDelSavedFiles"
Header="自动删除旧保存文件"
Icon="{x:Static ui:SegoeFluentIcons.Delete}"
Toggled="ToggleSwitchAutoDelSavedFiles_Toggled"/>
<ui:SettingsCard Header="自动删除天数阈值">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Calendar}"/>
</ui:SettingsCard.HeaderIcon>
<ComboBox x:Name="ComboBoxAutoDelSavedFilesDaysThreshold"
SelectionChanged="ComboBoxAutoDelSavedFilesDaysThreshold_SelectionChanged">
<ComboBoxItem Content="7"/>
<ComboBoxItem Content="14"/>
<ComboBoxItem Content="30"/>
<ComboBoxItem Content="60"/>
<ComboBoxItem Content="90"/>
</ComboBox>
</ui:SettingsCard>
<ui:SettingsCard Header="自动化最小笔画数">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Calculator}"/>
</ui:SettingsCard.HeaderIcon>
<Slider x:Name="SideControlMinimumAutomationSlider" Minimum="1" Maximum="50" Width="200" ValueChanged="SideControlMinimumAutomationSlider_ValueChanged"/>
</ui:SettingsCard>
<controls:LabeledSettingsCard x:Name="CardSaveFullPageStrokes"
Header="保存全页墨迹"
Icon="{x:Static ui:SegoeFluentIcons.Save}"
Toggled="ToggleSwitchSaveFullPageStrokes_Toggled"/>
<TextBlock Text="悬浮窗拦截" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
<controls:LabeledSettingsCard x:Name="CardFloatingWindowInterceptorEnabled"
Header="启用悬浮窗拦截"
Icon="{x:Static ui:SegoeFluentIcons.Shield}"
Toggled="ToggleSwitchFloatingWindowInterceptorEnabled_Toggled"/>
<ui:SettingsExpander Header="拦截规则"
Visibility="{Binding IsOn, ElementName=CardFloatingWindowInterceptorEnabled, Converter={StaticResource BooleanToVisibilityConverter}}"
IsExpanded="{Binding IsOn, ElementName=CardFloatingWindowInterceptorEnabled, Mode=OneWay}">
<ui:SettingsExpander.HeaderIcon>
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Filter}"/>
</ui:SettingsExpander.HeaderIcon>
<ui:SettingsExpander.Items>
<controls:LabeledSettingsCard x:Name="CardSeewoWhiteboard3Floating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoBoard3}"
IconSource="/Resources/Icons-png/EasiNote3.png"
Toggled="ToggleSwitchSeewoWhiteboard3Floating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSeewoWhiteboard5Floating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoBoard5}"
IconSource="/Resources/Icons-png/EasiNote.png"
Toggled="ToggleSwitchSeewoWhiteboard5Floating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSeewoWhiteboard5CFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoBoard5C}"
IconSource="/Resources/Icons-png/EasiNote5C.png"
Toggled="ToggleSwitchSeewoWhiteboard5CFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSeewoPincoSideBarFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoPinco}"
IconSource="/Resources/Icons-png/SeewoPinco.png"
Toggled="ToggleSwitchSeewoPincoSideBarFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSeewoPincoDrawingFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoPincoDrawing}"
IconSource="/Resources/Icons-png/SeewoPinco.png"
Toggled="ToggleSwitchSeewoPincoDrawingFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSeewoPPTFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoPPTTools}"
IconSource="/Resources/Icons-png/PPTTools.png"
Toggled="ToggleSwitchSeewoPPTFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardAiClassFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_AiClass}"
IconSource="/Resources/Icons-png/AiClass.png"
Toggled="ToggleSwitchAiClassFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardHiteAnnotationFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_HiteAnnotation}"
IconSource="/Resources/Icons-png/HiteAnnotation.png"
Toggled="ToggleSwitchHiteAnnotationFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardChangYanFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_ChangYanClass}"
IconSource="/Resources/Icons-png/畅言智慧课堂.png"
Toggled="ToggleSwitchChangYanFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardChangYanPptFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_ChangYanPPT}"
IconSource="/Resources/Icons-png/畅言智慧课堂.png"
Toggled="ToggleSwitchChangYanPptFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardIntelligentClassFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_IntelligentClass}"
IconSource="/Resources/Icons-png/天喻教育云.png"
Toggled="ToggleSwitchIntelligentClassFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSeewoDesktopAnnotationFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoDesktopAnnotation}"
IconSource="/Resources/Icons-png/Seewo2Annotation.png"
Toggled="ToggleSwitchSeewoDesktopAnnotationFloating_Toggled"/>
<controls:LabeledSettingsCard x:Name="CardSeewoDesktopSideBarFloating"
Header="{i18n:I18n Key=FloatingInterceptor_App_SeewoDesktopSideBar}"
IconSource="/Resources/Icons-png/Seewo2Annotation.png"
Toggled="ToggleSwitchSeewoDesktopSideBarFloating_Toggled"/>
</ui:SettingsExpander.Items>
</ui:SettingsExpander>
<TextBlock Text="文件关联" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"/>
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="8" HorizontalAlignment="Left">
<Button x:Name="BtnRegisterFileAssociation" Content="注册文件关联" Click="BtnRegisterFileAssociation_Click"/>
<Button x:Name="BtnUnregisterFileAssociation" Content="取消文件关联" Click="BtnUnregisterFileAssociation_Click"/>
<Button x:Name="BtnCheckFileAssociation" Content="检查关联状态" Click="BtnCheckFileAssociation_Click"/>
</ikw:SimpleStackPanel>
<TextBlock x:Name="TextBlockFileAssociationStatus" Margin="0,4,0,0"/>
<Rectangle Height="48" />
</ikw:SimpleStackPanel>
</Grid>
</Grid>
</ScrollViewer>
</ui:Page>