InkCanvasForClass/Ink Canvas/MainWindow.xaml
2021-10-30 00:22:53 +08:00

544 lines
47 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<Window x:Class="Ink_Canvas.MainWindow"
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" Topmost="True" KeyDown="Window_KeyDown"
xmlns:local="clr-namespace:Ink_Canvas" xmlns:ui="http://schemas.modernwpf.com/2019"
AllowsTransparency="True" WindowStyle="None" ResizeMode="NoResize"
mc:Ignorable="d" WindowState="Maximized" Loaded="Window_Loaded" Background="Transparent" ShowInTaskbar="False"
Title="Ink Canvas 画板" Height="10000" Width="800" FontFamily="Microsoft YaHei UI"
Foreground="Black" Stylus.IsPressAndHoldEnabled="False">
<!--资源中添加命令-->
<Window.Resources>
<RoutedUICommand x:Key="KeyExit" Text=" "/>
<RoutedUICommand x:Key="back_HotKey_Command" Text=" "/>
</Window.Resources>
<!--输入命令绑定-->
<Window.InputBindings>
<KeyBinding Gesture="Shift+Esc" Command="{StaticResource KeyExit}"/>
<KeyBinding Modifiers="Ctrl" Key="Z" Command="{StaticResource back_HotKey_Command}"/>
</Window.InputBindings>
<!--命令执行方法绑定-->
<Window.CommandBindings>
<CommandBinding Command="{StaticResource back_HotKey_Command}"
CanExecute="CommandBinding_CanExecute"
Executed="back_HotKey"/>
<CommandBinding Command="{StaticResource KeyExit}"
CanExecute="CommandBinding_CanExecute"
Executed="KeyExit"/>
</Window.CommandBindings>
<Grid x:Name="Main_Grid" Background="#01FFFFFF" PreviewKeyDown="Main_Grid_PreviewKeyDown">
<Grid Name="GridBackgroundCoverHolder">
<Grid Name="GridBackgroundCover" Visibility="Hidden" Background="#FFF2F2F2"/>
</Grid>
<Label Name="Label" Visibility="Collapsed" Content="0"/>
<InkCanvas x:Name="inkCanvas" Background="Transparent" Cursor="Pen" ForceCursor="False"
TouchUp="Main_Grid_TouchUp" TouchDown="Main_Grid_TouchDown"
TouchMove="inkCanvas_TouchMove"
ManipulationDelta="Main_Grid_ManipulationDelta"
ManipulationCompleted="Main_Grid_ManipulationCompleted"
ManipulationInertiaStarting="inkCanvas_ManipulationInertiaStarting"
IsManipulationEnabled="True" EditingModeChanged="inkCanvas_EditingModeChanged"
PreviewTouchDown="inkCanvas_PreviewTouchDown"
PreviewTouchUp="inkCanvas_PreviewTouchUp"
MouseDown="inkCanvas_MouseDown" MouseMove="inkCanvas_MouseMove" MouseUp="inkCanvas_MouseUp"
ManipulationStarting="inkCanvas_ManipulationStarting"
SelectionChanged="inkCanvas_SelectionChanged"
StrokeCollected="inkCanvas_StrokeCollected">
<!--<InkCanvas.DefaultDrawingAttributes>
<DrawingAttributes StylusTip="Ellipse" Height="8" Width="4" IgnorePressure="False" FitToCurve="True" >
<DrawingAttributes.StylusTipTransform>
<Matrix M11="1" M12="1.5" M21="2.2" M22="1"/>
</DrawingAttributes.StylusTipTransform>
</DrawingAttributes>
</InkCanvas.DefaultDrawingAttributes>-->
</InkCanvas>
<Grid Name="GridInkCanvasSelectionCover" MouseUp="GridInkCanvasSelectionCover_MouseUp" IsManipulationEnabled="True"
ManipulationStarting="GridInkCanvasSelectionCover_ManipulationStarting"
ManipulationCompleted="GridInkCanvasSelectionCover_ManipulationCompleted"
ManipulationDelta="GridInkCanvasSelectionCover_ManipulationDelta"
PreviewTouchDown="GridInkCanvasSelectionCover_PreviewTouchDown"
PreviewTouchUp="GridInkCanvasSelectionCover_PreviewTouchUp"
TouchDown="GridInkCanvasSelectionCover_TouchDown"
TouchUp="GridInkCanvasSelectionCover_TouchUp"
Background="#01FFFFFF" Opacity="0.01" Visibility="Collapsed"/>
<Grid Visibility="{Binding ElementName=GridBackgroundCoverHolder, Path=Visibility}">
<ui:SimpleStackPanel Spacing="10" Orientation="Horizontal"
VerticalAlignment="Bottom"
HorizontalAlignment="Center"
Height="50" Margin="10"
Visibility="{Binding ElementName=GridBackgroundCover, Path=Visibility}">
<Button Name="BtnWhiteBoardAdd" FontFamily="Microsoft YaHei UI"
Width="50" Height="48" FontSize="26" Click="BtnWhiteBoardAdd_Click"
Foreground="{Binding ElementName=BtnExit, Path=Foreground}"
Background="{Binding ElementName=BtnExit, Path=Background}">
<ui:SymbolIcon Symbol="Add" />
</Button>
<Button Name="BtnWhiteBoardSwitchPrevious" Content="&lt;" FontFamily="Symbol"
Width="50" Height="48" FontSize="25" Click="BtnWhiteBoardSwitchPrevious_Click"
Foreground="{Binding ElementName=BtnExit, Path=Foreground}"
Background="{Binding ElementName=BtnExit, Path=Background}"
VerticalContentAlignment="Top"
IsEnabled="False"/>
<Border Height="48" CornerRadius="2" Margin="3,0">
<TextBlock Name="TextBlockWhiteBoardIndexInfo"
Text="1 / 1"
Foreground="{Binding ElementName=BtnExit, Path=Foreground}"
VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="Microsoft YaHei UI" FontSize="18"/>
</Border>
<Button Name="BtnWhiteBoardSwitchNext" Content="&gt;" FontFamily="Symbol"
Width="50" Height="48" FontSize="25" Click="BtnWhiteBoardSwitchNext_Click"
Foreground="{Binding ElementName=BtnExit, Path=Foreground}"
Background="{Binding ElementName=BtnExit, Path=Background}"
VerticalContentAlignment="Top"
IsEnabled="False"/>
<Button Name="BtnWhiteBoardDelete" Click="BtnWhiteBoardDelete_Click"
FontFamily="Microsoft YaHei UI" Width="50" Height="48" FontSize="26"
Foreground="{Binding ElementName=BtnExit, Path=Foreground}"
Background="{Binding ElementName=BtnExit, Path=Background}"
IsEnabled="False">
<ui:SymbolIcon Symbol="Delete" />
</Button>
</ui:SimpleStackPanel>
</Grid>
<Border Name="BorderSettings" Background="White" BorderBrush="Black"
BorderThickness="1" CornerRadius="10" ui:ThemeManager.RequestedTheme="Light"
Width="400" HorizontalAlignment="Center"
Margin="100" Visibility="Visible">
<Grid>
<ScrollViewer Margin="0,60,0,50" VerticalScrollBarVisibility="Auto"
PanningMode="VerticalOnly" ui:ThemeManager.RequestedTheme="Light"
ManipulationBoundaryFeedback="SCManipulationBoundaryFeedback">
<StackPanel Margin="20,20,20,20">
<TextBlock FontSize="14" Margin="0,0,0,0"
Text="*设置将自动保存,再次点击“设置”按钮即可关闭此页面。"/>
<TextBlock FontSize="14" Margin="0,0,0,12"
Text="*部分设置可能需要重新打开后生效。"/>
<GroupBox Header="行为">
<ui:SimpleStackPanel Spacing="12">
<ui:SimpleStackPanel Spacing="12" Orientation="Horizontal">
<Button Content="立即重新启动画板" Width="160" FontFamily="Microsoft YaHei UI" Click="BtnRestart_Click" Margin="0,0,0,10"/>
<Button Content="立即退出" Width="160" FontFamily="Microsoft YaHei UI" Click="BtnExit_Click" Margin="0,0,0,10"/>
</ui:SimpleStackPanel>
<ui:ToggleSwitch Name="ToggleSwitchRunAtStartup" Header="开机时运行" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchRunAtStartup_Toggled"/>
<TextBlock Text="我们并不推荐使用 WPS Office因为其对于触摸设备的较差支持。" Foreground="#666666"/>
<ui:ToggleSwitch Name="ToggleSwitchSupportPowerPoint" Header="Microsoft PowerPoint 支持" IsOn="True" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchSupportPowerPoint_Toggled"/>
<TextBlock Text="对 WPS Office 支持时会导致 WPS Office 关闭时卡顿,仅测试用。" Foreground="#666666"/>
<ui:ToggleSwitch Name="ToggleSwitchSupportWPS" Header="WPS Office 支持" IsOn="False" IsEnabled="True" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchSupportWPS_Toggled"/>
<ui:ToggleSwitch Name="ToggleSwitchShowCanvasAtNewSlideShow" Header="开始放映时自动显示画板" IsOn="True" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchShowCanvasAtNewSlideShow_Toggled"/>
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox Header="启动">
<ui:SimpleStackPanel Spacing="12">
<ui:ToggleSwitch Name="ToggleSwitchAutoHideCanvas" Header="自动隐藏画板" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchAutoHideCanvas_Toggled"/>
<ui:ToggleSwitch Name="ToggleSwitchAutoEnterModeFinger" Header="自动进入手指模式" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchAutoEnterModeFinger_Toggled"/>
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox Header="画板">
<ui:SimpleStackPanel Spacing="12">
<StackPanel Orientation="Horizontal">
<Slider x:Name="InkWidthSlider"
HorizontalAlignment="Left"
Minimum="1" Maximum="20"
Width="330" FontFamily="Microsoft YaHei UI"
ui:ControlHelper.Header="画笔粗细"
IsSnapToTickEnabled="True" Value="5"
TickFrequency="1" TickPlacement="Both"
ValueChanged="InkWidthSlider_ValueChanged"/>
<TextBlock Text="{Binding Value, ElementName=InkWidthSlider, Mode=OneWay}"
VerticalAlignment="Bottom" Margin="10,0,0,8"
FontSize="14"/>
</StackPanel>
<ui:ToggleSwitch Name="ToggleSwitchShowCursor" Header="显示画笔光标" IsOn="False" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchShowCursor_Toggled"/>
<TextBlock Text="画笔样式" FontFamily="Microsoft YaHei UI" FontSize="14"/>
<ComboBox Name="ComboBoxPenStyle" FontFamily="Microsoft YaHei UI" SelectedIndex="0" SelectionChanged="ComboBoxPenStyle_SelectionChanged">
<ComboBoxItem Content="模拟笔锋(根据墨迹尾部计算)" FontFamily="Microsoft YaHei UI"/>
<ComboBoxItem Content="模拟笔锋(根据速度计算)" FontFamily="Microsoft YaHei UI"/>
<ComboBoxItem Content="无笔锋" FontFamily="Microsoft YaHei UI"/>
</ComboBox>
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox Header="手势">
<ui:SimpleStackPanel Spacing="12">
<ui:ToggleSwitch Name="ToggleSwitchEnableTwoFingerRotation" Header="允许双指旋转" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchEnableTwoFingerRotation_Toggled"/>
<ui:ToggleSwitch Name="ToggleSwitchEnableTwoFingerGestureInPresentationMode" Header="允许幻灯片模式下的双指手势" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchEnableTwoFingerGestureInPresentationMode_Toggled"/>
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox Header="墨迹识别 (Beta)">
<ui:SimpleStackPanel Spacing="12">
<TextBlock Text="墨迹识别功能目前处于开发阶段,目前可实现自动识别圆、三角形、&#x000A;矩形,并自动转换为规范图形。" Foreground="#666666"/>
<ui:ToggleSwitch Name="ToggleSwitchEnableInkToShape" Header="启用墨迹识别" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchEnableTwoFingerRotation_Toggled"/>
<ui:ToggleSwitch Name="ToggleSwitchEnable" Header="圆:仅识别和转换正圆" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchEnableTwoFingerGestureInPresentationMode_Toggled"/>
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox Header="外观">
<ui:SimpleStackPanel Spacing="12">
<ui:ToggleSwitch Name="ToggleSwitchTransparentButtonBackground" Header="按钮背景半透明" IsOn="True" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchTransparentButtonBackground_Toggled"/>
<ui:ToggleSwitch Name="ToggleSwitchShowButtonExit" Header="显示“退出”按钮" IsOn="True" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchShowButtonExit_Toggled"/>
<Button Content="立即退出" Width="120" Visibility="Collapsed" FontFamily="Microsoft YaHei UI" Click="BtnExit_Click" Margin="0,0,0,10"/>
<ui:ToggleSwitch Name="ToggleSwitchShowButtonEraser" Header="显示“橡皮”按钮" IsOn="True" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchShowButtonEraser_Toggled"/>
<ui:ToggleSwitch Name="ToggleSwitchShowButtonHideControl" Header="显示“⇅ (显示或隐藏控制按钮)”按钮" IsOn="False" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchShowButtonHideControl_Toggled"/>
<ui:ToggleSwitch Name="ToggleSwitchShowButtonLRSwitch" Header="显示“⇆ (左右切换)”按钮" IsOn="False" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchShowButtonLRSwitch_Toggled"/>
<ui:ToggleSwitch Name="ToggleSwitchShowButtonModeFinger" Header="显示“手指模式”切换按钮" IsOn="True" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchShowButtonModeFinger_Toggled"/>
<StackPanel Visibility="Collapsed" Orientation="Horizontal">
<Slider x:Name="SideControlOpacitySlider"
HorizontalAlignment="Left"
Minimum="1" Maximum="100"
Width="320" FontFamily="Microsoft YaHei UI"
ui:ControlHelper.Header="控制栏透明度"
IsSnapToTickEnabled="True" Value="100"
TickFrequency="10" TickPlacement="Both"
ValueChanged="SideControlOpacitySlider_ValueChanged"/>
<TextBlock Text="{Binding Value, ElementName=SideControlOpacitySlider, Mode=OneWay}"
VerticalAlignment="Bottom" Margin="10,0,0,8"
FontSize="14" Width="25" HorizontalAlignment="Center"/>
</StackPanel>
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox Header="重置">
<ui:SimpleStackPanel Spacing="12">
<StackPanel>
<TextBlock FontSize="14" Margin="0,0,0,12"
Text="重置设置为推荐设置"/>
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="12">
<Button Content="重置" Width="100" FontFamily="Microsoft YaHei UI" Click="BtnResetToSuggestion_Click" Margin="0,0,0,0"/>
<ui:SymbolIcon Name="SymbolIconResetSuggestionComplete" Symbol="Accept" Visibility="Collapsed"/>
</ui:SimpleStackPanel>
</StackPanel>
<StackPanel>
<TextBlock FontSize="14" Margin="0,0,0,12"
Text="重置设置为默认设置"/>
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="12">
<Button Content="重置" Width="100" FontFamily="Microsoft YaHei UI" Click="BtnResetToDefault_Click" Margin="0,0,0,10"/>
<ui:SymbolIcon Name="SymbolIconResetDefaultComplete" Symbol="Accept" Visibility="Collapsed"/>
</ui:SimpleStackPanel>
</StackPanel>
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox Header="自动">
<ui:SimpleStackPanel Spacing="12">
<ui:ToggleSwitch Name="ToggleSwitchAutoKillPptService" Header="自动查杀“PPT 小工具”" IsOn="False" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchAutoKillPptService_Toggled"/>
<ui:ToggleSwitch Name="ToggleSwitchAutoKillEasiNote" Header="自动查杀“希沃白板 5”" IsOn="False" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchAutoKillEasiNote_Toggled"/>
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox Header="关于">
<ui:SimpleStackPanel Spacing="12">
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="4">
<TextBlock FontSize="14">
<Bold>当前版本:</Bold>
</TextBlock>
<TextBlock FontSize="14" Text="" Name="TextBlockVersion"/>
</ui:SimpleStackPanel>
<TextBlock FontSize="14">
<Bold>开发者:</Bold> XY Wang (WXRIW)
</TextBlock>
<TextBlock FontSize="14">
<Bold>开源地址:</Bold>
<Hyperlink Click="HyperlinkSource_Click">
<TextBlock Text="https://github.com/WXRIW/Ink-Canvas"></TextBlock>
</Hyperlink>
</TextBlock>
<TextBlock FontSize="14">
<Bold>开源协议:</Bold> GNU General Public License v3.0
</TextBlock>
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox Name="GroupBoxMASEZVersion"
Visibility="Collapsed"
Header="马鞍山二中专版说明">
<ui:SimpleStackPanel Spacing="12">
<TextBlock Name="TextBlockMASEZNotice" FontSize="14" Margin="0,0,0,0"/>
<Viewbox Margin="0,0,0,0" Height="70" HorizontalAlignment="Left">
<StackPanel Orientation="Horizontal">
<Image Source="logo.png" Width="120"/>
<Image Source="text.png" Width="200"/>
</StackPanel>
</Viewbox>
</ui:SimpleStackPanel>
</GroupBox>
</StackPanel>
</ScrollViewer>
<Grid Background="White" Margin="10,0,10,0" Height="60" VerticalAlignment="Top">
<Grid Margin="10,20,10,-10">
<TextBlock Text="设置" FontSize="26" Margin="0,0,0,12"/>
<!--<Viewbox Margin="0,-55,0,0" Height="60" HorizontalAlignment="Right">
<StackPanel Orientation="Horizontal">
<Image Source="logo.png" Width="120"/>
<Image Source="text.png" Width="200"/>
</StackPanel>
</Viewbox>-->
<Viewbox Visibility="{Binding ElementName=GroupBoxMASEZVersion, Path=Visibility}"
Margin="0,-15,0,0" Height="45" HorizontalAlignment="Right">
<StackPanel Orientation="Horizontal">
<Image Source="textCN.png" Width="200"/>
<TextBlock Text="专版" FontSize="32" Foreground="#C30F2C" VerticalAlignment="Center"/>
</StackPanel>
</Viewbox>
</Grid>
</Grid>
<Grid VerticalAlignment="Bottom" Height="50">
<Button FontFamily="Microsoft YaHei UI"
Width="120" Margin="10"
HorizontalAlignment="Right"
Content="关闭"
Click="BtnSettings_Click"/>
</Grid>
</Grid>
</Border>
<Grid Name="GridNotifications" Margin="0,60" Visibility="Collapsed" HorizontalAlignment="Center" VerticalAlignment="Bottom">
<Border CornerRadius="25" Height="50" Background="LightGray" Opacity="0.85">
<TextBlock Name="TextBlockNotice" Text="测试文本" Margin="20,10" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="16"/>
</Border>
</Grid>
<Viewbox Name="ViewBoxStackPanelMain" Margin="10,10,10,55" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="46">
<StackPanel Name="StackPanelMain" Width="46">
<StackPanel Name="StackPanelControl">
<Button Name="BtnExit" Content="退出" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnExit_Click" Background="#7F909090"/>
<Button Name="BtnSettings" Content="设置" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnSettings_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<TextBlock Text="自动&#x000A;粗细" Visibility="Collapsed" Margin="0,10,0,0"
FontSize="14" HorizontalAlignment="Center"
Foreground="{Binding ElementName=BtnExit, Path=Foreground}"/>
<!--<Viewbox Height="30" Visibility="Collapsed">
<ui:ToggleSwitch Name="ToggleSwitchAutoWeight" Header="" Width="40.5"
FontFamily="Microsoft YaHei UI" FontSize="19"
OnContent="" OffContent="" Toggled="ToggleSwitchAutoWeight_Toggled"/>
</Viewbox>-->
<StackPanel Name="StackPanelModeFinger" Background="#01000000">
<TextBlock Text="手指&#x000A;模式" Margin="0,10,0,0"
FontSize="14" HorizontalAlignment="Center"
Foreground="{Binding ElementName=BtnExit, Path=Foreground}"/>
<Viewbox Height="30">
<ui:ToggleSwitch Name="ToggleSwitchModeFinger" Header="" Width="40.5"
FontFamily="Microsoft YaHei UI" FontSize="19"
OnContent="" OffContent="" Toggled="ToggleSwitchModeFinger_Toggled"/>
</Viewbox>
</StackPanel>
<Button Name="BtnThickness" Content="粗细" Visibility="Collapsed" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnThickness_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button Name="BtnSwitchTheme" Content="深色" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnSwitchTheme_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button Name="BtnSwitch" Content="背景" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnSwitch_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<StackPanel Name="StackPanelColors" Margin="7,0,7,0">
<Button Name="BtnColorBlack" FontFamily="Microsoft YaHei UI" Background="Black"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
Height="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
Click="BtnColorBlack_Click">
<Viewbox Name="ViewboxBtnColorBlackContent" Visibility="Collapsed">
<ui:SymbolIcon Symbol="Accept" Name="SymbolIconBtnColorBlackContent" Foreground="White"/>
</Viewbox>
</Button>
<Button Name="BtnColorRed" FontFamily="Microsoft YaHei UI" Background="Red"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
Height="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
Click="BtnColorRed_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}">
<Viewbox Name="ViewboxBtnColorRedContent">
<ui:SymbolIcon Symbol="Accept" Foreground="{Binding ElementName=SymbolIconBtnColorBlackContent, Path=Foreground}"/>
</Viewbox>
</Button>
<Button Name="BtnColorGreen" FontFamily="Microsoft YaHei UI" Background="#169141"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
Height="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
Click="BtnColorGreen_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}">
<Viewbox Name="ViewboxBtnColorGreenContent" Visibility="Collapsed">
<ui:SymbolIcon Symbol="Accept" Foreground="{Binding ElementName=SymbolIconBtnColorBlackContent, Path=Foreground}"/>
</Viewbox>
</Button>
<Button Name="BtnColorBlue" FontFamily="Microsoft YaHei UI" Background="#239AD6"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
Height="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
Click="BtnColorBlue_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}">
<Viewbox Name="ViewboxBtnColorBlueContent" Visibility="Collapsed">
<ui:SymbolIcon Symbol="Accept" Foreground="{Binding ElementName=SymbolIconBtnColorBlackContent, Path=Foreground}"/>
</Viewbox>
</Button>
<Button Name="BtnColorYellow" FontFamily="Microsoft YaHei UI" Background="#F38B00"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
Height="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
Click="BtnColorYellow_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}">
<Viewbox Name="ViewboxBtnColorYellowContent" Visibility="Collapsed">
<ui:SymbolIcon Symbol="Accept" Foreground="{Binding ElementName=SymbolIconBtnColorBlackContent, Path=Foreground}"/>
</Viewbox>
</Button>
</StackPanel>
<Button Name="BtnClear" Content="清屏" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnClear_Click" MouseDoubleClick="BtnClear_MouseDoubleClick" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button x:Name="BtnHideInkCanvas" Content="隐藏&#x000A;画板" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnHideInkCanvas_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button x:Name="BtnTools" Content="工具" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnTools_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Grid Name="StackPanelToolButtons" Margin="-127,-30.5,56,0">
<Border CornerRadius="5" Margin="-7"
Background="White" Visibility="Collapsed"
BorderBrush="#0066BF" BorderThickness="1"/>
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="10">
<Button x:Name="BtnCountdownTimer" Content="计时器" FontFamily="Microsoft YaHei UI"
Margin="0,0,0,0"
Click="BtnCountdownTimer_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button x:Name="BtnRand" Content="抽奖" FontFamily="Microsoft YaHei UI"
Margin="0,0,0,0"
Click="BtnRand_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
</ui:SimpleStackPanel>
</Grid>
<Button x:Name="BtnScreenshot" Content="截屏" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnScreenshot_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button x:Name="BtnCheckPPT" Visibility="Collapsed" Content="检查" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnCheckPPT_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<StackPanel Name="StackPanelPPTButtons">
<Button x:Name="BtnPPTSlideShow" Visibility="Collapsed" Content="从头&#x000A;放映" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnPPTSlideShow_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button x:Name="BtnPPTSlideShowEnd" Visibility="Collapsed" Content="结束&#x000A;放映" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnPPTSlideShowEnd_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<StackPanel Name="StackPanelPPTControls" Visibility="Collapsed">
<Button x:Name="BtnPPTSlidesUp" Content="↑" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnPPTSlidesUp_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button x:Name="BtnPPTSlidesDown" Content="↓" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnPPTSlidesDown_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
</StackPanel>
</StackPanel>
<Button x:Name="BtnSwitchSide" Content="⇆" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnSwitchSide_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
</StackPanel>
<Button x:Name="BtnHideControl" Content="⇅" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnHideControl_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<StackPanel>
<TextBlock Visibility="{Binding ElementName=GroupBoxMASEZVersion, Path=Visibility}" Text="二中专版" FontSize="11" FontWeight="Bold" HorizontalAlignment="Center" Margin="0,10,0,0" Foreground="{Binding ElementName=BtnExit, Path=Foreground}"/>
<Image Visibility="{Binding ElementName=GroupBoxMASEZVersion, Path=Visibility}" Source="logo2.png" Margin="0,-5,0,-15"/>
<StackPanel x:Name="StackPanelInfo">
<TextBlock Text="Developer" FontSize="8.5" FontWeight="Bold" HorizontalAlignment="Center" Margin="0,10,0,0" Foreground="{Binding ElementName=BtnExit, Path=Foreground}"/>
<TextBlock Text="XY Wang" FontSize="9" HorizontalAlignment="Center" Margin="0,3,0,0" Foreground="{Binding ElementName=BtnExit, Path=Foreground}"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Viewbox>
<Viewbox Name="ViewBoxStackPanelShapes" Margin="{Binding ElementName=ViewBoxStackPanelMain, Path=Margin}" Width="46" HorizontalAlignment="Left" VerticalAlignment="Bottom" Visibility="{Binding ElementName=inkCanvas, Path=Visibility}">
<StackPanel Name="StackPanelShapes" Width="46">
<Slider HorizontalAlignment="Center" Visibility="Collapsed"
Minimum="1" Maximum="20" Orientation="Vertical"
Height="330" FontFamily="Microsoft YaHei UI"
ui:ControlHelper.Header="画笔&#x000A;粗细"
IsSnapToTickEnabled="True"
TickFrequency="1" TickPlacement="Both"
RenderTransformOrigin="0.5,0.5"
Value="{Binding ElementName=InkWidthSlider, Path=Value, Mode=TwoWay}">
</Slider>
<TextBlock Text="画笔&#x000A;粗细" Foreground="{Binding ElementName=BtnExit, Path=Foreground}"
FontSize="14" Margin="0,10,0,0" HorizontalAlignment="Center"/>
<Button Name="BtnPenWidthIncrease" Visibility="Visible" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,5" Height="{Binding ElementName=BtnPen, Path=ActualHeight}" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnPenWidthIncrease_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}"
Background="{Binding ElementName=BtnExit, Path=Background}">
<!--<ui:SymbolIcon Symbol="Add"/>-->
<Grid Margin="0,2,-5,0">
<TextBlock Text="&lt;" FontFamily="Symbol" FontSize="22" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock.LayoutTransform>
<RotateTransform Angle="90"/>
</TextBlock.LayoutTransform>
</TextBlock>
</Grid>
</Button>
<TextBlock Visibility="Visible" Text="{Binding Value, ElementName=InkWidthSlider, Mode=OneWay}"
FontSize="14" HorizontalAlignment="Center" Foreground="{Binding ElementName=BtnExit, Path=Foreground}"/>
<Button Name="BtnPenWidthDecrease" Visibility="Visible" FontFamily="Microsoft YaHei UI"
Margin="0,5,0,0" Height="{Binding ElementName=BtnPen, Path=ActualHeight}" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnPenWidthDecrease_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}"
Background="{Binding ElementName=BtnExit, Path=Background}">
<!--<ui:SymbolIcon Symbol="Remove"/>-->
<Grid Margin="0,4,-5,0">
<TextBlock Text="&gt;" FontFamily="Symbol" FontSize="22" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock.LayoutTransform>
<RotateTransform Angle="90"/>
</TextBlock.LayoutTransform>
</TextBlock>
</Grid>
</Button>
<Button Name="BtnFingerDragMode" Content="单指&#x000A;拖动" Visibility="Visible" FontFamily="Microsoft YaHei UI"
Margin="0,25,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnFingerDragMode_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button Name="BtnSelect" Content="选择&#x000A;墨迹" Visibility="Visible" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnSelect_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button Name="BtnPen" Visibility="Visible" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnPen_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}">
<ui:SymbolIcon Symbol="Edit"/>
</Button>
<Button Name="BtnErase" Content="橡皮" Visibility="Visible" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnErase_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button Name="BtnDrawLine" Content="直线" Visibility="Visible" FontFamily="Microsoft YaHei UI"
Margin="0,25,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnDrawLine_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button Name="BtnDrawArrow" Content="箭头" Visibility="Visible" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnDrawArrow_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button Name="BtnDrawRectangle" Content="矩形" Visibility="Visible" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnDrawRectangle_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button Name="BtnDrawEllipse" Content="椭圆" Visibility="Visible" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,15" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnDrawEllipse_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<StackPanel IsVisibleChanged="StackPanel_IsVisibleChanged" Visibility="{Binding ElementName=StackPanelPPTButtons, Path=Visibility}">
<StackPanel Visibility="{Binding ElementName=StackPanelPPTControls, Path=Visibility}">
<Button Content="↑" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnPPTSlidesUp_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button Content="↓" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,15" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnPPTSlidesDown_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
</StackPanel>
</StackPanel>
<Button Content="清屏" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnClear_Click" MouseDoubleClick="BtnClear_MouseDoubleClick" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Button x:Name="BtnUndo" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnUndo_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}"
Background="{Binding ElementName=BtnExit, Path=Background}"
IsEnabled="False" IsEnabledChanged="Btn_IsEnabledChanged">
<StackPanel Opacity="0.2">
<ui:SymbolIcon Symbol="Undo"/>
<TextBlock Text="撤销" Margin="0,4,0,0"/>
</StackPanel>
</Button>
<Button x:Name="BtnRedo" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
Click="BtnRedo_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}"
Background="{Binding ElementName=BtnExit, Path=Background}"
IsEnabled="False" Visibility="Collapsed" IsEnabledChanged="Btn_IsEnabledChanged">
<StackPanel Opacity="0.2">
<ui:SymbolIcon Symbol="Redo"/>
<TextBlock Text="恢复" Margin="0,4,0,0"/>
</StackPanel>
</Button>
<Button Name="BtnClearAndHideCanvas" Content="清屏&#x000A;&amp;&#x000A;隐藏" Visibility="Collapsed" FontFamily="Microsoft YaHei UI"
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}" Block.TextAlignment="Center"
Click="BtnSelect_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
<Grid Name="GridForLeftSideReservedSpace" Height="{Binding ElementName=StackPanelInfo, Path=ActualHeight}"/>
</StackPanel>
</Viewbox>
</Grid>
</Window>