<UserControl
    x:Class="PDF_Office.Views.Dialog.BOTA.AddAnnotationDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:customControl="clr-namespace:PDF_Office.CustomControl"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:dialogBOTA="clr-namespace:PDF_Office.ViewModels.Dialog.BOTA"
    xmlns:helper="clr-namespace:PDF_Office.Helper"
    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
    xmlns:local="clr-namespace:PDF_Office.Views.Dialog.BOTA"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:prism="http://prismlibrary.com/"
    Width="450"
    Height="220"
    d:DataContext="{d:DesignInstance Type=dialogBOTA:AddAnnotationDialogViewModel}"
    prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
    prism:ViewModelLocator.AutoWireViewModel="True"
    mc:Ignorable="d">
    <UserControl.Resources>
        <SolidColorBrush x:Key="path.fill" Color="#273C62" />
    </UserControl.Resources>
    <customControl:DialogContent Header="{Binding Title}">
        <customControl:DialogContent.Content>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>

                <StackPanel Height="50" HorizontalAlignment="Center">
                    <TextBox
                        Name="TxtInput"
                        Width="390"
                        Height="30"
                        Margin="15"
                        HorizontalContentAlignment="Left"
                        VerticalContentAlignment="Center"
                        FontFamily="微软雅黑"
                        FontSize="14"
                        Text="{Binding MarkupContent}">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="LostFocus">
                                <helper:AdvancedInvokeCommandAction
                                    Command="{Binding LostFocusCommand}"
                                    CommandParameter="{Binding ElementName=TxtInput}"
                                    PassEventArgsToCommand="True" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </TextBox>
                </StackPanel>
                <StackPanel
                    Grid.Row="1"
                    HorizontalAlignment="Center"
                    Orientation="Horizontal">
                    <Grid
                        Name="GridIco"
                        Height="30"
                        Margin="5,0">
                        <!--  高亮字体  -->
                        <customControl:CustomIconToggleBtn
                            x:Name="BtnHighlight"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Style="{StaticResource ToggleBtnAnnotationStyle}"
                            Tag="HighLight"
                            Visibility="Collapsed">
                            <Grid>
                                <Polygon
                                    Name="PathHighlight"
                                    VerticalAlignment="Center"
                                    Fill="Black"
                                    Points="0,20,3,0,20,0,17,20" />
                                <Image
                                    Width="18"
                                    Height="18"
                                    Source="pack://application:,,,/Resources/BOTA/Annotation/Highlight.png"
                                    Stretch="UniformToFill" />
                            </Grid>
                        </customControl:CustomIconToggleBtn>
                        <!--  手绘  -->
                        <customControl:CustomIconToggleBtn
                            x:Name="BtnFreeHand"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Style="{StaticResource ToggleBtnAnnotationStyle}"
                            Tag="Freehand"
                            Visibility="Collapsed">
                            <Grid>
                                <Image
                                    Width="18"
                                    Height="18"
                                    Source="pack://application:,,,/Resources/BOTA/Annotation/FreeHande.png"
                                    Stretch="UniformToFill" />
                                <Path
                                    Name="PathFreehand"
                                    VerticalAlignment="Bottom"
                                    Data="M2.57674716,4.1756938 L2,2.77872077 L3.23629157,2.32666213 L4.39858152,1.91423694 L5.48803594,1.54159101 L6.17445055,1.31533198 L6.8293576,1.10686063 L7.4531026,0.916220157 L8.04603105,0.743453759 L8.60848847,0.58860464 L9.14082038,0.451716002 L9.64337227,0.332831046 C9.72466845,0.314519594 9.80473819,0.296960095 9.88358869,0.280153449 L10.3421184,0.188355018 L10.7717319,0.114668273 C12.0867553,-0.0899506488 12.9720275,-0.0214898126 13.4769206,0.326224086 C13.7931843,0.544031104 14.0243062,0.794201523 14.1654835,1.08081708 C14.4150998,1.58758343 14.372095,1.98890858 14.1388295,2.56637317 L14.0118481,2.8607497 L14.1178229,2.85487846 C14.3317937,2.83763034 14.6024395,2.79427307 14.9260381,2.72394503 L15.1265218,2.67850482 L15.3515733,2.6235355 L15.8394138,2.49284637 C15.9249062,2.46876007 16.0124891,2.44352166 16.1021588,2.41713154 L16.665189,2.24497377 L17.2781263,2.04519508 L17.9407955,1.81781534 L18.653021,1.56285442 L19.4146274,1.28033219 L20,2.67408238 L18.9461796,3.06389046 L18.2946269,3.29587476 L17.6827717,3.50537002 L17.1096728,3.69222298 C16.9249947,3.75071655 16.7466192,3.80541085 16.5743893,3.85628035 L16.07598,3.99738887 C15.9158848,4.0405832 15.7617783,4.07992718 15.6135039,4.11539526 L15.1860199,4.21014624 C14.0234985,4.44551743 13.271008,4.39900906 12.8322254,4.05493276 C12.4563321,3.76017178 12.3000774,3.35823485 12.3526752,2.92564423 C12.3673344,2.80507968 12.3854738,2.71608905 12.4219387,2.60716366 L12.4922357,2.42238589 L12.6817642,1.97507903 L12.7254854,1.84483042 C12.7439032,1.77588453 12.7424284,1.73934924 12.7304594,1.71505002 C12.7102358,1.67399262 12.6563117,1.61562419 12.5457193,1.53946054 C12.4359989,1.46389742 12.2053386,1.43735078 11.8597168,1.46056818 L11.6123366,1.4834271 C11.5682899,1.48846839 11.5228403,1.49412611 11.4759961,1.50040128 L11.1782601,1.54546983 L10.8474456,1.60540634 L10.4839463,1.68026003 L10.0881558,1.77008011 C10.0195217,1.78630005 9.9495585,1.80314565 9.87827444,1.82061792 L9.43478535,1.93297989 L8.95998926,2.0604313 L8.4542798,2.20302138 L7.6386142,2.44539918 L6.75560787,2.72211586 L5.8065894,3.03333754 L4.7928874,3.37923034 L4.08180686,3.62916931 L3.34296223,3.89464073 L2.57674716,4.1756938 Z"
                                    Fill="Black" />
                            </Grid>
                        </customControl:CustomIconToggleBtn>

                        <!--  波浪线  -->
                        <Grid
                            Name="AnnotSquiggly"
                            Height="20"
                            Visibility="Collapsed">
                            <Image
                                Width="18"
                                Height="18"
                                Source="pack://application:,,,/Resources/BOTA/Annotation/Highlight.png"
                                Stretch="UniformToFill" />
                            <Path
                                Name="AnnotSquigglycolor"
                                VerticalAlignment="Bottom"
                                Data="M0,1.5 L1.12734157,0.82359506 C1.95251203,0.32849278 2.99856537,0.398852295 3.75,1 C4.48079387,1.5846351 5.51920613,1.5846351 6.25,1 C6.98079387,0.415364901 8.01920613,0.415364901 8.75,1 C9.48079387,1.5846351 10.5192061,1.5846351 11.25,1 C11.9807939,0.415364901 13.0192061,0.415364901 13.75,1 C14.4807939,1.5846351 15.5192061,1.5846351 16.25,1 C17.0014346,0.398852295 18.047488,0.32849278 18.8726584,0.82359506 L20,1.5 L20,1.5 L20,3 L18.8726584,2.32359506 C18.047488,1.82849278 17.0014346,1.89885229 16.25,2.5 C15.5192061,3.0846351 14.4807939,3.0846351 13.75,2.5 C13.0192061,1.9153649 11.9807939,1.9153649 11.25,2.5 C10.5192061,3.0846351 9.48079387,3.0846351 8.75,2.5 C8.01920613,1.9153649 6.98079387,1.9153649 6.25,2.5 C5.51920613,3.0846351 4.48079387,3.0846351 3.75,2.5 C2.99856537,1.89885229 1.95251203,1.82849278 1.12734157,2.32359506 L0,3 L0,3 L0,1.5 Z"
                                Fill="Black" />
                        </Grid>
                        <!--  便签  -->
                        <customControl:CustomIconToggleBtn
                            x:Name="BtnAnnotSticky"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Style="{StaticResource ToggleBtnAnnotationStyle}"
                            Visibility="Collapsed">
                            <Path
                                Name="PathSticky"
                                Width="18"
                                Height="18"
                                Data="M18,3 L18,15 L10,15 L5,18 L5,15 L2,15 L2,3 L18,3 Z M15,9.5 L5,9.5 L5,11 L15,11 L15,9.5 Z M11,6 L5,6 L5,7.5 L11,7.5 L11,6 Z"
                                Fill="{StaticResource path.fill}" />
                        </customControl:CustomIconToggleBtn>
                        <!--  图章  -->
                        <customControl:CustomIconToggleBtn
                            x:Name="BtnAnnotStamp"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Style="{StaticResource ToggleBtnAnnotationStyle}"
                            Visibility="Collapsed">
                            <Path
                                Name="PathStamp"
                                Width="18"
                                Height="18"
                                Data="M14.4,12.8 L14.4,14 L1.6,14 L1.6,12.8 L14.4,12.8 Z M14.4,10 L14.4,11.2 L1.6,11.2 L1.6,10 L14.4,10 Z M8,2 C9.7673112,2 11.2,3.4326888 11.2,5.2 C11.2,6.3887762 10.5517747,7.42615125 9.58951117,7.97793796 L9.6,7.96 C9.33333333,8.32 9.2,8.66666667 9.2,9 C9.2,9.33333333 9.33333333,9.66666667 9.6,10 L6.4,10 C6.66666667,9.66666667 6.8,9.33333333 6.8,9 C6.8,8.67223253 6.67108218,8.33157328 6.41324655,7.97802224 C5.44867449,7.42686988 4.8,6.38918796 4.8,5.2 C4.8,3.4326888 6.2326888,2 8,2 Z"
                                Fill="{StaticResource path.fill}" />
                        </customControl:CustomIconToggleBtn>
                        <!--  线  -->
                        <customControl:CustomIconToggleBtn
                            x:Name="BtnSharpLine"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Style="{StaticResource ToggleBtnAnnotationStyle}"
                            Visibility="Collapsed">
                            <Polygon
                                x:Name="PathSharpLine"
                                Width="20"
                                Height="20"
                                Fill="#273C62">
                                <Polygon.Points>
                                    13.1757359 1.97573593 14.0242641 2.82426407 2.82426407 14.0242641 1.97573593 13.1757359
                                </Polygon.Points>
                            </Polygon>
                        </customControl:CustomIconToggleBtn>

                        <!--  箭头  -->
                        <customControl:CustomIconToggleBtn
                            x:Name="BtnSharpArrow"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Style="{StaticResource ToggleBtnAnnotationStyle}"
                            Visibility="Collapsed">
                            <Path
                                x:Name="PathArrow"
                                Width="20"
                                Height="20"
                                Fill="#273C62">
                                <Path.Data>
                                    M13.4,2.6 L13.4,8 L12.2,8 L12.1997359,4.648 L2.02426407,14.8242641 L1.17573593,13.9757359 L11.3517359,3.799 L8,3.8 L8,2.6 L13.4,2.6 Z
                                </Path.Data>
                            </Path>
                        </customControl:CustomIconToggleBtn>

                        <!--  圆  -->
                        <customControl:CustomIconToggleBtn
                            x:Name="BtnAnnotCircle"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Style="{StaticResource ToggleBtnAnnotationStyle}"
                            Visibility="Collapsed">
                            <Ellipse
                                x:Name="EllipseCircle"
                                Width="20"
                                Height="20"
                                StrokeThickness="1" />
                        </customControl:CustomIconToggleBtn>
                        <!--  形状-矩形  -->
                        <customControl:CustomIconToggleBtn
                            x:Name="BtnAnnotSquare"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Style="{StaticResource ToggleBtnAnnotationStyle}"
                            Visibility="Collapsed">
                            <!--<Path Name="RectAnnotSquare" Fill="{StaticResource path.fill}"  Data="M18.75,3.25 L1.25,3.25 L1.25,16.75 L18.75,16.75 L18.75,3.25 Z M17.25,4.75 L17.25,15.25 L2.75,15.25 L2.75,4.75 L17.25,4.75 Z" />-->
                            <Rectangle
                                x:Name="RectAnnotSquare"
                                Width="18"
                                Height="16"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Stroke="#273C62"
                                StrokeThickness="1" />
                        </customControl:CustomIconToggleBtn>
                        <!--  文本注释  -->
                        <customControl:CustomIconToggleBtn
                            x:Name="BtnAnnotFreeText"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Style="{StaticResource ToggleBtnAnnotationStyle}"
                            Visibility="Collapsed">
                            <Path
                                Name="FreeTextPath"
                                Data="M16.75,2.75 L16.75,6 L15.25,6 L15.25,4.25 L10.75,4.25 L10.75,16.25 L12.3333333,16.25 L12.3333333,17.75 L7.66666667,17.75 L7.66666667,16.25 L9.25,16.25 L9.25,4.25 L4.75,4.25 L4.75,6 L3.25,6 L3.25,2.75 L16.75,2.75 Z"
                                Fill="{StaticResource path.fill}" />
                        </customControl:CustomIconToggleBtn>
                        <!--  删除线  -->
                        <customControl:CustomIconToggleBtn
                            x:Name="BtnAnnotStrikeout"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Style="{StaticResource ToggleBtnAnnotationStyle}"
                            Visibility="Collapsed">
                            <Grid Width="20" Height="20">
                                <Path
                                    Name="StrikeoutPath"
                                    Data="M5.23047 18H2.47656L4.46236 12.5H15.5376L17.5234 18H14.7578L13.2344 13.4297H6.76562L5.23047 18ZM14.9359 10.8333L11.418 1.08984H8.58203L5.06411 10.8333H7.63134L9.89453 4.05469H10.0938L12.3679 10.8333H14.9359Z"
                                    Fill="#273C62" />
                                <Rectangle
                                    x:Name="PathStrikeoutyColor"
                                    Grid.Row="1"
                                    Width="20"
                                    Height="2"
                                    Margin="0,4,0,0"
                                    Fill="#FF8200CC"
                                    Opacity="1" />
                            </Grid>
                        </customControl:CustomIconToggleBtn>
                        <!--  下划线  -->
                        <customControl:CustomIconToggleBtn
                            x:Name="BtnUnderLine"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Style="{StaticResource ToggleBtnAnnotationStyle}"
                            Tag="UnderLine"
                            Visibility="Collapsed">
                            <Grid Width="20" Height="20">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Path Data="M3.41699 16H5.82666L7.16992 12.001H12.8301L14.1631 16H16.583L11.2407 1.20361H8.75928L3.41699 16ZM9.90771 3.79785H10.082L12.2148 10.1553H7.78516L9.90771 3.79785Z" Fill="#273C62" />
                                <Rectangle
                                    Name="RectangleUnderline"
                                    Grid.Row="1"
                                    Width="18"
                                    Height="2"
                                    Margin="0,1,0,0"
                                    Fill="#FF8200CC"
                                    Opacity="1" />
                            </Grid>
                        </customControl:CustomIconToggleBtn>
                    </Grid>
                    <TextBlock
                        Name="TxbInput"
                        Width="390"
                        Height="30"
                        Margin="0"
                        FontFamily="微软雅黑"
                        FontSize="12"
                        Text="{Binding AnnotationName}" />
                </StackPanel>
            </Grid>
        </customControl:DialogContent.Content>
        <customControl:DialogContent.BottmBar>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="50*" />
                    <ColumnDefinition Width="50*" />
                </Grid.ColumnDefinitions>
                <Button
                    Grid.Column="0"
                    Width="150"
                    Height="32"
                    Margin="25,0,0,0"
                    HorizontalAlignment="Left"
                    Command="{Binding CreateCommnad}"
                    Content="确定" />
                <Button
                    Grid.Column="1"
                    Width="150"
                    Height="32"
                    Margin="0,0,25,0"
                    HorizontalAlignment="Right"
                    Command="{Binding CancelCommand}"
                    Content="取消" />
            </Grid>
        </customControl:DialogContent.BottmBar>
    </customControl:DialogContent>
</UserControl>