<Page x:Class="NEIntelligentControl2.Pages.BoostStation.PageStation"
      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:NEIntelligentControl2.Pages.BoostStation"
      mc:Ignorable="d" 
      
             d:DesignHeight="450" d:DesignWidth="800" Loaded="Page_Loaded" Unloaded="Page_Unloaded">
    <Page.Resources>
        <Style x:Key="PopupTextBox" TargetType="TextBox">
            <Setter Property="MinWidth" Value="60"/>
            <Setter Property="Margin" Value="3"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Padding" Value="2"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
        <Style x:Key="PopupTestBlock" TargetType="TextBlock">
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="FontSize" Value="14"/>
        </Style>
    </Page.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="76"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid HorizontalAlignment="Center" VerticalAlignment="Top" Width="294" Height="51">
            <Grid.Background>
                <ImageBrush ImageSource="pack://application:,,,/智动启停;component/Images/BoostStation/boost_station_title.png"/>
            </Grid.Background>
            <TextBox HorizontalAlignment="Center" VerticalAlignment="Stretch" MinWidth="200" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type Page}, Mode=FindAncestor}, Path=StationInfo.Name}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="20" Foreground="White" Background="{x:Null}" BorderBrush="{x:Null}">
                <TextBox.Style>
                    <Style TargetType="TextBox">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Page}, Mode=FindAncestor}, Path=IsEditModel}" Value="True">
                                <Setter Property="Visibility" Value="Visible"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Page}, Mode=FindAncestor}, Path=IsEditModel}" Value="False">
                                <Setter Property="Visibility" Value="Collapsed"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBox.Style>
            </TextBox>
            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type Page}, Mode=FindAncestor}, Path=StationInfo.Name}" FontSize="20" Foreground="White">
                <TextBlock.Style>
                    <Style TargetType="TextBlock">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Page}, Mode=FindAncestor}, Path=IsEditModel}" Value="True">
                                <Setter Property="Visibility" Value="Collapsed"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Page}, Mode=FindAncestor}, Path=IsEditModel}" Value="False">
                                <Setter Property="Visibility" Value="Visible"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </TextBlock.Style>
            </TextBlock>
        </Grid>
        <Canvas Grid.Row="1" x:Name="_Canvas" MouseLeftButtonUp="Canvas_MouseLeftButtonUp" MouseMove="Canvas_MouseMove" MouseRightButtonUp="_Canvas_MouseRightButtonUp" Background="#01000000" MouseLeave="_Canvas_MouseLeave" MouseEnter="_Canvas_MouseEnter">
            <Canvas.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="编辑" Click="MenuItem_Click" Tag="edit"/>
                </ContextMenu>
            </Canvas.ContextMenu>
        </Canvas>
        <Border x:Name="_ToolPane" Visibility="Collapsed" Background="#E5FFFFFF" Margin="10" HorizontalAlignment="Right" VerticalAlignment="Top" CornerRadius="7">
            <Border.Effect>
                <DropShadowEffect ShadowDepth="0" BlurRadius="9"/>
            </Border.Effect>
            <StackPanel Orientation="Horizontal">
                <ListBox x:Name="_LBTools" Margin="10" Background="Transparent" BorderThickness="0,0,0,0" SelectedIndex="0">
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapPanel IsItemsHost="True"/>
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                    <ListBoxItem x:Name="_LBISelect" Selected="ListBoxItem_Selected" Tag="Select" ToolTip="选择">
                        <Viewbox Width="15">
                            <Path Data="M760.32 587.264c9.216 8.704 11.264 19.456 6.144 30.72-5.12 11.776-13.824 17.92-26.624 17.92l-196.096 5.12 94.72 207.36c3.072 7.168 3.072 14.848 0 22.016s-8.192 12.288-15.36 15.36l-37.888 17.92c-7.168 3.072-14.848 3.072-22.016 0s-12.288-8.192-15.36-15.36l-100.864-201.728-144.384 154.624c-5.632 5.632-12.288 8.704-19.968 8.704-3.584 0-7.168-1.024-10.752-2.048-11.776-5.12-17.92-13.824-17.92-26.624v-670.72c0-12.288 6.144-21.504 17.92-26.624 3.584-1.536 7.168-2.048 10.752-2.048 8.192 0 14.848 2.56 19.968 8.704l457.728 456.704z" Fill="#FF515151"/>
                        </Viewbox>
                    </ListBoxItem>
                    <ListBoxItem Selected="ListBoxItem_Selected" Tag="Breaker" ToolTip="断路器">
                        <Rectangle Fill="#FFA2A2A2" Width="12" Height="19"/>
                    </ListBoxItem>
                    <ListBoxItem Selected="ListBoxItem_Selected" ToolTip="开关底座" Tag="SwitchBase">
                        <Viewbox>
                            <Canvas Name="g10" Width="16.485" Height="12.299">
                                <Canvas.RenderTransform>
                                    <TranslateTransform X="-846.12" Y="-159.77"/>
                                </Canvas.RenderTransform>
                                <Line xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" X1="854.14" Y1="159.77" X2="854.14" Y2="172.07" Name="line2" StrokeThickness="2.5" Stroke="#FF40B9B0" StrokeMiterLimit="10"/>
                                <Line xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" X1="862.6" Y1="165.93" X2="854.14" Y2="165.93" Name="line4" StrokeThickness="2.5" Stroke="#FF40B9B0" StrokeMiterLimit="10"/>
                                <Line xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" X1="850.76" Y1="162.31" X2="850.76" Y2="169.54" Name="line6" StrokeThickness="2.5" Stroke="#FF40B9B0" StrokeMiterLimit="10"/>
                                <Line xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" X1="847.37" Y1="163.73" X2="847.37" Y2="168.12" Name="line8" StrokeThickness="2.5" Stroke="#FF40B9B0" StrokeMiterLimit="10"/>
                            </Canvas>
                        </Viewbox>
                    </ListBoxItem>
                    <ListBoxItem ToolTip="开关" Selected="ListBoxItem_Selected" Tag="Switch">
                        <Viewbox Width="15">
                            <Canvas Name="_11_" Width="22.443" Height="17.266">
                                <Canvas.RenderTransform>
                                    <TranslateTransform X="-862.63" Y="-77.941"/>
                                </Canvas.RenderTransform>
                                <Line xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" X1="883.82" Y1="77.941" X2="883.82" Y2="95.207" StrokeThickness="2.5" Stroke="#FF1B9D3A" StrokeMiterLimit="10"/>
                                <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF1B9D3A">
                                    <Path.Data>
                                        <PathGeometry Figures="m867.23 84.51c1.421 0 2.575 1.155 2.575 2.571s-1.155 2.573-2.575 2.573c-1.418 0-2.571-1.155-2.571-2.573-1e-3 -1.417 1.154-2.571 2.571-2.571m0-2.033c-2.543 0-4.604 2.061-4.604 4.604s2.062 4.604 4.604 4.604c2.545 0 4.606-2.063 4.606-4.604s-2.061-4.604-4.606-4.604z" FillRule="NonZero"/>
                                    </Path.Data>
                                </Path>
                                <Line xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" X1="881.66" Y1="93.541" X2="870.84" Y2="86.574" StrokeThickness="2" Stroke="#FF1B9D3A" StrokeMiterLimit="10"/>
                            </Canvas>
                        </Viewbox>
                    </ListBoxItem>
                    <ListBoxItem ToolTip="大手车" Selected="ListBoxItem_Selected" Tag="HandcartBig">
                        <Viewbox Height="30">
                            <Canvas Width="14.818" Height="62.064">
                                <Canvas.RenderTransform>
                                    <TranslateTransform X="-1096.1" Y="-589.33"/>
                                </Canvas.RenderTransform>
                                <Polyline xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Points="1110.4 642.7 1103.6 650.42 1096.6 642.7" Name="polyline2" FillRule="NonZero" StrokeThickness="1.3" Stroke="#FFFF0000" StrokeMiterLimit="10"/>
                                <Polyline xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Points="1110.4 636.85 1103.6 644.57 1096.6 636.85" Name="polyline4" FillRule="NonZero" StrokeThickness="1.3" Stroke="#FFFF0000" StrokeMiterLimit="10"/>
                                <Polyline xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Points="1096.6 605.18 1103.4 597.46 1110.4 605.18" Name="polyline6" FillRule="NonZero" StrokeThickness="1.3" Stroke="#FFFF0000" StrokeMiterLimit="10"/>
                                <Polyline xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Points="1096.6 598.02 1103.4 590.3 1110.4 598.02" Name="polyline8" FillRule="NonZero" StrokeThickness="1.3" Stroke="#FFFF0000" StrokeMiterLimit="10"/>
                            </Canvas>
                        </Viewbox>
                    </ListBoxItem>
                    <ListBoxItem ToolTip="小手车" Selected="ListBoxItem_Selected" Tag="HandcartSmall">
                        <Viewbox Width="10">
                            <Canvas Name="g6" Width="14.809" Height="16.294">
                                <Canvas.RenderTransform>
                                    <TranslateTransform X="-727.87" Y="-594.66"/>
                                </Canvas.RenderTransform>
                                <Polyline xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Points="728.36 610.52 735.19 602.79 742.2 610.52" FillRule="NonZero" StrokeThickness="1.3" Stroke="#FFFF0000" StrokeMiterLimit="10"/>
                                <Polyline xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Points="728.36 603.36 735.19 595.63 742.2 603.36" FillRule="NonZero" StrokeThickness="1.3" Stroke="#FFFF0000" StrokeMiterLimit="10"/>
                            </Canvas>
                        </Viewbox>
                    </ListBoxItem>
                    <ListBoxItem ToolTip="数据标签" Selected="ListBoxItem_Selected" Tag="DataLabel">
                        <Viewbox Width="20">
                            <Canvas Name="svg6" Width="1024" Height="1024">
                                <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path2" Fill="#FF515151">
                                    <Path.Data>
                                        <PathGeometry Figures="M736 416h-160v64h160v64h-128a64 64 0 0 0-64 64v64a64 64 0 0 0 64 64h192v-256a64.064 64.064 0 0 0-64-64z m0 256h-128v-64h128zM416 288H288a64.064 64.064 0 0 0-64 64v384h64v-160h128v160h64V352a64.064 64.064 0 0 0-64-64z m-128 224v-160h128v160z" FillRule="NonZero"/>
                                    </Path.Data>
                                </Path>
                                <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path4" Fill="#FF515151">
                                    <Path.Data>
                                        <PathGeometry Figures="M896 896H128a64.064 64.064 0 0 1-64-64V192a64.064 64.064 0 0 1 64-64h768a64.064 64.064 0 0 1 64 64v640a64.064 64.064 0 0 1-64 64zM128 192v640h768V192z" FillRule="NonZero"/>
                                    </Path.Data>
                                </Path>
                            </Canvas>
                        </Viewbox>
                    </ListBoxItem>
                    <ListBoxItem ToolTip="标签" Selected="ListBoxItem_Selected" Tag="DataTag">
                        <Viewbox Width="20">
                            <Canvas Width="1024" Height="1024">
                                <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF515151">
                                    <Path.Data>
                                        <PathGeometry Figures="M695.7 118.6H326.9c-58.2 0-105.4 47.2-105.4 105.4v579.6c0 58.2 47.2 105.4 105.4 105.4l184.4-184.4L695.7 909c58.2 0 105.4-47.2 105.4-105.4V224c0-58.2-47.1-105.4-105.4-105.4z" FillRule="NonZero"/>
                                    </Path.Data>
                                </Path>
                            </Canvas>
                        </Viewbox>
                    </ListBoxItem>
                </ListBox>
                <Rectangle Height="25" Width="2" Fill="#FF686868" Margin="0,0,5,0"/>
                <Button HorizontalAlignment="Center" VerticalAlignment="Center" Click="Button_Click" Tag="angle" BorderThickness="0,0,0,0" ToolTip="控件方向选择" Margin="5,0">
                    <Viewbox Width="20">
                        <Viewbox.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform/>
                                <SkewTransform/>
                                <RotateTransform Angle="{Binding RelativeSource={RelativeSource AncestorType={x:Type Page}, Mode=FindAncestor}, Path=Angle}" CenterX="10" CenterY="10"/>
                                <TranslateTransform/>
                            </TransformGroup>
                        </Viewbox.RenderTransform>
                        <Canvas Name="svg8" Width="1024" Height="1024">
                            <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF8FB3FF">
                                <Path.Data>
                                    <PathGeometry Figures="M559.795332 978.804414h-95.390684l2.499756 45.195586h90.391173z" FillRule="NonZero"/>
                                </Path.Data>
                            </Path>
                            <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF2868F0">
                                <Path.Data>
                                    <PathGeometry Figures="M567.2946 843.217655H456.90538l4.999512 90.391172h100.390196z" FillRule="NonZero"/>
                                </Path.Data>
                            </Path>
                            <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF2C66E1">
                                <Path.Data>
                                    <PathGeometry Figures="M512.09999 0.09999L240.926472 255.775022h183.282101l30.197051 542.247046h115.488722L599.991407 255.775022h183.282101z" FillRule="NonZero"/>
                                </Path.Data>
                            </Path>
                        </Canvas>
                    </Viewbox>
                </Button>
                <Button HorizontalAlignment="Center" VerticalAlignment="Center" Click="Button_Click" Tag="enlarge" BorderThickness="0,0,0,0" ToolTip="放大" Margin="5,0">
                    <Viewbox Width="20">
                        <Canvas Width="1024" Height="1024">
                            <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF515151">
                                <Path.Data>
                                    <PathGeometry Figures="M815.3 959.1H208.9c-79.7 0-144.4-64.6-144.4-144.4V208.3c0-79.7 64.6-144.4 144.4-144.4h606.5c79.7 0 144.4 64.6 144.4 144.4v606.5c-0.1 79.7-64.7 144.3-144.5 144.3zM266.6 540.4c0-23.9-19.4-43.3-43.3-43.3S180 516.5 180 540.4v259.9c0 23.9 19.4 43.3 43.3 43.3h259.9c23.9 0 43.3-19.4 43.3-43.3S507.1 757 483.2 757H266.6V540.4z m577.6-317.7c0-23.9-19.4-43.3-43.3-43.3H541c-23.9 0-43.3 19.4-43.3 43.3S517.1 266 541 266h216.6v216.6c0 23.9 19.4 43.3 43.3 43.3s43.3-19.4 43.3-43.3V222.7z" FillRule="NonZero"/>
                                </Path.Data>
                            </Path>
                        </Canvas>
                    </Viewbox>
                </Button>
                <Button HorizontalAlignment="Center" VerticalAlignment="Center" Click="Button_Click" Tag="narrow" BorderThickness="0,0,0,0" ToolTip="缩小" Margin="5,0">
                    <Viewbox Width="20">
                        <Canvas Width="1024" Height="1024">
                            <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF515151">
                                <Path.Data>
                                    <PathGeometry Figures="M815.5 63.9H208.7c-79.8 0-144.5 64.7-144.5 144.5V815c0 79.8 64.7 144.5 144.5 144.5h606.7c79.8 0 144.5-64.7 144.5-144.5V208.3c0-79.8-64.7-144.4-144.4-144.4z m-289 736.7c0 23.9-19.4 43.3-43.3 43.3s-43.3-19.4-43.3-43.3V583.9H223.2c-23.9 0-43.3-19.4-43.3-43.3s19.4-43.3 43.3-43.3h260c23.9 0 43.3 19.4 43.3 43.3v260z m303.4-303.4h-260c-23.9 0-43.3-19.4-43.3-43.3v-260c0-23.9 19.4-43.3 43.3-43.3s43.3 19.4 43.3 43.3v216.7h216.7c23.9 0 43.3 19.4 43.3 43.3s-19.4 43.3-43.3 43.3z" FillRule="NonZero"/>
                                </Path.Data>
                            </Path>
                        </Canvas>
                    </Viewbox>
                </Button>
                <Rectangle Height="25" Width="2" Fill="#FF686868"/>
                <Button HorizontalAlignment="Center" VerticalAlignment="Center" Click="Button_Click" BorderThickness="0,0,0,0" ToolTip="选择背景图片" Tag="background" Margin="5,0">
                    <Viewbox Width="23">
                        <Canvas Width="1024" Height="1024">
                            <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF515151">
                                <Path.Data>
                                    <PathGeometry Figures="M860.6 261.2c10.8 0 20 9.2 20 20v500c0 10.8-9.2 20-20 20h-696c-10.8 0-20-9.2-20-20v-500c0-10.8 9.2-20 20-20h696m0-80h-696c-55 0-100 45-100 100v500c0 55 45 100 100 100h696c55 0 100-45 100-100v-500c0-55-45-100-100-100z" FillRule="NonZero"/>
                                </Path.Data>
                            </Path>
                            <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF515151">
                                <Path.Data>
                                    <PathGeometry Figures="M424.1 319.2c-41.4 0-75 33.6-75 75s33.6 75 75 75 75-33.6 75-75-33.6-75-75-75z" FillRule="NonZero"/>
                                </Path.Data>
                            </Path>
                            <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path6" Fill="#FF5ABE64">
                                <Path.Data>
                                    <PathGeometry Figures="M880.6 672.3V565.7l-111.3-98c-8.3-7.3-21.1-6.5-28.3 1.9L530.7 712.8c-7.6 8.8-21.1 9.3-29.3 1.1L389.5 602c-7.9-7.9-20.7-7.8-28.5 0.2l-193.2 199h111.5l82.5-85c7.8-8 20.6-8.1 28.5-0.2l60.6 60.6c6.6 6.6 7.7 16.9 2.9 24.6H560L748.7 583c7.3-8.4 20-9.3 28.3-1.9l103.1 90.8c0.2 0.1 0.4 0.2 0.5 0.4z" FillRule="NonZero"/>
                                </Path.Data>
                            </Path>
                        </Canvas>
                    </Viewbox>
                </Button>
                <Button HorizontalAlignment="Center" VerticalAlignment="Center" Click="Button_Click" BorderThickness="0,0,0,0" ToolTip="删除所有选择的控件" Tag="delete" Margin="5,0">
                    <Viewbox Width="20">
                        <Canvas Name="svg10" Width="1024" Height="1024">
                            <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF515151">
                                <Path.Data>
                                    <PathGeometry Figures="M804.8128 239.035733A34.133333 34.133333 0 0 1 836.266667 273.2032l-0.1024 2.56-48.725334 617.079467a68.266667 68.266667 0 0 1-64.6144 62.805333l-3.4304 0.085333H304.605867a68.266667 68.266667 0 0 1-67.703467-59.477333l-0.341333-3.413333-48.725334-617.096534a34.133333 34.133333 0 0 1 67.754667-7.901866l0.3072 2.542933L304.605867 887.466667h414.788266l48.708267-617.079467A34.133333 34.133333 0 0 1 802.269867 238.933333l2.56 0.1024z" FillRule="NonZero"/>
                                </Path.Data>
                            </Path>
                            <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF515151">
                                <Path.Data>
                                    <PathGeometry Figures="M887.466667 204.8a34.133333 34.133333 0 0 1 2.56 68.181333L887.466667 273.066667H136.533333a34.133333 34.133333 0 0 1-2.56-68.181334L136.533333 204.8h750.933334z" FillRule="NonZero"/>
                                </Path.Data>
                            </Path>
                            <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF515151">
                                <Path.Data>
                                    <PathGeometry Figures="M597.333333 68.266667a102.4 102.4 0 0 1 102.331734 98.56L699.733333 170.666667v68.266666a34.133333 34.133333 0 0 1-68.181333 2.56L631.466667 238.933333v-68.266666a34.133333 34.133333 0 0 0-31.573334-34.048L597.333333 136.533333H426.666667a34.133333 34.133333 0 0 0-34.048 31.573334L392.533333 170.666667v68.266666a34.133333 34.133333 0 0 1-68.181333 2.56L324.266667 238.933333v-68.266666a102.4 102.4 0 0 1 98.56-102.331734L426.666667 68.266667h170.666666z" FillRule="NonZero"/>
                                </Path.Data>
                            </Path>
                            <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF00B386">
                                <Path.Data>
                                    <PathGeometry Figures="M682.666667 750.933333v34.133334a34.133333 34.133333 0 0 1-34.133334 34.133333H375.466667a34.133333 34.133333 0 0 1-34.133334-34.133333v-34.133334h341.333334z" FillRule="NonZero"/>
                                </Path.Data>
                            </Path>
                        </Canvas>
                    </Viewbox>
                </Button>
                <Button HorizontalAlignment="Center" VerticalAlignment="Center" Click="Button_Click" BorderThickness="0,0,0,0" ToolTip="保存所有更改并退出编辑模式" Tag="save" Margin="5,0">
                    <Viewbox Width="20">
                        <Canvas Width="1024" Height="1024">
                            <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF515151">
                                <Path.Data>
                                    <PathGeometry Figures="M754.8 63.3h-476c-115.5 0-210 94.5-210 210v646c0 22 18 40 40 40h816c22 0 40-18 40-40v-646c0-115.5-94.5-210-210-210z m-108 80v114.9h-260V143.3h260z m238 736h-736v-606c0-34.5 13.6-67.1 38.3-91.7 24.7-24.7 57.3-38.3 91.7-38.3h28v154.9c0 22 18 40 40 40h340c22 0 40-18 40-40V143.3h28c34.5 0 67.1 13.6 91.7 38.3 24.7 24.7 38.3 57.3 38.3 91.7v606z" FillRule="NonZero"/>
                                </Path.Data>
                            </Path>
                            <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF5ABE64">
                                <Path.Data>
                                    <PathGeometry Figures="M656.8 795.3h-280c-22 0-40-18-40-40v-20c0-22 18-40 40-40h280c22 0 40 18 40 40v20c0 22-18 40-40 40z" FillRule="NonZero"/>
                                </Path.Data>
                            </Path>
                        </Canvas>
                    </Viewbox>
                </Button>
                <Button HorizontalAlignment="Center" VerticalAlignment="Center" Click="Button_Click" BorderThickness="0,0,0,0" ToolTip="放弃所有更改并退出编辑模式" Tag="close" Margin="5,0">
                    <Viewbox Width="20">
                        <Canvas Name="svg4" Width="1024" Height="1024">
                            <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Fill="#FF515151">
                                <Path.Data>
                                    <PathGeometry Figures="M512 1024C229.248 1024 0 794.752 0 512S229.248 0 512 0s512 229.248 512 512-229.248 512-512 512z m0-572.330667L300.629333 240.213333a42.538667 42.538667 0 0 0-60.16 0.213334 42.410667 42.410667 0 0 0-0.213333 60.16L451.669333 512 240.213333 723.370667a42.538667 42.538667 0 0 0 0.213334 60.16 42.410667 42.410667 0 0 0 60.16 0.213333L512 572.330667l211.370667 211.413333a42.538667 42.538667 0 0 0 60.16-0.213333 42.410667 42.410667 0 0 0 0.213333-60.16L572.330667 512l211.413333-211.370667a42.538667 42.538667 0 0 0-0.213333-60.16 42.410667 42.410667 0 0 0-60.16-0.213333L512 451.669333z" FillRule="NonZero"/>
                                </Path.Data>
                            </Path>
                        </Canvas>
                    </Viewbox>
                </Button>
            </StackPanel>
        </Border>
        <Popup x:Name="_Popup" Placement="Mouse" PopupAnimation="Fade" Margin="5" AllowsTransparency="True">
            <Border CornerRadius="7" Background="#E5FFFFFF" Margin="15">
                <Border.Effect>
                    <DropShadowEffect ShadowDepth="0" BlurRadius="9"/>
                </Border.Effect>
                <Grid Margin="5">
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="标签：" Style="{StaticResource PopupTestBlock}"/>
                    <TextBox Grid.Column="1" Style="{StaticResource PopupTextBox}" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type Page}, Mode=FindAncestor}, Path=DataTag, UpdateSourceTrigger=PropertyChanged}"/>
                    <Grid Grid.Row="1" Grid.ColumnSpan="2">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="坐标x：" Style="{StaticResource PopupTestBlock}"/>
                        <TextBox Grid.Column="1" Style="{StaticResource PopupTextBox}" Text="{Binding RelativeSource={ RelativeSource AncestorType={x:Type Page}, Mode=FindAncestor}, Path=Coordinate.X, UpdateSourceTrigger=PropertyChanged}"/>
                        <TextBlock Grid.Column="2" Text="坐标y：" Style="{StaticResource PopupTestBlock}"/>
                        <TextBox Grid.Column="3" Style="{StaticResource PopupTextBox}" Text="{Binding RelativeSource={ RelativeSource AncestorType={x:Type Page}, Mode=FindAncestor}, Path=Coordinate.Y, UpdateSourceTrigger=PropertyChanged}"/>
                        <Grid Grid.Column="4" Margin="5,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Button Grid.Row="1" Content="←" Click="Direction_Click" Tag="left" Width="20" Height="20"/>
                            <Button Grid.Column="1" Content="↑" Click="Direction_Click" Tag="up" Width="20" Height="20"/>
                            <Button Grid.Row="1" Grid.Column="2" Content="→" Click="Direction_Click" Tag="right" Width="20" Height="20"/>
                            <Button Grid.Row="1" Grid.Column="1" Content="↓" Click="Direction_Click" Tag="down" Width="20" Height="20"/>
                        </Grid>
                    </Grid>
                    <TextBlock Text="取反：" Grid.Row="2" Style="{StaticResource PopupTestBlock}"/>
                    <CheckBox Grid.Row="2" Grid.Column="1" IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type Page}, Mode=FindAncestor}, Path=IsNegate, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
                </Grid>
            </Border>
        </Popup>
    </Grid>
</Page>
