Explorar el Código

BOTA注释列表

OYXH\oyxh hace 2 años
padre
commit
a8085e7a91

+ 1 - 1
PDF Office/App.xaml.cs

@@ -102,7 +102,6 @@ namespace PDF_Office
 
             if (Settings.Default.QuickPDFToolsList == null)
                 Settings.Default.QuickPDFToolsList = new PDFSettings.QuickPDFToolsList();
-
         }
 
         /// <summary>
@@ -203,6 +202,7 @@ namespace PDF_Office
             containerRegistry.RegisterDialog<ConverterRTFDialog>(DialogNames.ConverterRTFDialog);
             containerRegistry.RegisterDialog<ConverterExcelDialog>(DialogNames.ConverterExcelDialog);
             containerRegistry.RegisterDialog<ConverterProgressBarDialog>(DialogNames.ConverterProgressBarDialog);
+            containerRegistry.RegisterDialog<AddBookmarkDialog>(DialogNames.AddBookmarkDialog);
 
             #endregion 注册弹窗
         }

+ 66 - 39
PDF Office/CustomControl/CompositeControl/ColorContent.xaml

@@ -1,67 +1,94 @@
-<UserControl x:Class="PDF_Office.CustomControl.CompositeControl.ColorContent"
-             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:PDF_Office.CustomControl.CompositeControl"
-             xmlns:cus="clr-namespace:PDF_Office.CustomControl"
-             mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800">
+<UserControl
+    x:Class="PDF_Office.CustomControl.CompositeControl.ColorContent"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.CustomControl.CompositeControl"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    mc:Ignorable="d">
     <UserControl.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml"/>
+                <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
             <DataTemplate x:Key="listboxData">
-                <Ellipse Height="20" Width="20" Fill="{Binding Color}"/>
+                <Ellipse
+                    Width="20"
+                    Height="20"
+                    Fill="{Binding Color}" />
             </DataTemplate>
-            
+
             <ContextMenu x:Key="FlyoutMenu" FontSize="14">
                 <ContextMenu.ItemContainerStyle>
                     <Style TargetType="MenuItem">
-                        <Setter Property="Padding" Value="0,7,0,7"/>
-                        <Setter Property="VerticalContentAlignment" Value="Center"/>
+                        <Setter Property="Padding" Value="0,7,0,7" />
+                        <Setter Property="VerticalContentAlignment" Value="Center" />
                     </Style>
                 </ContextMenu.ItemContainerStyle>
-                <MenuItem Name="ChangeColorMenuItem" Click="ChangeColorMenuItem_Click" Header="更改颜色" IsEnabled="True">
-                </MenuItem>
-                <MenuItem Name="BackColorMenuItem" Click="BackColorMenuItem_Click"  Header="恢复默认颜色"  IsEnabled="True">
-                </MenuItem>
+                <MenuItem
+                    Name="ChangeColorMenuItem"
+                    Click="ChangeColorMenuItem_Click"
+                    Header="更改颜色"
+                    IsEnabled="True" />
+                <MenuItem
+                    Name="BackColorMenuItem"
+                    Click="BackColorMenuItem_Click"
+                    Header="恢复默认颜色"
+                    IsEnabled="True" />
             </ContextMenu>
 
             <Style x:Key="listboxItemStyle" TargetType="{x:Type ListBoxItem}">
-                <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}"/>
-                <Setter Property="HorizontalContentAlignment" Value="Center"/>
-                <Setter Property="Height" Value="32"/>
-                <Setter Property="Margin" Value="2,0,2,0"/>
-                <EventSetter Event="PreviewMouseRightButtonDown"
-                             Handler="listboxItem_PreviewMouseRightButtonDown"/>
+                <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}" />
+                <Setter Property="HorizontalContentAlignment" Value="Center" />
+                <Setter Property="Height" Value="32" />
+                <Setter Property="Margin" Value="2,0,2,0" />
+                <EventSetter Event="PreviewMouseRightButtonDown" Handler="listboxItem_PreviewMouseRightButtonDown" />
             </Style>
         </ResourceDictionary>
     </UserControl.Resources>
-    <Grid >
+    <Grid>
         <Grid.ColumnDefinitions>
-            <ColumnDefinition Width="*"></ColumnDefinition>
-            <ColumnDefinition Width="auto"></ColumnDefinition>
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="auto" />
         </Grid.ColumnDefinitions>
-        <Border Width="56" Height="32" Grid.Column="1" Margin="0,0,5,0" BorderThickness="1" CornerRadius="4" BorderBrush="#E2E3E6"  HorizontalAlignment="Right" >
+        <Border
+            Grid.Column="1"
+            Width="56"
+            Height="32"
+            Margin="0,0,5,0"
+            HorizontalAlignment="Right"
+            BorderBrush="#E2E3E6"
+            BorderThickness="1"
+            CornerRadius="4">
             <StackPanel Orientation="Horizontal">
 
-                <Ellipse x:Name="ElcustomColor" Fill="Transparent" Width="20" Height="20" PreviewMouseLeftButtonDown="ElcustomColor_PreviewMouseLeftButtonDown"></Ellipse>
-                <cus:ColorDropBox x:Name="ColorDropPicker" SelectedColorChanged="ColorDropPicker_SelectedColorChanged">
-                </cus:ColorDropBox>
+                <Ellipse
+                    x:Name="ElcustomColor"
+                    Width="20"
+                    Height="20"
+                    Fill="Transparent"
+                    PreviewMouseLeftButtonDown="ElcustomColor_PreviewMouseLeftButtonDown" />
+                <cus:ColorDropBox x:Name="ColorDropPicker" SelectedColorChanged="ColorDropPicker_SelectedColorChanged" />
             </StackPanel>
         </Border>
-        <cus:ColorDropBox x:Name="PnlColor" SelectedColorChanged="PnlColor_SelectedColorChanged" Opacity="0">
-        </cus:ColorDropBox>
-        
-        <ListBox x:Name="ListColor"  BorderThickness="0" Background="Transparent" 
-                 SelectionChanged="ListColor_SelectionChanged"
-                 ItemContainerStyle="{StaticResource listboxItemStyle}" ItemTemplate="{StaticResource listboxData}"
-                 >
+        <cus:ColorDropBox
+            x:Name="PnlColor"
+            Opacity="0"
+            SelectedColorChanged="PnlColor_SelectedColorChanged" />
+
+        <ListBox
+            x:Name="ListColor"
+            Background="Transparent"
+            BorderThickness="0"
+            ItemContainerStyle="{StaticResource listboxItemStyle}"
+            ItemTemplate="{StaticResource listboxData}"
+            SelectionChanged="ListColor_SelectionChanged">
             <ListBox.ItemsPanel>
                 <ItemsPanelTemplate>
-                    <WrapPanel Orientation="Horizontal"/>
+                    <WrapPanel Orientation="Horizontal" />
                 </ItemsPanelTemplate>
             </ListBox.ItemsPanel>
         </ListBox>

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 26 - 15
PDF Office/CustomControl/CompositeControl/SlidContent.xaml


+ 38 - 0
PDF Office/DataConvert/CreateTimeToDate.cs

@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class CreateTimeToDate : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (string.IsNullOrEmpty(value.ToString()))
+            {
+                //没有时间得返回系统当前时间
+                return System.DateTime.Now.ToString("yyyyMMdd");
+            }
+            else
+            {
+                //部分日期不正常 需要进一步处理
+                string dateStr = Regex.Match(value.ToString(), "(?<=D\\:)[0-9]+(?=[\\+\\-])").Value;
+                if (string.IsNullOrEmpty(dateStr))//日期不合格时 显示当前系统日期
+                {
+                    dateStr = System.DateTime.Now.ToString("yyyyMMdd");
+                }
+                return dateStr.Substring(0, 8);
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 20 - 14
PDF Office/DataConvert/StringToDateConvert.cs

@@ -25,20 +25,26 @@ namespace PDF_Office.DataConvert
             {
                 string dateStr = Regex.Match(value.ToString(), "(?<=D\\:)[0-9]+(?=[\\+\\-])").Value;
 
-                if (string.Equals(dateStr.Substring(4, 4), DateTime.Now.ToString("MMdd")))
-                {//同天
-                    date = dateStr.Substring(8, 2) + ":" + dateStr.Substring(10, 2);
-                }
-                else if (string.Equals(dateStr.Substring(0, 4), DateTime.Now.ToString("yyyy")))
-                {//同年
-                    date = dateStr.Substring(4, 2) + "/" + dateStr.Substring(6, 2) + " " + dateStr.Substring(8, 2) + ":" +
-                   dateStr.Substring(10, 2);
-                }
-                else
-                {
-                    date = dateStr.Substring(0, 4) + "/" + dateStr.Substring(4, 2) + "/" + dateStr.Substring(6, 2) + " " + dateStr.Substring(8, 2) + ":" +
-                    dateStr.Substring(10, 2);
-                }
+                #region to do
+
+                //if (string.Equals(dateStr.Substring(4, 4), DateTime.Now.ToString("MMdd")))
+                //{//同天
+                //    date = dateStr.Substring(8, 2) + ":" + dateStr.Substring(10, 2);
+                //}
+                //else if (string.Equals(dateStr.Substring(0, 4), DateTime.Now.ToString("yyyy")))
+                //{//同年
+                //    date = dateStr.Substring(4, 2) + "/" + dateStr.Substring(6, 2) + " " + dateStr.Substring(8, 2) + ":" +
+                //   dateStr.Substring(10, 2);
+                //}
+                //else
+                //{
+                //    date = dateStr.Substring(0, 4) + "/" + dateStr.Substring(4, 2) + "/" + dateStr.Substring(6, 2) + " " + dateStr.Substring(8, 2) + ":" +
+                //    dateStr.Substring(10, 2);
+                //}
+
+                #endregion to do
+
+                date = dateStr.Substring(4, 2) + "-" + dateStr.Substring(6, 2) + "   " + dateStr.Substring(8, 2) + ":" + dateStr.Substring(10, 2);
             }
             return date;
         }

+ 2 - 0
PDF Office/PDF Office.csproj

@@ -219,6 +219,7 @@
     </Compile>
     <Compile Include="DataConvert\AnnotateFontSizeConverter.cs" />
     <Compile Include="DataConvert\BoolToTextWrapConvert.cs" />
+    <Compile Include="DataConvert\CreateTimeToDate.cs" />
     <Compile Include="DataConvert\FileFormatToIconConvert.cs" />
     <Compile Include="DataConvert\GroupHeaderConverter.cs" />
     <Compile Include="DataConvert\IntToBooleanConvert.cs" />
@@ -299,6 +300,7 @@
       <AutoGen>True</AutoGen>
     </Compile>
     <Compile Include="ViewModels\BOTA\AnnotationContentViewModel.cs" />
+    <Compile Include="ViewModels\BOTA\AnnotationListItemViewModel.cs" />
     <Compile Include="ViewModels\BOTA\BookmarkContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\BOTA\AddBookmarkDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\BOTA\BookmarkInfoDialogViewModel.cs" />

+ 3 - 0
PDF Office/Properties/Settings.Designer.cs

@@ -22,6 +22,9 @@ namespace PDF_Office.Properties {
                 return defaultInstance;
             }
         }
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("10")]
         public double AnnotateFontSize
         {
             get

+ 4 - 4
PDF Office/Styles/ButtonStyle.xaml

@@ -64,8 +64,8 @@
             </Setter.Value>
         </Setter>
     </Style>
-    
-    <!--只有内容的按钮(普通状态下,没有固定的边框和背景色)-->
+
+    <!--  只有内容的按钮(普通状态下,没有固定的边框和背景色)  -->
     <!--<Setter Property="Background" Value="{StaticResource Button.Static.Background}" />
     <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}" />-->
     <Style x:Key="OnlyContentBtn" TargetType="{x:Type Button}">
@@ -74,8 +74,8 @@
         <Setter Property="BorderThickness" Value="0" />
         <Setter Property="HorizontalContentAlignment" Value="Center" />
         <Setter Property="VerticalContentAlignment" Value="Center" />
-        <Setter Property="Background" Value="Transparent"/>
-        <Setter Property="BorderBrush" Value="Transparent"/>
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="BorderBrush" Value="Transparent" />
         <Setter Property="Padding" Value="0" />
         <Setter Property="Width" Value="32" />
         <Setter Property="Height" Value="32" />

+ 48 - 9
PDF Office/Styles/CustomBtnStyle.xaml

@@ -71,10 +71,10 @@
                             <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource Button.Pressed.Border}" />
                         </Trigger>
                         <!--<Trigger Property="IsEnabled" Value="false">
-                            <Setter TargetName="border" Property="Background" Value="{StaticResource Button.Disabled.Background}" />
-                            <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource Button.Disabled.Border}" />
-                            <Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{StaticResource Button.Disabled.Foreground}" />
-                            <Setter TargetName="contentPresenter" Property="Opacity" Value="0.5" />
+                        <Setter TargetName="border" Property="Background" Value="{StaticResource Button.Disabled.Background}" />
+                        <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource Button.Disabled.Border}" />
+                        <Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{StaticResource Button.Disabled.Foreground}" />
+                        <Setter TargetName="contentPresenter" Property="Opacity" Value="0.5" />
                         </Trigger>-->
                     </ControlTemplate.Triggers>
                 </ControlTemplate>
@@ -93,6 +93,49 @@
         </Style.Triggers>
     </Style>
 
+    <Style x:Key="ToggleBtnAnnotationStyle" TargetType="customControl:CustomIconToggleBtn">
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="HorizontalContentAlignment" Value="Left" />
+        <Setter Property="VerticalContentAlignment" Value="Top" />
+        <Setter Property="Height" Value="40" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="customControl:CustomIconToggleBtn">
+                    <Border
+                        x:Name="border"
+                        Background="{TemplateBinding Background}"
+                        BorderBrush="{TemplateBinding BorderBrush}"
+                        BorderThickness="{TemplateBinding BorderThickness}"
+                        SnapsToDevicePixels="true">
+                        <Grid>
+                            <Grid
+                                Width="40"
+                                Height="40"
+                                HorizontalAlignment="Left"
+                                VerticalAlignment="Top">
+                                <Image
+                                    x:Name="ImageIcon"
+                                    Width="20"
+                                    Height="20"
+                                    Source="{Binding Icon, RelativeSource={RelativeSource Mode=TemplatedParent}}"
+                                    Visibility="Collapsed" />
+                            </Grid>
+                            <ContentPresenter
+                                x:Name="contentPresenter"
+                                Margin="{TemplateBinding Padding}"
+                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                Focusable="False"
+                                RecognizesAccessKey="True"
+                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                        </Grid>
+                    </Border>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
     <SolidColorBrush
         x:Key="Button.Select.Background"
         Opacity="0.1"
@@ -173,7 +216,6 @@
         </Style.Triggers>
     </Style>
 
-
     <Style x:Key="BlueBtnStyle" TargetType="{x:Type Button}">
         <Setter Property="Background" Value="#1460F3" />
         <Setter Property="Template">
@@ -236,7 +278,6 @@
                             Focusable="False"
                             RecognizesAccessKey="True"
                             SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
-
                     </Border>
                     <ControlTemplate.Triggers>
                         <Trigger Property="IsMouseOver" Value="true">
@@ -386,7 +427,6 @@
         </Setter>
     </Style>
 
-
     <Style x:Key="HomePageCompressBtn" TargetType="Button">
         <Setter Property="Background" Value="White" />
         <Setter Property="BorderBrush" Value="White" />
@@ -430,5 +470,4 @@
             </Setter.Value>
         </Setter>
     </Style>
-</ResourceDictionary>
-
+</ResourceDictionary>

+ 115 - 2
PDF Office/Styles/ExpanderStyle.xaml

@@ -135,6 +135,118 @@
             </Setter.Value>
         </Setter>
     </Style>
+
+    <SolidColorBrush x:Key="Expander.MouseOver.Circle.Stroke" Color="#FF5593FF" />
+    <SolidColorBrush x:Key="Expander.MouseOver.Circle.Fill" Color="#FFF3F9FF" />
+    <SolidColorBrush x:Key="Expander.MouseOver.Arrow.Stroke" Color="#FF000000" />
+    <SolidColorBrush x:Key="Expander.Pressed.Circle.Stroke" Color="#FF3C77DD" />
+    <SolidColorBrush x:Key="Expander.Pressed.Circle.Fill" Color="#FFD9ECFF" />
+    <SolidColorBrush x:Key="Expander.Pressed.Arrow.Stroke" Color="#FF000000" />
+    <SolidColorBrush x:Key="Expander.Disabled.Circle.Stroke" Color="#FFBCBCBC" />
+    <SolidColorBrush x:Key="Expander.Disabled.Circle.Fill" Color="#FFE6E6E6" />
+    <SolidColorBrush x:Key="Expander.Disabled.Arrow.Stroke" Color="#FF707070" />
+    <SolidColorBrush x:Key="Expander.Static.Circle.Fill" Color="#FFFFFFFF" />
+    <SolidColorBrush x:Key="Expander.Static.Circle.Stroke" Color="#FF333333" />
+    <SolidColorBrush x:Key="Expander.Static.Arrow.Stroke" Color="#FF333333" />
+    <Style x:Key="GropExpanderStyle" TargetType="{x:Type ToggleButton}">
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ToggleButton}">
+                    <Border Padding="{TemplateBinding Padding}">
+                        <Grid Background="Transparent" SnapsToDevicePixels="False">
+                            <Grid.ColumnDefinitions>
+
+                                <ColumnDefinition Width="19" />
+                                <ColumnDefinition Width="*" />
+                            </Grid.ColumnDefinitions>
+                            <Ellipse
+                                x:Name="circle"
+                                Width="19"
+                                Height="19"
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center"
+                                Fill="{StaticResource Expander.Static.Circle.Fill}"
+                                Stroke="{StaticResource Expander.Static.Circle.Stroke}"
+                                Visibility="Collapsed" />
+                            <Rectangle Grid.Column="1" />
+                            <Polygon
+                                x:Name="arrow"
+                                Grid.Column="0"
+                                Margin="0,0,12,0"
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center"
+                                Fill="Black"
+                                Points="11 2 5 8 11 14"
+                                SnapsToDevicePixels="false"
+                                Stroke="{StaticResource Expander.Static.Arrow.Stroke}"
+                                StrokeThickness="2">
+                                <Polygon.RenderTransform>
+                                    <TransformGroup>
+                                        <TranslateTransform X="8" Y="8" />
+                                        <ScaleTransform ScaleX="-1" ScaleY="1" />
+                                        <TranslateTransform X="25" Y="-8" />
+                                    </TransformGroup>
+                                </Polygon.RenderTransform>
+                            </Polygon>
+                            <Polygon
+                                x:Name="arrowdown"
+                                Grid.Column="0"
+                                Margin="0,0,12,0"
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center"
+                                Fill="Black"
+                                Points="11 2 5 8 11 14"
+                                SnapsToDevicePixels="false"
+                                Stroke="{StaticResource Expander.Static.Arrow.Stroke}"
+                                StrokeThickness="2"
+                                Visibility="Collapsed">
+                                <Polygon.RenderTransform>
+                                    <TransformGroup>
+                                        <TranslateTransform X="8" Y="8" />
+                                        <RotateTransform Angle="-90" />
+                                        <TranslateTransform X="-5" Y="22" />
+                                    </TransformGroup>
+                                </Polygon.RenderTransform>
+                            </Polygon>
+                            <ContentPresenter
+                                Grid.Column="1"
+                                Margin="0,0,0,0"
+                                HorizontalAlignment="Stretch"
+                                VerticalAlignment="Center"
+                                RecognizesAccessKey="True"
+                                SnapsToDevicePixels="True" />
+                        </Grid>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsChecked" Value="true">
+                            <Setter TargetName="arrow" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="arrowdown" Property="Visibility" Value="Visible" />
+                        </Trigger>
+                        <Trigger Property="IsMouseOver" Value="true">
+                            <Setter TargetName="circle" Property="Stroke" Value="{StaticResource Expander.MouseOver.Circle.Stroke}" />
+                            <Setter TargetName="circle" Property="Fill" Value="{StaticResource Expander.MouseOver.Circle.Fill}" />
+                            <Setter TargetName="arrow" Property="Stroke" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}" />
+                            <Setter TargetName="arrowdown" Property="Stroke" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}" />
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="true">
+                            <Setter TargetName="circle" Property="Stroke" Value="{StaticResource Expander.Pressed.Circle.Stroke}" />
+                            <Setter TargetName="circle" Property="StrokeThickness" Value="1.5" />
+                            <Setter TargetName="circle" Property="Fill" Value="{StaticResource Expander.Pressed.Circle.Fill}" />
+                            <Setter TargetName="arrow" Property="Stroke" Value="{StaticResource Expander.Pressed.Arrow.Stroke}" />
+                            <Setter TargetName="arrowdown" Property="Stroke" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}" />
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="false">
+                            <Setter TargetName="circle" Property="Stroke" Value="{StaticResource Expander.Disabled.Circle.Stroke}" />
+                            <Setter TargetName="circle" Property="Fill" Value="{StaticResource Expander.Disabled.Circle.Fill}" />
+                            <Setter TargetName="arrow" Property="Stroke" Value="{StaticResource Expander.Disabled.Arrow.Stroke}" />
+                            <Setter TargetName="arrowdown" Property="Stroke" Value="{StaticResource Expander.Disabled.Arrow.Stroke}" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
     <Style x:Key="GropExpanderHeader" TargetType="{x:Type Expander}">
         <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
         <Setter Property="Background" Value="Transparent" />
@@ -152,6 +264,7 @@
                         CornerRadius="3"
                         SnapsToDevicePixels="true">
                         <DockPanel>
+
                             <ToggleButton
                                 x:Name="HeaderSite"
                                 MinWidth="0"
@@ -172,7 +285,7 @@
                                 FontWeight="{TemplateBinding FontWeight}"
                                 Foreground="{TemplateBinding Foreground}"
                                 IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
-                                Style="{StaticResource ExpanderDownHeaderStyle}" />
+                                Style="{StaticResource GropExpanderStyle}" />
                             <ContentPresenter
                                 x:Name="ExpandSite"
                                 Margin="{TemplateBinding Padding}"
@@ -187,7 +300,7 @@
                         <Trigger Property="IsExpanded" Value="true">
                             <Setter TargetName="ExpandSite" Property="Visibility" Value="Visible" />
                         </Trigger>
-                        <Trigger Property="IsEnabled" Value="false">
+                        <Trigger Property="IsExpanded" Value="false">
                             <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
                         </Trigger>
                     </ControlTemplate.Triggers>

+ 16 - 8
PDF Office/Styles/ListViewStyle.xaml

@@ -27,7 +27,7 @@
                                         <ColumnDefinition Width="2*" />
                                         <ColumnDefinition Width="100" />
                                     </Grid.ColumnDefinitions>
-                                    <!--以下是列表模式的列标题-->
+                                    <!--  以下是列表模式的列标题  -->
                                     <TextBlock
                                         Margin="12,0,0,6"
                                         HorizontalAlignment="Left"
@@ -48,7 +48,7 @@
                                         HorizontalAlignment="Center"
                                         VerticalAlignment="Center"
                                         FontSize="14" />
-                                    <!--列表模式的列标题的分隔线-->
+                                    <!--  列表模式的列标题的分隔线  -->
                                     <Rectangle
                                         Grid.ColumnSpan="4"
                                         Height="0"
@@ -136,7 +136,12 @@
                                 ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
                                 ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
                                 SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
-                            <Rectangle Grid.Column="1" Height="1" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Fill="#C5CBD3"/>
+                            <Rectangle
+                                Grid.Column="1"
+                                Height="1"
+                                HorizontalAlignment="Stretch"
+                                VerticalAlignment="Bottom"
+                                Fill="#C5CBD3" />
                         </Grid>
                     </Border>
                     <ControlTemplate.Triggers>
@@ -391,12 +396,15 @@
     </Style>
 
     <ControlTemplate x:Key="AnnotationListItemStyle" TargetType="{x:Type ListBoxItem}">
+
         <Border
             x:Name="Bd"
-            Padding="{TemplateBinding Padding}"
-            Background="{TemplateBinding Background}"
+            Margin="5,0,5,10"
+            Padding="5"
+            Background="#f5f5f5"
             BorderBrush="{TemplateBinding BorderBrush}"
             BorderThickness="{TemplateBinding BorderThickness}"
+            CornerRadius="4"
             SnapsToDevicePixels="True">
             <ContentPresenter
                 HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
@@ -411,7 +419,7 @@
                 <MultiTrigger.Conditions>
                     <Condition Property="IsMouseOver" Value="True" />
                 </MultiTrigger.Conditions>
-                <Setter TargetName="Bd" Property="Background" Value="#0A000000" />
+                <Setter TargetName="Bd" Property="Background" Value="#D9D9D9" />
                 <Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" />
             </MultiTrigger>
             <MultiTrigger>
@@ -419,7 +427,7 @@
                     <Condition Property="Selector.IsSelectionActive" Value="False" />
                     <Condition Property="IsSelected" Value="True" />
                 </MultiTrigger.Conditions>
-                <Setter TargetName="Bd" Property="Background" Value="#1A477EDE" />
+                <Setter TargetName="Bd" Property="Background" Value="#97D7FB" />
                 <Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" />
             </MultiTrigger>
             <MultiTrigger>
@@ -427,7 +435,7 @@
                     <Condition Property="Selector.IsSelectionActive" Value="True" />
                     <Condition Property="IsSelected" Value="True" />
                 </MultiTrigger.Conditions>
-                <Setter TargetName="Bd" Property="Background" Value="#1A477EDE" />
+                <Setter TargetName="Bd" Property="Background" Value="#97D7FB" />
                 <Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" />
             </MultiTrigger>
             <Trigger Property="IsEnabled" Value="False">

+ 302 - 423
PDF Office/Styles/SliderStyle.xaml

@@ -1,58 +1,61 @@
-<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
-    <Style TargetType="{x:Type Slider}" x:Key="RoundThumbSlider"
-       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-       xmlns:s="clr-namespace:System;assembly=mscorlib">
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <Style
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:s="clr-namespace:System;assembly=mscorlib"
+        x:Key="RoundThumbSlider"
+        TargetType="{x:Type Slider}">
         <Style.Triggers>
-            <Trigger Property="Slider.Orientation"
-                 Value="Vertical">
+            <Trigger Property="Slider.Orientation" Value="Vertical">
                 <Setter Property="Control.Template">
                     <Setter.Value>
                         <ControlTemplate TargetType="{x:Type Slider}">
-                            <Border BorderThickness="{TemplateBinding Border.BorderThickness}"
-                                BorderBrush="{TemplateBinding Border.BorderBrush}"
-                                Background="{TemplateBinding Panel.Background}"
+                            <Border
                                 Name="border"
+                                Background="{TemplateBinding Panel.Background}"
+                                BorderBrush="{TemplateBinding Border.BorderBrush}"
+                                BorderThickness="{TemplateBinding Border.BorderThickness}"
                                 SnapsToDevicePixels="True">
                                 <Grid>
                                     <Grid.ColumnDefinitions>
                                         <ColumnDefinition Width="Auto" />
-                                        <ColumnDefinition Width="Auto"
-                                                      MinWidth="{TemplateBinding FrameworkElement.MinWidth}" />
+                                        <ColumnDefinition Width="Auto" MinWidth="{TemplateBinding FrameworkElement.MinWidth}" />
                                         <ColumnDefinition Width="Auto" />
                                     </Grid.ColumnDefinitions>
-                                    <TickBar Fill="{TemplateBinding TextElement.Foreground}"
-                                         Placement="Left"
-                                         Name="TopTick"
-                                         Width="4"
-                                         Margin="0,0,2,0"
-                                         Visibility="Collapsed"
-                                         Grid.Column="0" />
-                                    <TickBar Fill="{TemplateBinding TextElement.Foreground}"
-                                         Placement="Right"
-                                         Name="BottomTick"
-                                         Width="4"
-                                         Margin="2,0,0,0"
-                                         Visibility="Collapsed"
-                                         Grid.Column="2" />
-                                    <Border BorderThickness="1"
-                                        BorderBrush="#D6D6D6"
-                                        Background="#E7EAEA"
+                                    <TickBar
+                                        Name="TopTick"
+                                        Grid.Column="0"
+                                        Width="4"
+                                        Margin="0,0,2,0"
+                                        Fill="{TemplateBinding TextElement.Foreground}"
+                                        Placement="Left"
+                                        Visibility="Collapsed" />
+                                    <TickBar
+                                        Name="BottomTick"
+                                        Grid.Column="2"
+                                        Width="4"
+                                        Margin="2,0,0,0"
+                                        Fill="{TemplateBinding TextElement.Foreground}"
+                                        Placement="Right"
+                                        Visibility="Collapsed" />
+                                    <Border
                                         Name="TrackBackground"
+                                        Grid.Column="1"
                                         Width="4"
                                         Margin="0,5"
                                         HorizontalAlignment="Center"
-                                        Grid.Column="1">
+                                        Background="#E7EAEA"
+                                        BorderBrush="#D6D6D6"
+                                        BorderThickness="1">
                                         <Canvas Margin="-1,-6">
-                                            <Rectangle Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
-                                                   Name="PART_SelectionRange"
-                                                   Width="4"
-                                                   Visibility="Hidden" />
+                                            <Rectangle
+                                                Name="PART_SelectionRange"
+                                                Width="4"
+                                                Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
+                                                Visibility="Hidden" />
                                         </Canvas>
                                     </Border>
-                                    <Track Name="PART_Track"
-                                       Grid.Column="1">
+                                    <Track Name="PART_Track" Grid.Column="1">
                                         <Track.DecreaseRepeatButton>
                                             <RepeatButton>
                                                 <RepeatButton.Command>
@@ -60,20 +63,17 @@
                                                 </RepeatButton.Command>
                                                 <RepeatButton.Style>
                                                     <Style TargetType="{x:Type RepeatButton}">
-                                                        <Setter Property="FrameworkElement.OverridesDefaultStyle"
-                                                            Value="True" />
-                                                        <Setter Property="Panel.Background"
-                                                            Value="#00FFFFFF" />
-                                                        <Setter Property="UIElement.Focusable"
-                                                            Value="False" />
-                                                        <Setter Property="KeyboardNavigation.IsTabStop"
-                                                            Value="False" />
+                                                        <Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True" />
+                                                        <Setter Property="Panel.Background" Value="#00FFFFFF" />
+                                                        <Setter Property="UIElement.Focusable" Value="False" />
+                                                        <Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
                                                         <Setter Property="Control.Template">
                                                             <Setter.Value>
                                                                 <ControlTemplate TargetType="{x:Type RepeatButton}">
-                                                                    <Rectangle Fill="{TemplateBinding Panel.Background}"
-                                                                           Width="{TemplateBinding FrameworkElement.Width}"
-                                                                           Height="2" />
+                                                                    <Rectangle
+                                                                        Width="{TemplateBinding FrameworkElement.Width}"
+                                                                        Height="2"
+                                                                        Fill="{TemplateBinding Panel.Background}" />
                                                                 </ControlTemplate>
                                                             </Setter.Value>
                                                         </Setter>
@@ -82,58 +82,48 @@
                                             </RepeatButton>
                                         </Track.DecreaseRepeatButton>
                                         <Track.Thumb>
-                                            <Thumb OverridesDefaultStyle="True"
-                                               Name="Thumb"
-                                               Width="18"
-                                               Height="11"
-                                               VerticalAlignment="Top"
-                                               Focusable="False">
+                                            <Thumb
+                                                Name="Thumb"
+                                                Width="18"
+                                                Height="11"
+                                                VerticalAlignment="Top"
+                                                Focusable="False"
+                                                OverridesDefaultStyle="True">
                                                 <Thumb.Template>
                                                     <ControlTemplate TargetType="{x:Type Thumb}">
-                                                        <Grid UseLayoutRounding="True"
-                                                          HorizontalAlignment="Center"
-                                                          VerticalAlignment="Center">
+                                                        <Grid
+                                                            HorizontalAlignment="Center"
+                                                            VerticalAlignment="Center"
+                                                            UseLayoutRounding="True">
                                                             <Path
-                                              Stretch="Fill"
-                                              Fill="#477EDE"
-                                              Stroke="#477EDE"
-                                              StrokeThickness="1"
-                                              UseLayoutRounding="True"
-                                              Name="grip"
-                                              VerticalAlignment="Center"
-                                              SnapsToDevicePixels="True" >
+                                                                Name="grip"
+                                                                VerticalAlignment="Center"
+                                                                Fill="#477EDE"
+                                                                SnapsToDevicePixels="True"
+                                                                Stretch="Fill"
+                                                                Stroke="#477EDE"
+                                                                StrokeThickness="1"
+                                                                UseLayoutRounding="True">
                                                                 <Path.Data>
-                                                                    <RectangleGeometry Rect="0,0,8,16" RadiusX="4" RadiusY="4"></RectangleGeometry>
+                                                                    <RectangleGeometry
+                                                                        RadiusX="4"
+                                                                        RadiusY="4"
+                                                                        Rect="0,0,8,16" />
                                                                 </Path.Data>
                                                             </Path>
                                                         </Grid>
                                                         <ControlTemplate.Triggers>
-                                                            <Trigger Property="UIElement.IsMouseOver"
-                                                                 Value="True">
-                                                                <Setter Property="Shape.Fill"
-                                                                    TargetName="grip"
-                                                                    Value="#477EDE" />
-                                                                <Setter Property="Shape.Stroke"
-                                                                    TargetName="grip"
-                                                                    Value="#477EDE" />
+                                                            <Trigger Property="UIElement.IsMouseOver" Value="True">
+                                                                <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                                <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                                             </Trigger>
-                                                            <Trigger Property="Thumb.IsDragging"
-                                                                 Value="True">
-                                                                <Setter Property="Shape.Fill"
-                                                                    TargetName="grip"
-                                                                    Value="#477EDE" />
-                                                                <Setter Property="Shape.Stroke"
-                                                                    TargetName="grip"
-                                                                    Value="#477EDE" />
+                                                            <Trigger Property="Thumb.IsDragging" Value="True">
+                                                                <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                                <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                                             </Trigger>
-                                                            <Trigger Property="UIElement.IsEnabled"
-                                                                 Value="False">
-                                                                <Setter Property="Shape.Fill"
-                                                                    TargetName="grip"
-                                                                    Value="#477EDE" />
-                                                                <Setter Property="Shape.Stroke"
-                                                                    TargetName="grip"
-                                                                    Value="#477EDE" />
+                                                            <Trigger Property="UIElement.IsEnabled" Value="False">
+                                                                <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                                <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                                             </Trigger>
                                                         </ControlTemplate.Triggers>
                                                     </ControlTemplate>
@@ -147,20 +137,17 @@
                                                 </RepeatButton.Command>
                                                 <RepeatButton.Style>
                                                     <Style TargetType="{x:Type RepeatButton}">
-                                                        <Setter Property="FrameworkElement.OverridesDefaultStyle"
-                                                            Value="True" />
-                                                        <Setter Property="Panel.Background"
-                                                            Value="#00FFFFFF" />
-                                                        <Setter Property="UIElement.Focusable"
-                                                            Value="False" />
-                                                        <Setter Property="KeyboardNavigation.IsTabStop"
-                                                            Value="False" />
+                                                        <Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True" />
+                                                        <Setter Property="Panel.Background" Value="#00FFFFFF" />
+                                                        <Setter Property="UIElement.Focusable" Value="False" />
+                                                        <Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
                                                         <Setter Property="Control.Template">
                                                             <Setter.Value>
                                                                 <ControlTemplate TargetType="{x:Type RepeatButton}">
-                                                                    <Rectangle Fill="{TemplateBinding Panel.Background}"
-                                                                           Width="{TemplateBinding FrameworkElement.Width}"
-                                                                           Height="2" />
+                                                                    <Rectangle
+                                                                        Width="{TemplateBinding FrameworkElement.Width}"
+                                                                        Height="2"
+                                                                        Fill="{TemplateBinding Panel.Background}" />
                                                                 </ControlTemplate>
                                                             </Setter.Value>
                                                         </Setter>
@@ -172,150 +159,105 @@
                                 </Grid>
                             </Border>
                             <ControlTemplate.Triggers>
-                                <Trigger Property="Slider.TickPlacement"
-                                     Value="TopLeft">
-                                    <Setter Property="UIElement.Visibility"
-                                        TargetName="TopTick"
-                                        Value="Visible" />
-                                    <Setter Property="Control.Template"
-                                        TargetName="Thumb">
+                                <Trigger Property="Slider.TickPlacement" Value="TopLeft">
+                                    <Setter TargetName="TopTick" Property="UIElement.Visibility" Value="Visible" />
+                                    <Setter TargetName="Thumb" Property="Control.Template">
                                         <Setter.Value>
                                             <ControlTemplate TargetType="{x:Type Thumb}">
-                                                <Grid UseLayoutRounding="True"
-                                                  HorizontalAlignment="Center"
-                                                  VerticalAlignment="Center">
+                                                <Grid
+                                                    HorizontalAlignment="Center"
+                                                    VerticalAlignment="Center"
+                                                    UseLayoutRounding="True">
                                                     <Path
-                                              Stretch="Fill"
-                                              Fill="#477EDE"
-                                              Stroke="#477EDE"
-                                              StrokeThickness="1"
-                                              UseLayoutRounding="True"
-                                              Name="grip"
-                                              VerticalAlignment="Center"
-                                              SnapsToDevicePixels="True" >
+                                                        Name="grip"
+                                                        VerticalAlignment="Center"
+                                                        Fill="#477EDE"
+                                                        SnapsToDevicePixels="True"
+                                                        Stretch="Fill"
+                                                        Stroke="#477EDE"
+                                                        StrokeThickness="1"
+                                                        UseLayoutRounding="True">
                                                         <Path.Data>
-                                                            <RectangleGeometry Rect="0,0,8,16" RadiusX="4" RadiusY="4"></RectangleGeometry>
+                                                            <RectangleGeometry
+                                                                RadiusX="4"
+                                                                RadiusY="4"
+                                                                Rect="0,0,8,16" />
                                                         </Path.Data>
                                                     </Path>
                                                 </Grid>
                                                 <ControlTemplate.Triggers>
-                                                    <Trigger Property="UIElement.IsMouseOver"
-                                                         Value="True">
-                                                        <Setter Property="Shape.Fill"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
-                                                        <Setter Property="Shape.Stroke"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
+                                                    <Trigger Property="UIElement.IsMouseOver" Value="True">
+                                                        <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                        <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                                     </Trigger>
-                                                    <Trigger Property="Thumb.IsDragging"
-                                                         Value="True">
-                                                        <Setter Property="Shape.Fill"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
-                                                        <Setter Property="Shape.Stroke"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
+                                                    <Trigger Property="Thumb.IsDragging" Value="True">
+                                                        <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                        <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                                     </Trigger>
-                                                    <Trigger Property="UIElement.IsEnabled"
-                                                         Value="False">
-                                                        <Setter Property="Shape.Fill"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
-                                                        <Setter Property="Shape.Stroke"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
+                                                    <Trigger Property="UIElement.IsEnabled" Value="False">
+                                                        <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                        <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                                     </Trigger>
                                                 </ControlTemplate.Triggers>
                                             </ControlTemplate>
                                         </Setter.Value>
                                     </Setter>
-                                    <Setter Property="FrameworkElement.Margin"
-                                        TargetName="TrackBackground"
-                                        Value="2,5,0,5" />
+                                    <Setter TargetName="TrackBackground" Property="FrameworkElement.Margin" Value="2,5,0,5" />
                                 </Trigger>
-                                <Trigger Property="Slider.TickPlacement"
-                                     Value="BottomRight">
-                                    <Setter Property="UIElement.Visibility"
-                                        TargetName="BottomTick"
-                                        Value="Visible" />
-                                    <Setter Property="Control.Template"
-                                        TargetName="Thumb">
+                                <Trigger Property="Slider.TickPlacement" Value="BottomRight">
+                                    <Setter TargetName="BottomTick" Property="UIElement.Visibility" Value="Visible" />
+                                    <Setter TargetName="Thumb" Property="Control.Template">
                                         <Setter.Value>
                                             <ControlTemplate TargetType="{x:Type Thumb}">
-                                                <Grid UseLayoutRounding="True"
-                                                  HorizontalAlignment="Center"
-                                                  VerticalAlignment="Center">
+                                                <Grid
+                                                    HorizontalAlignment="Center"
+                                                    VerticalAlignment="Center"
+                                                    UseLayoutRounding="True">
                                                     <Path
-                                              Stretch="Fill"
-                                              Fill="#477EDE"
-                                              Stroke="#477EDE"
-                                              StrokeThickness="1"
-                                              UseLayoutRounding="True"
-                                              Name="grip"
-                                              VerticalAlignment="Center"
-                                              SnapsToDevicePixels="True" >
+                                                        Name="grip"
+                                                        VerticalAlignment="Center"
+                                                        Fill="#477EDE"
+                                                        SnapsToDevicePixels="True"
+                                                        Stretch="Fill"
+                                                        Stroke="#477EDE"
+                                                        StrokeThickness="1"
+                                                        UseLayoutRounding="True">
                                                         <Path.Data>
-                                                            <RectangleGeometry Rect="0,0,8,16" RadiusX="4" RadiusY="4"></RectangleGeometry>
+                                                            <RectangleGeometry
+                                                                RadiusX="4"
+                                                                RadiusY="4"
+                                                                Rect="0,0,8,16" />
                                                         </Path.Data>
                                                     </Path>
                                                 </Grid>
                                                 <ControlTemplate.Triggers>
-                                                    <Trigger Property="UIElement.IsMouseOver"
-                                                         Value="True">
-                                                        <Setter Property="Shape.Fill"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
-                                                        <Setter Property="Shape.Stroke"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
+                                                    <Trigger Property="UIElement.IsMouseOver" Value="True">
+                                                        <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                        <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                                     </Trigger>
-                                                    <Trigger Property="Thumb.IsDragging"
-                                                         Value="True">
-                                                        <Setter Property="Shape.Fill"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
-                                                        <Setter Property="Shape.Stroke"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
+                                                    <Trigger Property="Thumb.IsDragging" Value="True">
+                                                        <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                        <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                                     </Trigger>
-                                                    <Trigger Property="UIElement.IsEnabled"
-                                                         Value="False">
-                                                        <Setter Property="Shape.Fill"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
-                                                        <Setter Property="Shape.Stroke"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
+                                                    <Trigger Property="UIElement.IsEnabled" Value="False">
+                                                        <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                        <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                                     </Trigger>
                                                 </ControlTemplate.Triggers>
                                             </ControlTemplate>
                                         </Setter.Value>
                                     </Setter>
-                                    <Setter Property="FrameworkElement.Margin"
-                                        TargetName="TrackBackground"
-                                        Value="0,5,2,5" />
+                                    <Setter TargetName="TrackBackground" Property="FrameworkElement.Margin" Value="0,5,2,5" />
                                 </Trigger>
-                                <Trigger Property="Slider.TickPlacement"
-                                     Value="Both">
-                                    <Setter Property="UIElement.Visibility"
-                                        TargetName="TopTick"
-                                        Value="Visible" />
-                                    <Setter Property="UIElement.Visibility"
-                                        TargetName="BottomTick"
-                                        Value="Visible" />
+                                <Trigger Property="Slider.TickPlacement" Value="Both">
+                                    <Setter TargetName="TopTick" Property="UIElement.Visibility" Value="Visible" />
+                                    <Setter TargetName="BottomTick" Property="UIElement.Visibility" Value="Visible" />
                                 </Trigger>
-                                <Trigger Property="Slider.IsSelectionRangeEnabled"
-                                     Value="True">
-                                    <Setter Property="UIElement.Visibility"
-                                        TargetName="PART_SelectionRange"
-                                        Value="Visible" />
+                                <Trigger Property="Slider.IsSelectionRangeEnabled" Value="True">
+                                    <Setter TargetName="PART_SelectionRange" Property="UIElement.Visibility" Value="Visible" />
                                 </Trigger>
-                                <Trigger Property="UIElement.IsKeyboardFocused"
-                                     Value="True">
-                                    <Setter Property="TextElement.Foreground"
-                                        TargetName="Thumb"
-                                        Value="#0000FF" />
+                                <Trigger Property="UIElement.IsKeyboardFocused" Value="True">
+                                    <Setter TargetName="Thumb" Property="TextElement.Foreground" Value="#0000FF" />
                                 </Trigger>
                             </ControlTemplate.Triggers>
                         </ControlTemplate>
@@ -323,60 +265,59 @@
                 </Setter>
             </Trigger>
         </Style.Triggers>
-        <Setter Property="Stylus.IsPressAndHoldEnabled"
-            Value="False" />
-        <Setter Property="Panel.Background"
-            Value="#00FFFFFF" />
-        <Setter Property="Border.BorderBrush"
-            Value="#00FFFFFF" />
-        <Setter Property="TextElement.Foreground"
-            Value="#E5E5E5" />
+        <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False" />
+        <Setter Property="Panel.Background" Value="#00FFFFFF" />
+        <Setter Property="Border.BorderBrush" Value="#00FFFFFF" />
+        <Setter Property="TextElement.Foreground" Value="#E5E5E5" />
         <Setter Property="Control.Template">
             <Setter.Value>
                 <ControlTemplate TargetType="{x:Type Slider}">
-                    <Border BorderThickness="{TemplateBinding Border.BorderThickness}"
-                        BorderBrush="{TemplateBinding Border.BorderBrush}"
-                        Background="{TemplateBinding Panel.Background}"
+                    <Border
                         Name="border"
+                        Background="{TemplateBinding Panel.Background}"
+                        BorderBrush="{TemplateBinding Border.BorderBrush}"
+                        BorderThickness="{TemplateBinding Border.BorderThickness}"
                         SnapsToDevicePixels="True">
                         <Grid>
                             <Grid.RowDefinitions>
                                 <RowDefinition Height="Auto" />
-                                <RowDefinition Height="Auto"
-                                           MinHeight="{TemplateBinding FrameworkElement.MinHeight}" />
+                                <RowDefinition Height="Auto" MinHeight="{TemplateBinding FrameworkElement.MinHeight}" />
                                 <RowDefinition Height="Auto" />
                             </Grid.RowDefinitions>
-                            <TickBar Fill="{TemplateBinding TextElement.Foreground}"
-                                 Placement="Top"
-                                 Name="TopTick"
-                                 Height="4"
-                                 Margin="0,2,0,0"
-                                 Visibility="Collapsed"
-                                 Grid.Row="0" />
-                            <TickBar Fill="{TemplateBinding TextElement.Foreground}"
-                                 Placement="Bottom"
-                                 Name="BottomTick"
-                                 Height="4"
-                                 Margin="0,0,0,2"
-                                 Visibility="Collapsed"
-                                 Grid.Row="2" />
-                            <Border BorderThickness="0"
-                                BorderBrush="#D6D6D6"
-                                Background="#FFE2E3E6"
+                            <TickBar
+                                Name="TopTick"
+                                Grid.Row="0"
+                                Height="4"
+                                Margin="0,2,0,0"
+                                Fill="{TemplateBinding TextElement.Foreground}"
+                                Placement="Top"
+                                Visibility="Collapsed" />
+                            <TickBar
+                                Name="BottomTick"
+                                Grid.Row="2"
+                                Height="4"
+                                Margin="0,0,0,2"
+                                Fill="{TemplateBinding TextElement.Foreground}"
+                                Placement="Bottom"
+                                Visibility="Collapsed" />
+                            <Border
                                 Name="TrackBackground"
+                                Grid.Row="1"
                                 Height="4"
                                 Margin="5,0"
                                 VerticalAlignment="Center"
-                                Grid.Row="1">
+                                Background="#FFE2E3E6"
+                                BorderBrush="#D6D6D6"
+                                BorderThickness="0">
                                 <Canvas Margin="-6,-1">
-                                    <Rectangle Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
-                                           Name="PART_SelectionRange"
-                                           Height="4"
-                                           Visibility="Hidden" />
+                                    <Rectangle
+                                        Name="PART_SelectionRange"
+                                        Height="4"
+                                        Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"
+                                        Visibility="Hidden" />
                                 </Canvas>
                             </Border>
-                            <Track Name="PART_Track"
-                               Grid.Row="1">
+                            <Track Name="PART_Track" Grid.Row="1">
                                 <Track.DecreaseRepeatButton>
                                     <RepeatButton>
                                         <RepeatButton.Command>
@@ -384,20 +325,17 @@
                                         </RepeatButton.Command>
                                         <RepeatButton.Style>
                                             <Style TargetType="{x:Type RepeatButton}">
-                                                <Setter Property="FrameworkElement.OverridesDefaultStyle"
-                                                    Value="True" />
-                                                <Setter Property="Panel.Background"
-                                                    Value="#00FFFFFF" />
-                                                <Setter Property="UIElement.Focusable"
-                                                    Value="False" />
-                                                <Setter Property="KeyboardNavigation.IsTabStop"
-                                                    Value="False" />
+                                                <Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True" />
+                                                <Setter Property="Panel.Background" Value="#00FFFFFF" />
+                                                <Setter Property="UIElement.Focusable" Value="False" />
+                                                <Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
                                                 <Setter Property="Control.Template">
                                                     <Setter.Value>
                                                         <ControlTemplate TargetType="{x:Type RepeatButton}">
-                                                            <Rectangle Fill="{TemplateBinding Panel.Background}"
-                                                                   Width="{TemplateBinding FrameworkElement.Width}"
-                                                                   Height="{TemplateBinding FrameworkElement.Height}" />
+                                                            <Rectangle
+                                                                Width="{TemplateBinding FrameworkElement.Width}"
+                                                                Height="{TemplateBinding FrameworkElement.Height}"
+                                                                Fill="{TemplateBinding Panel.Background}" />
                                                         </ControlTemplate>
                                                     </Setter.Value>
                                                 </Setter>
@@ -406,58 +344,48 @@
                                     </RepeatButton>
                                 </Track.DecreaseRepeatButton>
                                 <Track.Thumb>
-                                    <Thumb OverridesDefaultStyle="True"
-                                       Name="Thumb"
-                                       Width="8"
-                                       Height="16"
-                                       VerticalAlignment="Center"
-                                       Focusable="False">
+                                    <Thumb
+                                        Name="Thumb"
+                                        Width="8"
+                                        Height="16"
+                                        VerticalAlignment="Center"
+                                        Focusable="False"
+                                        OverridesDefaultStyle="True">
                                         <Thumb.Template>
                                             <ControlTemplate TargetType="{x:Type Thumb}">
-                                                <Grid UseLayoutRounding="True"
-                                                  HorizontalAlignment="Center"
-                                                  VerticalAlignment="Center">
+                                                <Grid
+                                                    HorizontalAlignment="Center"
+                                                    VerticalAlignment="Center"
+                                                    UseLayoutRounding="True">
                                                     <Path
-                                              Stretch="Fill"
-                                              Fill="#477EDE"
-                                              Stroke="#477EDE"
-                                              StrokeThickness="1"
-                                              UseLayoutRounding="True"
-                                              Name="grip"
-                                              VerticalAlignment="Center"
-                                              SnapsToDevicePixels="True" >
+                                                        Name="grip"
+                                                        VerticalAlignment="Center"
+                                                        Fill="#477EDE"
+                                                        SnapsToDevicePixels="True"
+                                                        Stretch="Fill"
+                                                        Stroke="#477EDE"
+                                                        StrokeThickness="1"
+                                                        UseLayoutRounding="True">
                                                         <Path.Data>
-                                                            <RectangleGeometry Rect="0,0,8,16" RadiusX="4" RadiusY="4"></RectangleGeometry>
+                                                            <RectangleGeometry
+                                                                RadiusX="4"
+                                                                RadiusY="4"
+                                                                Rect="0,0,8,16" />
                                                         </Path.Data>
                                                     </Path>
                                                 </Grid>
                                                 <ControlTemplate.Triggers>
-                                                    <Trigger Property="UIElement.IsMouseOver"
-                                                         Value="True">
-                                                        <Setter Property="Shape.Fill"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
-                                                        <Setter Property="Shape.Stroke"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
+                                                    <Trigger Property="UIElement.IsMouseOver" Value="True">
+                                                        <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                        <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                                     </Trigger>
-                                                    <Trigger Property="Thumb.IsDragging"
-                                                         Value="True">
-                                                        <Setter Property="Shape.Fill"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
-                                                        <Setter Property="Shape.Stroke"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
+                                                    <Trigger Property="Thumb.IsDragging" Value="True">
+                                                        <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                        <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                                     </Trigger>
-                                                    <Trigger Property="UIElement.IsEnabled"
-                                                         Value="False">
-                                                        <Setter Property="Shape.Fill"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
-                                                        <Setter Property="Shape.Stroke"
-                                                            TargetName="grip"
-                                                            Value="#477EDE" />
+                                                    <Trigger Property="UIElement.IsEnabled" Value="False">
+                                                        <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                        <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                                     </Trigger>
                                                 </ControlTemplate.Triggers>
                                             </ControlTemplate>
@@ -471,21 +399,17 @@
                                         </RepeatButton.Command>
                                         <RepeatButton.Style>
                                             <Style TargetType="{x:Type RepeatButton}">
-                                                <Setter Property="FrameworkElement.OverridesDefaultStyle"
-                                                    Value="True" />
-                                                <Setter Property="Panel.Background"
-                                                    Value="#00FFFFFF" />
-                                                <Setter Property="UIElement.Focusable"
-                                                    Value="False" />
-                                                <Setter Property="KeyboardNavigation.IsTabStop"
-                                                    Value="False" />
+                                                <Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True" />
+                                                <Setter Property="Panel.Background" Value="#00FFFFFF" />
+                                                <Setter Property="UIElement.Focusable" Value="False" />
+                                                <Setter Property="KeyboardNavigation.IsTabStop" Value="False" />
                                                 <Setter Property="Control.Template">
                                                     <Setter.Value>
                                                         <ControlTemplate TargetType="{x:Type RepeatButton}">
-                                                            <Rectangle Fill="{TemplateBinding Panel.Background}"
-                                                                   Width="{TemplateBinding FrameworkElement.Width}"
-                                                                   Height="{TemplateBinding FrameworkElement.Height}"
-                                                                   />
+                                                            <Rectangle
+                                                                Width="{TemplateBinding FrameworkElement.Width}"
+                                                                Height="{TemplateBinding FrameworkElement.Height}"
+                                                                Fill="{TemplateBinding Panel.Background}" />
                                                         </ControlTemplate>
                                                     </Setter.Value>
                                                 </Setter>
@@ -497,150 +421,105 @@
                         </Grid>
                     </Border>
                     <ControlTemplate.Triggers>
-                        <Trigger Property="Slider.TickPlacement"
-                             Value="TopLeft">
-                            <Setter Property="UIElement.Visibility"
-                                TargetName="TopTick"
-                                Value="Visible" />
-                            <Setter Property="Control.Template"
-                                TargetName="Thumb">
+                        <Trigger Property="Slider.TickPlacement" Value="TopLeft">
+                            <Setter TargetName="TopTick" Property="UIElement.Visibility" Value="Visible" />
+                            <Setter TargetName="Thumb" Property="Control.Template">
                                 <Setter.Value>
                                     <ControlTemplate TargetType="{x:Type Thumb}">
-                                        <Grid UseLayoutRounding="True"
-                                          HorizontalAlignment="Center"
-                                          VerticalAlignment="Center">
+                                        <Grid
+                                            HorizontalAlignment="Center"
+                                            VerticalAlignment="Center"
+                                            UseLayoutRounding="True">
                                             <Path
-                                              Stretch="Fill"
-                                              Fill="#477EDE"
-                                              Stroke="#477EDE"
-                                              StrokeThickness="1"
-                                              UseLayoutRounding="True"
-                                              Name="grip"
-                                              VerticalAlignment="Center"
-                                              SnapsToDevicePixels="True" >
+                                                Name="grip"
+                                                VerticalAlignment="Center"
+                                                Fill="#477EDE"
+                                                SnapsToDevicePixels="True"
+                                                Stretch="Fill"
+                                                Stroke="#477EDE"
+                                                StrokeThickness="1"
+                                                UseLayoutRounding="True">
                                                 <Path.Data>
-                                                    <RectangleGeometry Rect="0,0,8,16" RadiusX="4" RadiusY="4"></RectangleGeometry>
+                                                    <RectangleGeometry
+                                                        RadiusX="4"
+                                                        RadiusY="4"
+                                                        Rect="0,0,8,16" />
                                                 </Path.Data>
                                             </Path>
                                         </Grid>
                                         <ControlTemplate.Triggers>
-                                            <Trigger Property="UIElement.IsMouseOver"
-                                                 Value="True">
-                                                <Setter Property="Shape.Fill"
-                                                    TargetName="grip"
-                                                    Value="#477EDE" />
-                                                <Setter Property="Shape.Stroke"
-                                                    TargetName="grip"
-                                                    Value="#477EDE" />
+                                            <Trigger Property="UIElement.IsMouseOver" Value="True">
+                                                <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                             </Trigger>
-                                            <Trigger Property="Thumb.IsDragging"
-                                                 Value="True">
-                                                <Setter Property="Shape.Fill"
-                                                    TargetName="grip"
-                                                    Value="#477EDE" />
-                                                <Setter Property="Shape.Stroke"
-                                                    TargetName="grip"
-                                                    Value="#477EDE" />
+                                            <Trigger Property="Thumb.IsDragging" Value="True">
+                                                <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                             </Trigger>
-                                            <Trigger Property="UIElement.IsEnabled"
-                                                 Value="False">
-                                                <Setter Property="Shape.Fill"
-                                                    TargetName="grip"
-                                                    Value="#477EDE" />
-                                                <Setter Property="Shape.Stroke"
-                                                    TargetName="grip"
-                                                    Value="#477EDE" />
+                                            <Trigger Property="UIElement.IsEnabled" Value="False">
+                                                <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                             </Trigger>
                                         </ControlTemplate.Triggers>
                                     </ControlTemplate>
                                 </Setter.Value>
                             </Setter>
-                            <Setter Property="FrameworkElement.Margin"
-                                TargetName="TrackBackground"
-                                Value="5,2,5,0" />
+                            <Setter TargetName="TrackBackground" Property="FrameworkElement.Margin" Value="5,2,5,0" />
                         </Trigger>
-                        <Trigger Property="Slider.TickPlacement"
-                             Value="BottomRight">
-                            <Setter Property="UIElement.Visibility"
-                                TargetName="BottomTick"
-                                Value="Visible" />
-                            <Setter Property="Control.Template"
-                                TargetName="Thumb">
+                        <Trigger Property="Slider.TickPlacement" Value="BottomRight">
+                            <Setter TargetName="BottomTick" Property="UIElement.Visibility" Value="Visible" />
+                            <Setter TargetName="Thumb" Property="Control.Template">
                                 <Setter.Value>
                                     <ControlTemplate TargetType="{x:Type Thumb}">
-                                        <Grid UseLayoutRounding="True"
-                                          HorizontalAlignment="Center"
-                                          VerticalAlignment="Center">
+                                        <Grid
+                                            HorizontalAlignment="Center"
+                                            VerticalAlignment="Center"
+                                            UseLayoutRounding="True">
                                             <Path
-                                              Stretch="Fill"
-                                              Fill="#477EDE"
-                                              Stroke="#477EDE"
-                                              StrokeThickness="1"
-                                              UseLayoutRounding="True"
-                                              Name="grip"
-                                              VerticalAlignment="Center"
-                                              SnapsToDevicePixels="True" >
+                                                Name="grip"
+                                                VerticalAlignment="Center"
+                                                Fill="#477EDE"
+                                                SnapsToDevicePixels="True"
+                                                Stretch="Fill"
+                                                Stroke="#477EDE"
+                                                StrokeThickness="1"
+                                                UseLayoutRounding="True">
                                                 <Path.Data>
-                                                    <RectangleGeometry Rect="0,0,8,16" RadiusX="4" RadiusY="4"></RectangleGeometry>
+                                                    <RectangleGeometry
+                                                        RadiusX="4"
+                                                        RadiusY="4"
+                                                        Rect="0,0,8,16" />
                                                 </Path.Data>
                                             </Path>
                                         </Grid>
                                         <ControlTemplate.Triggers>
-                                            <Trigger Property="UIElement.IsMouseOver"
-                                                 Value="True">
-                                                <Setter Property="Shape.Fill"
-                                                    TargetName="grip"
-                                                    Value="#477EDE" />
-                                                <Setter Property="Shape.Stroke"
-                                                    TargetName="grip"
-                                                    Value="#477EDE" />
+                                            <Trigger Property="UIElement.IsMouseOver" Value="True">
+                                                <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                             </Trigger>
-                                            <Trigger Property="Thumb.IsDragging"
-                                                 Value="True">
-                                                <Setter Property="Shape.Fill"
-                                                    TargetName="grip"
-                                                    Value="#477EDE" />
-                                                <Setter Property="Shape.Stroke"
-                                                    TargetName="grip"
-                                                    Value="#477EDE" />
+                                            <Trigger Property="Thumb.IsDragging" Value="True">
+                                                <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                             </Trigger>
-                                            <Trigger Property="UIElement.IsEnabled"
-                                                 Value="False">
-                                                <Setter Property="Shape.Fill"
-                                                    TargetName="grip"
-                                                    Value="#477EDE" />
-                                                <Setter Property="Shape.Stroke"
-                                                    TargetName="grip"
-                                                    Value="#477EDE" />
+                                            <Trigger Property="UIElement.IsEnabled" Value="False">
+                                                <Setter TargetName="grip" Property="Shape.Fill" Value="#477EDE" />
+                                                <Setter TargetName="grip" Property="Shape.Stroke" Value="#477EDE" />
                                             </Trigger>
                                         </ControlTemplate.Triggers>
                                     </ControlTemplate>
                                 </Setter.Value>
                             </Setter>
-                            <Setter Property="FrameworkElement.Margin"
-                                TargetName="TrackBackground"
-                                Value="5,0,5,2" />
+                            <Setter TargetName="TrackBackground" Property="FrameworkElement.Margin" Value="5,0,5,2" />
                         </Trigger>
-                        <Trigger Property="Slider.TickPlacement"
-                             Value="Both">
-                            <Setter Property="UIElement.Visibility"
-                                TargetName="TopTick"
-                                Value="Visible" />
-                            <Setter Property="UIElement.Visibility"
-                                TargetName="BottomTick"
-                                Value="Visible" />
+                        <Trigger Property="Slider.TickPlacement" Value="Both">
+                            <Setter TargetName="TopTick" Property="UIElement.Visibility" Value="Visible" />
+                            <Setter TargetName="BottomTick" Property="UIElement.Visibility" Value="Visible" />
                         </Trigger>
-                        <Trigger Property="Slider.IsSelectionRangeEnabled"
-                             Value="True">
-                            <Setter Property="UIElement.Visibility"
-                                TargetName="PART_SelectionRange"
-                                Value="Visible" />
+                        <Trigger Property="Slider.IsSelectionRangeEnabled" Value="True">
+                            <Setter TargetName="PART_SelectionRange" Property="UIElement.Visibility" Value="Visible" />
                         </Trigger>
-                        <Trigger Property="UIElement.IsKeyboardFocused"
-                             Value="True">
-                            <Setter Property="TextElement.Foreground"
-                                TargetName="Thumb"
-                                Value="#0000FF" />
+                        <Trigger Property="UIElement.IsKeyboardFocused" Value="True">
+                            <Setter TargetName="Thumb" Property="TextElement.Foreground" Value="#0000FF" />
                         </Trigger>
                     </ControlTemplate.Triggers>
                 </ControlTemplate>

+ 255 - 3
PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs

@@ -1,20 +1,75 @@
-using ComPDFKitViewer.AnnotEvent;
+using ComPDFKit.Import;
+using ComPDFKit.PDFAnnotation;
+using ComPDFKit.PDFDocument;
+using ComPDFKit.PDFPage;
+using ComPDFKitViewer.AnnotEvent;
+using ComPDFKitViewer.PdfViewer;
+using DryIoc;
+using Microsoft.Office.Interop.Word;
+using PDF_Office.DataConvert;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Regions;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Configuration;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Forms;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+using static Dropbox.Api.Files.SearchMatchType;
+using static System.Net.Mime.MediaTypeNames;
+using Border = System.Windows.Controls.Border;
+using ListBox = System.Windows.Controls.ListBox;
+using Task = System.Threading.Tasks.Task;
 
 namespace PDF_Office.ViewModels.BOTA
 {
+    public class AnnotationHandlerEventArgs : EventArgs
+    {
+        public string Content { get; set; }
+        public string MarkupContent { get; set; }
+        public string Author { get; set; }
+        public string CreateTime { get; set; }
+        public string UpdateTime { get; set; }
+        public AnnotArgsType EventType { get; set; }
+        public bool Locked { get; set; }
+        public bool ReadOnly { get; set; }
+        public ComPDFKitViewer.FormField FormField { get; set; }
+        public int PageIndex { get; set; }
+        public int AnnotIndex { get; set; }
+        public AnnotHandlerEventArgs AnnotHandlerEventArgs { get; set; }
+        public WriteableBitmap WriteableBitmap { get; set; }
+        public CPDFDocument Document { get; set; }
+    }
+
     public class AnnotationContentViewModel : BindableBase, INavigationAware
     {
-        private ObservableCollection<AnnotHandlerEventArgs> annotationListItems;
+        private Visibility isEmptyPanelVisibility = Visibility.Visible;
+
+        public Visibility IsEmptyPanelVisibility
+        {
+            get { return isEmptyPanelVisibility; }
+            set
+            {
+                SetProperty(ref isEmptyPanelVisibility, value);
+            }
+        }
+
+        private ObservableCollection<AnnotationHandlerEventArgs> annotationListItems;
+        public CPDFViewer PdfViewer { get; set; }
 
-        public ObservableCollection<AnnotHandlerEventArgs> AnnotationListItems
+        public ObservableCollection<AnnotationHandlerEventArgs> AnnotationListItems
         {
             get { return annotationListItems; }
             set
@@ -23,8 +78,40 @@ namespace PDF_Office.ViewModels.BOTA
             }
         }
 
+        public DelegateCommand<object> LoadedCommand { get; set; }
+        public DelegateCommand<object> ListBoxItemPreviewMouseLeftButtonDown { get; set; }
+
         public AnnotationContentViewModel()
         {
+            LoadedCommand = new DelegateCommand<object>(Loaded);
+            ListBoxItemPreviewMouseLeftButtonDown = new DelegateCommand<object>(ListBoxItem_PreviewMouseLeftButtonDown);
+        }
+
+        /// <summary>
+        /// listboxitem鼠标左键点击,显示分组的数据
+        /// </summary>
+        /// <param name="obj"></param>
+        private void ListBoxItem_PreviewMouseLeftButtonDown(object obj)
+        {
+            if (obj is ListBoxItem item)
+            {
+                var data = item.DataContext as AnnotationHandlerEventArgs;
+                if (data != null)
+                {
+                    PdfViewer.SelectAnnotation(data.PageIndex, data.AnnotIndex);
+                }
+            }
+        }
+
+        private void Loaded(object obj)
+        {
+            if (obj is CompositeCommandParameter composite)
+            {
+                if (composite.Parameter is ListBox listBox)
+                {
+                    SetGroupHeader(listBox);
+                }
+            }
         }
 
         public bool IsNavigationTarget(NavigationContext navigationContext)
@@ -38,6 +125,171 @@ namespace PDF_Office.ViewModels.BOTA
 
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
+            var pdfview = navigationContext.Parameters[ParameterNames.PDFViewer] as CPDFViewer;
+            if (pdfview != null)
+            {
+                PdfViewer = pdfview;
+                AnnotationListItems = new ObservableCollection<AnnotationHandlerEventArgs>();
+                AnnotationListItems = GetDocumentAnnotionList();
+                AnnotationListItems.CollectionChanged += AnnotationListItems_CollectionChanged;
+            }
+        }
+
+        private async void SetGroupHeader(ListBox listBox)
+        {
+            //按照PageIndex,分组 排序
+            ICollectionView iCollectionView = CollectionViewSource.GetDefaultView(AnnotationListItems);
+            CreateTimeToDate createTimeToDate = new CreateTimeToDate();
+            iCollectionView.GroupDescriptions.Add(new PropertyGroupDescription(nameof(AnnotationHandlerEventArgs.PageIndex)));
+            iCollectionView.SortDescriptions.Add(new SortDescription(nameof(AnnotationHandlerEventArgs.PageIndex), ListSortDirection.Ascending));
+            iCollectionView.SortDescriptions.Add(new SortDescription(nameof(AnnotationHandlerEventArgs.AnnotIndex), ListSortDirection.Ascending));
+            if (AnnotationListItems.Count > 0)
+            {
+                IsEmptyPanelVisibility = Visibility.Collapsed;
+                await Task.Delay(5);
+                //展开数据
+                ExpandGroupHeader(AnnotationListItems, listBox);
+            }
+            else
+            {
+                IsEmptyPanelVisibility = Visibility.Visible;
+            }
+        }
+
+        /// <summary>
+        /// 展开列表项
+        /// </summary>
+        /// <param name="annotationListItems"></param>
+        /// <param name="listBox"></param>
+        private void ExpandGroupHeader(ObservableCollection<AnnotationHandlerEventArgs> annotationListItems, ListBox listBox)
+        {
+            try
+            {
+                foreach (var item in annotationListItems)
+                {
+                    var groups = listBox.Items.Groups;
+                    for (int i = 0; i < groups.Count; i++)
+                    {
+                        var group = groups[i] as CollectionViewGroup;
+                        if (group.Items.Contains(item))
+                        {
+                            var scroller = GetScrollHost(listBox);
+                            var stackpanel = CommonHelper.FindVisualChild<StackPanel>(scroller);
+                            int count = VisualTreeHelper.GetChildrenCount(stackpanel);
+                            var groupItem = VisualTreeHelper.GetChild(stackpanel, i) as GroupItem;
+                            var g = CommonHelper.FindVisualChild<Expander>(groupItem);
+                            if (g != null)
+                            {
+                                g.IsExpanded = true;
+                            }
+                        }
+                    }
+                }
+            }
+            catch { }
+        }
+
+        private ScrollViewer GetScrollHost(ListBox listBox)
+        {
+            if (VisualTreeHelper.GetChildrenCount(listBox) > 0)
+            {
+                int s = VisualTreeHelper.GetChildrenCount(listBox);
+
+                Border border = VisualTreeHelper.GetChild(listBox, 0) as Border;
+                if (border != null)
+                {
+                    return VisualTreeHelper.GetChild(border, 0) as ScrollViewer;
+                }
+            }
+            return null;
+        }
+
+        private ObservableCollection<AnnotationHandlerEventArgs> GetDocumentAnnotionList()
+        {
+            ObservableCollection<AnnotationHandlerEventArgs> list = new ObservableCollection<AnnotationHandlerEventArgs>();
+            for (int i = 0; i < PdfViewer.Document.PageCount; i++)
+            {
+                var items = PdfViewer.GetAnnotCommentList(i, PdfViewer.Document);
+                foreach (var item in items)
+                {
+                    //原型图上,目前对波浪线的类型,在注释列表不显示
+                    if (item.EventType != AnnotArgsType.AnnotRedaction && item.EventType != AnnotArgsType.AnnotSquiggly)
+                    {
+                        AnnotationHandlerEventArgs args = new AnnotationHandlerEventArgs();
+                        if (item.EventType == AnnotArgsType.AnnotFreehand)
+                        {
+                            WriteableBitmap bitmap = GetAnnotImage(PdfViewer.Document, item.PageIndex, item.AnnotIndex);
+                            args.WriteableBitmap = bitmap;
+                        }
+                        args.AnnotHandlerEventArgs = item;
+                        args.PageIndex = item.PageIndex;
+                        args.AnnotIndex = item.AnnotIndex;
+                        args.EventType = item.EventType;
+                        args.CreateTime = item.CreateTime;
+                        args.UpdateTime = item.UpdateTime;
+                        args.Content = item.Content;
+                        args.MarkupContent = item.MarkupContent;
+                        args.Author = item.Author;
+                        args.Locked = item.Locked;
+                        args.ReadOnly = item.ReadOnly;
+                        args.FormField = item.FormField;
+                        args.Document = PdfViewer.Document;
+                        list.Add(args);
+                    }
+                }
+            }
+
+            return list;
+        }
+
+        public WriteableBitmap GetAnnotImage(CPDFDocument doc, int pageIndex, int annotIndex)
+        {
+            if (doc == null)
+            {
+                return null;
+            }
+            CPDFPage docPage = doc.PageAtIndex(pageIndex, false);
+            if (docPage == null)
+            {
+                return null;
+            }
+
+            List<CPDFAnnotation> docAnnots = docPage.GetAnnotations();
+            foreach (CPDFAnnotation annot in docAnnots)
+            {
+                if (docAnnots.IndexOf(annot) == annotIndex)
+                {
+                    CRect rawRect = annot.GetRect();
+                    double scaleDpi = 96.0 / 72.0;
+                    Rect paintRect = new Rect(rawRect.left * scaleDpi, rawRect.top * scaleDpi, rawRect.width() * scaleDpi, rawRect.height() * scaleDpi);
+                    int drawWidth = (int)paintRect.Width;
+                    int drawHeight = (int)paintRect.Height;
+                    byte[] bitmapArray = new byte[drawWidth * drawHeight * 4];
+
+                    annot.RenderAnnot(drawWidth, drawHeight, bitmapArray);
+                    WriteableBitmap wirteBitmap = new WriteableBitmap(drawWidth, drawHeight, 96, 96, PixelFormats.Bgra32, null);
+                    wirteBitmap.WritePixels(new Int32Rect(0, 0, drawWidth, drawHeight), bitmapArray, wirteBitmap.BackBufferStride, 0);
+                    return wirteBitmap;
+                }
+            }
+
+            return null;
+        }
+
+        private void AnnotationListItems_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
+        {
+            ObservableCollection<AnnotHandlerEventArgs> obsSender = sender as ObservableCollection<AnnotHandlerEventArgs>;
+            if (obsSender != null)
+            {
+                if (obsSender.Count < 1)
+                {
+                    IsEmptyPanelVisibility = Visibility.Visible;
+                }
+                else
+                {
+                    IsEmptyPanelVisibility = Visibility.Collapsed;
+                }
+            }
         }
     }
 }

+ 171 - 0
PDF Office/ViewModels/BOTA/AnnotationListItemViewModel.cs

@@ -0,0 +1,171 @@
+using ComPDFKitViewer.AnnotEvent;
+using PDF_Office.Helper;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+
+namespace PDF_Office.ViewModels.BOTA
+{
+    internal class AnnotationListItemViewModel : BindableBase
+    {
+        private Visibility pathTxtIcoVisibility = Visibility.Collapsed;
+
+        public Visibility PathTxtIcoVisibility
+        {
+            get { return pathTxtIcoVisibility; }
+            set
+            {
+                SetProperty(ref pathTxtIcoVisibility, value);
+            }
+        }
+
+        public DelegateCommand<object> GridIcoLoadedCommand { get; set; }
+
+        public AnnotationListItemViewModel()
+        {
+            GridIcoLoadedCommand = new DelegateCommand<object>(GridIcoLoaded);
+        }
+
+        private void GridIcoLoaded(object obj)
+        {
+            if (obj is CompositeCommandParameter commandParameter)
+            {
+                if (commandParameter.EventArgs is RoutedEventArgs eventArgs && commandParameter.Parameter is object[] parameters)
+                {
+                    if ((eventArgs.Source as Grid).DataContext is AnnotHandlerEventArgs data)
+                    {
+                        TextBlock txbContext = parameters[0] as TextBlock;
+                        TextBlock txbMarkUpContent = parameters[1] as TextBlock;
+                        Grid grid = parameters[2] as Grid;
+
+                        switch (data.EventType)
+                        {
+                            case AnnotArgsType.AnnotFreeText:
+                                PathTxtIcoVisibility = Visibility.Visible;
+                                txbMarkUpContent.Foreground = new SolidColorBrush((data as FreeTextAnnotArgs).FontColor);
+                                //txtContext.FontSize = (data as FreeTextAnnotArgs).FontSize;
+                                //txtContext.FontFamily = (data as FreeTextAnnotArgs).Family;
+                                if ((data as FreeTextAnnotArgs).HasBgColor)
+                                {
+                                    txbContext.Background = new SolidColorBrush((data as FreeTextAnnotArgs).BgColor);
+                                }
+                                break;
+
+                            //case AnnotArgsType.AnnotHighlight:
+                            //    highlight.Visibility = Visibility.Visible;
+                            //    highlightcolor.Fill = new SolidColorBrush((data as TextHighlightAnnotArgs).Color);
+                            //    txtContext.Text = data.Content;
+                            //    // txtContext.Background = new SolidColorBrush((data as TextHighlightAnnotArgs).HighlightColor);
+                            //    break;
+
+                            //case AnnotArgsType.AnnotFreehand:
+                            //    freehand.Visibility = Visibility.Visible;
+                            //    freehandcolor.Fill = new SolidColorBrush((data as FreehandAnnotArgs).InkColor);
+                            //    break;
+
+                            //case AnnotArgsType.AnnotLine:
+                            //    if ((data as LineAnnotArgs).HeadLineType >= (C_LINE_TYPE)1 || (data as LineAnnotArgs).TailLineType >= (C_LINE_TYPE)1)
+                            //    {
+                            //        arrow.Visibility = Visibility.Visible;
+                            //        arrow.Fill = new SolidColorBrush((data as LineAnnotArgs).LineColor);
+                            //    }
+                            //    else
+                            //    {
+                            //        line.Stroke = new SolidColorBrush((data as LineAnnotArgs).LineColor);
+                            //        line.Visibility = Visibility.Visible;
+                            //    }
+                            //    break;
+
+                            //case AnnotArgsType.AnnotSquiggly://波浪线
+                            //    AnnotSquiggly.Visibility = Visibility.Visible;
+                            //    AnnotSquigglycolor.Stroke = new SolidColorBrush((data as TextSquigglyAnnotArgs).Color);
+                            //    txtContext.Text = data.Content;
+                            //    TextDecoration mySquiggly = new TextDecoration();
+                            //    Pen myPen = new Pen();
+                            //    myPen.Brush = new SolidColorBrush((data as TextSquigglyAnnotArgs).Color);
+                            //    myPen.Brush.Opacity = 0.8;
+                            //    myPen.Thickness = 2;
+                            //    myPen.DashStyle = DashStyles.Dash;
+                            //    mySquiggly.Pen = myPen;
+                            //    mySquiggly.PenThicknessUnit = TextDecorationUnit.FontRecommended;
+
+                            //    TextDecorationCollection myCollection = new TextDecorationCollection();
+                            //    myCollection.Add(mySquiggly);
+                            //    //txtContext.TextDecorations = myCollection;
+                            //    break;
+
+                            //case AnnotArgsType.AnnotStamp:
+                            //    stamp.Visibility = Visibility.Visible;
+                            //    break;
+
+                            //case AnnotArgsType.AnnotStrikeout://删除线
+                            //    AnnotStrikeout.Visibility = Visibility.Visible;
+                            //    AnnotStrikeoutycolor.Stroke = new SolidColorBrush((data as TextStrikeoutAnnotArgs).Color);
+                            //    AnnotStrikeoutycolor.VerticalAlignment = VerticalAlignment.Center;
+                            //    txtContext.Text = data.Content;
+
+                            //    TextDecoration myStrikeout = new TextDecoration();
+                            //    Pen myPen2 = new Pen();
+                            //    myPen2.Brush = new SolidColorBrush((data as TextStrikeoutAnnotArgs).Color);
+                            //    myPen2.Brush.Opacity = 0.8;
+                            //    myPen2.Thickness = 1;
+                            //    myStrikeout.Pen = myPen2;
+                            //    myStrikeout.PenOffset = -3;
+                            //    myStrikeout.PenThicknessUnit = TextDecorationUnit.FontRecommended;
+                            //    TextDecorationCollection myCollection2 = new TextDecorationCollection();
+                            //    myCollection2.Add(myStrikeout);
+                            //    //因为波浪线无法实现 暂时只显示文字 不显示下划线,删除线等
+                            //    //txtContext.TextDecorations = myCollection2;
+                            //    break;
+
+                            //case AnnotArgsType.AnnotSticky://便签
+                            //    sticky.Visibility = Visibility;
+                            //    sticky.Fill = new SolidColorBrush((data as StickyAnnotArgs).Color);
+                            //    break;
+
+                            //case AnnotArgsType.AnnotUnderline:
+                            //    AnnotStrikeout.Visibility = Visibility.Visible;
+                            //    AnnotStrikeoutycolor.VerticalAlignment = VerticalAlignment.Bottom;
+                            //    txtContext.Text = data.Content;
+                            //    AnnotStrikeoutycolor.Stroke = new SolidColorBrush((data as TextUnderlineAnnotArgs).Color);
+                            //    TextDecoration myUnderline = new TextDecoration();
+                            //    Pen myPen1 = new Pen();
+                            //    myPen1.Brush = new SolidColorBrush((data as TextUnderlineAnnotArgs).Color);
+                            //    myPen1.Brush.Opacity = 0.8;
+                            //    myPen1.Thickness = 2;
+                            //    myUnderline.Pen = myPen1;
+                            //    myUnderline.PenThicknessUnit = TextDecorationUnit.FontRecommended;
+                            //    TextDecorationCollection myCollection1 = new TextDecorationCollection();
+                            //    myCollection1.Add(myUnderline);
+                            //    //txtContext.TextDecorations = myCollection1;
+                            //    break;
+
+                            //case AnnotArgsType.AnnotSquare:
+                            //    rect.Visibility = Visibility.Visible;
+                            //    rect.Stroke = new SolidColorBrush((data as SquareAnnotArgs).LineColor);
+                            //    rect.Fill = new SolidColorBrush((data as SquareAnnotArgs).BgColor);
+                            //    break;
+
+                            //case AnnotArgsType.AnnotCircle:
+                            //    circle.Visibility = Visibility.Visible;
+                            //    circle.Stroke = new SolidColorBrush((data as CircleAnnotArgs).LineColor);
+                            //    circle.Fill = new SolidColorBrush((data as CircleAnnotArgs).BgColor);
+                            //    break;
+
+                            default:
+                                break;
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 33 - 26
PDF Office/Views/BOTA/AnnotationContent.xaml

@@ -25,7 +25,7 @@
                 <ResourceDictionary Source="pack://application:,,,/Styles/ListViewStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/Styles/ExpanderStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
-            <DataTemplate x:Key="annotationListItem">
+            <DataTemplate x:Key="AnnotationListItemTemplate">
                 <local:AnnotationListItem />
             </DataTemplate>
             <SolidColorBrush x:Key="path.fill" Color="#273C62" />
@@ -34,7 +34,7 @@
             <convert:GroupHeaderConverter x:Key="GroupHeaderConverter" />
         </ResourceDictionary>
     </UserControl.Resources>
-    <Grid>
+    <Grid Background="#F2F2F2">
         <Grid.RowDefinitions>
             <RowDefinition Height="40" />
             <RowDefinition Height="*" />
@@ -93,12 +93,7 @@
                         <MenuItem Name="MenuCollapseAll" Header="全部折叠" />
                         <MenuItem Name="MenuSort">
                             <MenuItem.Header>
-                                <Grid>
-                                    <TextBlock
-                                        Name="MenuSortText"
-                                        Margin="26,0,0,0"
-                                        Text="排序" />
-                                </Grid>
+                                <TextBlock Name="MenuSortText" Text="排序" />
                             </MenuItem.Header>
                             <MenuItem Name="MenuPageSort" Padding="0,7,0,7">
                                 <MenuItem.Icon>
@@ -151,18 +146,18 @@
             </Grid.ColumnDefinitions>
             <ListBox
                 x:Name="AnnotationList"
-                Grid.ColumnSpan="2"
-                HorizontalAlignment="Stretch"
+                Grid.ColumnSpan="3"
                 HorizontalContentAlignment="Stretch"
+                Background="#F2F2F2"
                 BorderThickness="0"
+                ItemTemplate="{StaticResource AnnotationListItemTemplate}"
                 ItemsSource="{Binding AnnotationListItems}"
-                ItemTemplate="{StaticResource annotationListItem}"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                 SelectionMode="Extended">
                 <ListBox.ItemContainerStyle>
                     <Style TargetType="ListBoxItem">
                         <Setter Property="HorizontalContentAlignment" Value="Stretch" />
-                        <!--<EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown" />-->
+                        <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown" />
                         <Setter Property="Template" Value="{StaticResource AnnotationListItemStyle}" />
                         <Setter Property="Padding" Value="0" />
                         <Setter Property="Margin" Value="0,-1,0,-1" />
@@ -186,7 +181,7 @@
                                                     <Grid
                                                         Height="25"
                                                         HorizontalAlignment="Stretch"
-                                                        Background="#FFE2E3E6">
+                                                        VerticalAlignment="Stretch">
                                                         <Grid.RowDefinitions>
                                                             <RowDefinition />
                                                         </Grid.RowDefinitions>
@@ -195,21 +190,21 @@
                                                             Margin="10,0,0,0"
                                                             VerticalAlignment="Center"
                                                             FontFamily="Segoe UI Semibold"
-                                                            FontSize="{Binding Source={x:Static property:Settings.Default}, Path=AnnotateFontSize, Converter={StaticResource AnnotateFontSizeConverter}}"
+                                                            FontSize="14"
                                                             FontWeight="SemiBold"
                                                             Text="{Binding Name, Converter={StaticResource GroupHeaderConverter}}"
                                                             TextAlignment="Left" />
-                                                        <TextBlock
-                                                            Name="Count"
-                                                            Margin="0,0,8,0"
-                                                            HorizontalAlignment="Right"
-                                                            VerticalAlignment="Center"
-                                                            FontFamily="Segoe UI Semibold"
-                                                            FontSize="{Binding Source={x:Static property:Settings.Default}, Path=AnnotateFontSize, Converter={StaticResource AnnotateFontSizeConverter}}"
-                                                            FontWeight="SemiBold"
-                                                            Foreground="#FF666666"
-                                                            Text="{Binding ItemCount}"
-                                                            TextAlignment="Right" />
+                                                        <!--<TextBlock
+                                                        Name="Count"
+                                                        Margin="0,0,8,0"
+                                                        HorizontalAlignment="Right"
+                                                        VerticalAlignment="Center"
+                                                        FontFamily="Segoe UI Semibold"
+                                                        FontSize="{Binding Source={x:Static property:Settings.Default}, Path=AnnotateFontSize, Converter={StaticResource AnnotateFontSizeConverter}}"
+                                                        FontWeight="SemiBold"
+                                                        Foreground="#FF666666"
+                                                        Text="{Binding ItemCount}"
+                                                        TextAlignment="Right" />-->
                                                     </Grid>
                                                 </Expander.Header>
                                                 <ItemsPresenter />
@@ -229,8 +224,20 @@
                 Header="Delete" />
                 </ContextMenu>
                 </ListBox.ContextMenu>-->
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="Loaded">
+                        <helper:AdvancedInvokeCommandAction
+                            Command="{Binding DataContext.LoadedCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
+                            CommandParameter="{Binding ElementName=AnnotationList}"
+                            PassEventArgsToCommand="True" />
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
             </ListBox>
-            <StackPanel Name="EmptyPanel" VerticalAlignment="Center">
+            <StackPanel
+                Name="EmptyPanel"
+                Grid.ColumnSpan="2"
+                VerticalAlignment="Center"
+                Visibility="{Binding IsEmptyPanelVisibility}">
                 <Image
                     Width="140"
                     Height="140"

+ 9 - 1
PDF Office/Views/BOTA/AnnotationContent.xaml.cs

@@ -1,4 +1,5 @@
-using System;
+using PDF_Office.ViewModels.BOTA;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -20,9 +21,16 @@ namespace PDF_Office.Views.BOTA
     /// </summary>
     public partial class AnnotationContent : UserControl
     {
+        private AnnotationContentViewModel viewModel;
         public AnnotationContent()
         {
             InitializeComponent();
+            viewModel = this.DataContext as AnnotationContentViewModel;
+        }
+
+        private void ListBoxItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        {
+            viewModel.ListBoxItemPreviewMouseLeftButtonDown.Execute(sender);
         }
     }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 269 - 231
PDF Office/Views/BOTA/AnnotationListItem.xaml


+ 179 - 2
PDF Office/Views/BOTA/AnnotationListItem.xaml.cs

@@ -1,7 +1,17 @@
-using System;
+using ComPDFKit.Import;
+using ComPDFKit.PDFAnnotation;
+using ComPDFKit.PDFDocument;
+using ComPDFKit.PDFPage;
+using ComPDFKitViewer.AnnotEvent;
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.Helper;
+using PDF_Office.ViewModels.BOTA;
+using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Text;
+using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
@@ -20,9 +30,176 @@ namespace PDF_Office.Views.BOTA
     /// </summary>
     public partial class AnnotationListItem : UserControl
     {
+        //private Brush strikeoutColor = new SolidColorBrush(Color.FromRgb(0xFF, 0xBB, 0x00));
         public AnnotationListItem()
         {
             InitializeComponent();
         }
+
+        private void GridIco_Loaded(object sender, RoutedEventArgs e)
+        {
+            Grid grid = e.Source as Grid;
+            var args = grid.DataContext as AnnotationHandlerEventArgs;
+            AnnotHandlerEventArgs data = args.AnnotHandlerEventArgs;
+            if (data == null)
+            {
+                return;
+            }
+
+            switch (data.EventType)
+            {
+                case AnnotArgsType.AnnotFreeText:
+                    AnnotFreeText.Visibility = Visibility.Visible;
+                    TxbContext.Text = data.Content;
+                    TxbMarkUpContent.Foreground = new SolidColorBrush((data as FreeTextAnnotArgs).FontColor);
+
+                    break;
+
+                case AnnotArgsType.AnnotHighlight:
+                    BtnHighlight.Visibility = Visibility.Visible;
+                    HighlightPath.Fill = new SolidColorBrush((data as TextHighlightAnnotArgs).Color);
+                    //TxbContext.Text = data.Content;
+                    TxbContext.Background = new SolidColorBrush((data as TextHighlightAnnotArgs).Color);
+                    break;
+
+                case AnnotArgsType.AnnotFreehand:
+                    BtnFreeHand.Visibility = Visibility.Visible;
+                    FreehandPath.Fill = new SolidColorBrush((data as FreehandAnnotArgs).InkColor);
+                    ImageContext.Visibility = Visibility.Visible;
+
+                    TxbContext.Visibility = Visibility.Collapsed;
+
+                    //var encoder = new PngBitmapEncoder();
+                    //encoder.Frames.Add(BitmapFrame.Create((BitmapSource)ImageContext.Source));
+                    //FileStream file = new FileStream(String.Format($@"C:\Users\oyxh\Desktop\images\PDFText\{data.AnnotIndex}.png"), FileMode.Create);
+                    //encoder.Save(file);
+                    //file.Close();
+
+                    break;
+
+                case AnnotArgsType.AnnotSquiggly://波浪线
+                    AnnotSquiggly.Visibility = Visibility.Visible;
+                    AnnotSquigglycolor.Stroke = new SolidColorBrush((data as TextSquigglyAnnotArgs).Color);
+
+                    #region TO DO
+
+                    //TextDecoration mySquiggly = new TextDecoration();
+                    //Pen myPen = new Pen();
+                    //myPen.Brush = new SolidColorBrush((data as TextSquigglyAnnotArgs).Color);
+                    //myPen.Brush.Opacity = 0.8;
+                    //myPen.Thickness = 2;
+                    //myPen.DashStyle = DashStyles.Dash;
+                    //mySquiggly.Pen = myPen;
+                    //mySquiggly.PenThicknessUnit = TextDecorationUnit.FontRecommended;
+
+                    //TextDecorationCollection myCollection = new TextDecorationCollection();
+                    //myCollection.Add(mySquiggly);
+                    //TxbContext.TextDecorations = myCollection;
+
+                    #endregion TO DO
+
+                    break;
+
+                case AnnotArgsType.AnnotStamp:
+                    BtnAnnotStamp.Visibility = Visibility.Visible;
+                    break;
+
+                case AnnotArgsType.AnnotStrikeout://删除线
+                    AnnotStrikeout.Visibility = Visibility.Visible;
+
+                    AnnotStrikeoutycolor.Fill = new SolidColorBrush((data as TextStrikeoutAnnotArgs).Color);
+
+                    #region to do
+
+                    //TextDecoration myStrikeout = new TextDecoration();
+                    //Pen myPen2 = new Pen();
+                    //myPen2.Brush = new SolidColorBrush((data as TextStrikeoutAnnotArgs).Color);
+                    //myPen2.Brush.Opacity = 0.8;
+                    //myPen2.Thickness = 1;
+                    //myStrikeout.Pen = myPen2;
+                    //myStrikeout.PenOffset = -3;
+                    //myStrikeout.PenThicknessUnit = TextDecorationUnit.FontRecommended;
+                    //TextDecorationCollection myCollection2 = new TextDecorationCollection();
+                    //myCollection2.Add(myStrikeout);
+                    //因为波浪线无法实现 暂时只显示文字 不显示下划线,删除线等
+                    //TxbContext.TextDecorations = myCollection2;
+
+                    #endregion to do
+
+                    break;
+
+                case AnnotArgsType.AnnotSticky://便签
+                    BtnAnnotSticky.Visibility = Visibility;
+                    Pathsticky.Fill = new SolidColorBrush((data as StickyAnnotArgs).Color);
+                    break;
+
+                case AnnotArgsType.AnnotUnderline:
+                    BtnUnderLine.Visibility = Visibility.Visible;
+                    RectangleUnderline.Fill = new SolidColorBrush((data as TextUnderlineAnnotArgs).Color);
+
+                    #region TO DO
+
+                    //TextDecoration myUnderline = new TextDecoration();
+                    //Pen myPen1 = new Pen();
+                    //myPen1.Brush = new SolidColorBrush((data as TextUnderlineAnnotArgs).Color);
+                    //myPen1.Brush.Opacity = 0.8;
+                    //myPen1.Thickness = 2;
+                    //myUnderline.Pen = myPen1;
+                    //myUnderline.PenThicknessUnit = TextDecorationUnit.FontRecommended;
+                    //TextDecorationCollection myCollection1 = new TextDecorationCollection();
+                    //myCollection1.Add(myUnderline);
+                    //TxbContext.TextDecorations = myCollection1;
+
+                    #endregion TO DO
+
+                    break;
+
+                case AnnotArgsType.AnnotLine:
+                    if ((data as LineAnnotArgs).HeadLineType >= (C_LINE_TYPE)1 || (data as LineAnnotArgs).TailLineType >= (C_LINE_TYPE)1)
+                    {
+                        SharpArrowBtn.Visibility = Visibility.Visible;
+                        arrow.Fill = new SolidColorBrush((data as LineAnnotArgs).LineColor);
+                    }
+                    else
+                    {
+                        line.Fill = new SolidColorBrush((data as LineAnnotArgs).LineColor);
+                        SharpLineBtn.Visibility = Visibility.Visible;
+                    }
+                    ///对于形状注释等只有Note 的处理
+                    if (!string.IsNullOrEmpty(data.Content) && string.IsNullOrEmpty(data.MarkupContent))
+                    {
+                        TxbMarkUpContent.Text = Regex.Replace(data.Content, "[\r\n]", " ");
+                        TxbContext.Text = "";
+                    }
+                    break;
+
+                case AnnotArgsType.AnnotSquare:
+                    AnnotSquare.Visibility = Visibility.Visible;
+                    RectAnnotSquare.Stroke = new SolidColorBrush((data as SquareAnnotArgs).LineColor);
+                    RectAnnotSquare.Fill = new SolidColorBrush((data as SquareAnnotArgs).BgColor);
+                    ///对于形状注释等只有Note 的处理
+                    if (!string.IsNullOrEmpty(data.Content) && string.IsNullOrEmpty(data.MarkupContent))
+                    {
+                        TxbMarkUpContent.Text = Regex.Replace(data.Content, "[\r\n]", " ");
+                        TxbContext.Text = "";
+                    }
+                    break;
+
+                case AnnotArgsType.AnnotCircle:
+                    AnnotCircle.Visibility = Visibility.Visible;
+                    circle.Stroke = new SolidColorBrush((data as CircleAnnotArgs).LineColor);
+                    circle.Fill = new SolidColorBrush((data as CircleAnnotArgs).BgColor);
+                    ///对于形状注释等只有Note 的处理
+                    if (!string.IsNullOrEmpty(data.Content) && string.IsNullOrEmpty(data.MarkupContent))
+                    {
+                        TxbMarkUpContent.Text = Regex.Replace(data.Content, "[\r\n]", " ");
+                        TxbContext.Text = "";
+                    }
+                    break;
+
+                default:
+                    break;
+            }
+        }
     }
-}
+}

+ 290 - 96
PDF Office/Views/PropertyPanel/AnnotPanel/SharpsAnnotProperty.xaml

@@ -1,34 +1,36 @@
-<UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.SharpsAnnotProperty"
-             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:PDF_Office.Views.PropertyPanel.AnnotPanel"
-             xmlns:cus="clr-namespace:PDF_Office.CustomControl"
-             xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
-             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
-             xmlns:prism="http://prismlibrary.com/"             
-             prism:ViewModelLocator.AutoWireViewModel="True"
-             xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
-              xmlns:DashConvert="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
-             mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800">
+<UserControl
+    x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.SharpsAnnotProperty"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
+    xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
+    xmlns:DashConvert="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
+    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+    xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    mc:Ignorable="d">
     <UserControl.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="../../../Styles/SliderStyle.xaml"></ResourceDictionary>
-                <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml"/>
+                <ResourceDictionary Source="../../../Styles/SliderStyle.xaml" />
+                <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
-            <Convert:ColorToBrushConverter x:Key="ColorToBrushConvert"></Convert:ColorToBrushConverter>
-            <Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert"/>
-            <DashConvert:DashStyleConverter x:Key="DashStyleConverter"/>
+            <Convert:ColorToBrushConverter x:Key="ColorToBrushConvert" />
+            <Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert" />
+            <DashConvert:DashStyleConverter x:Key="DashStyleConverter" />
 
             <Style x:Key="line1Style" TargetType="{x:Type Line}">
                 <Setter Property="Visibility">
                     <Setter.Value>
                         <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
-                            <Binding ElementName="SharpRectBtn" Path="IsChecked"/>
-                            <Binding ElementName="SharpCircleBtn" Path="IsChecked"/>
+                            <Binding ElementName="SharpRectBtn" Path="IsChecked" />
+                            <Binding ElementName="SharpCircleBtn" Path="IsChecked" />
                         </MultiBinding>
                     </Setter.Value>
                 </Setter>
@@ -37,8 +39,8 @@
                 <Setter Property="Visibility">
                     <Setter.Value>
                         <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
-                            <Binding ElementName="SharpCircleBtn" Path="IsChecked"/>
-                            <Binding ElementName="SharpArrowBtn" Path="IsChecked"/>
+                            <Binding ElementName="SharpCircleBtn" Path="IsChecked" />
+                            <Binding ElementName="SharpArrowBtn" Path="IsChecked" />
                         </MultiBinding>
                     </Setter.Value>
                 </Setter>
@@ -47,8 +49,8 @@
                 <Setter Property="Visibility">
                     <Setter.Value>
                         <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
-                            <Binding ElementName="SharpArrowBtn" Path="IsChecked"/>
-                            <Binding ElementName="SharpLineBtn" Path="IsChecked"/>
+                            <Binding ElementName="SharpArrowBtn" Path="IsChecked" />
+                            <Binding ElementName="SharpLineBtn" Path="IsChecked" />
                         </MultiBinding>
                     </Setter.Value>
                 </Setter>
@@ -58,62 +60,169 @@
     </UserControl.Resources>
     <Grid Background="#F3F3F3">
         <StackPanel>
-            <TextBlock Name="AnnotTypeTitle" Text="{Binding AnnotTypeTitle}" FontFamily="SegoeUI" FontWeight="Bold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0" />
-            <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
+            <TextBlock
+                Name="AnnotTypeTitle"
+                Margin="10,8,0,0"
+                HorizontalAlignment="Left"
+                FontFamily="SegoeUI"
+                FontSize="18"
+                FontWeight="Bold"
+                LineHeight="24"
+                Text="{Binding AnnotTypeTitle}" />
+            <Border
+                Width="228"
+                Height="100"
+                Margin="0,8,0,0"
+                Background="White"
+                BorderBrush="#DDDDDD"
+                BorderThickness="1"
+                CornerRadius="2">
                 <Grid>
-                    <Path Name="SharpPath" Opacity="{Binding FillOpacity}" StrokeThickness="{Binding LineWidth}"  Data="{Binding DataPath}"
+                    <Path
+                        Name="SharpPath"
+                        Width="36"
+                        Height="36"
+                        HorizontalAlignment="Center"
+                        VerticalAlignment="Center"
+                        Data="{Binding DataPath}"
+                        Fill="{Binding FillColor}"
+                        Opacity="{Binding FillOpacity}"
                         Stroke="{Binding SelectColor}"
-                        Fill="{Binding FillColor}" StrokeStartLineCap="Flat"
-                         StrokeDashArray="{Binding Dash,Converter={StaticResource DashStyleConverter}}"
-                        Width="36" Height="36" HorizontalAlignment="Center" VerticalAlignment="Center">
-                        <!--,Converter={StaticResource ColorToBrushConvert}-->
+                        StrokeDashArray="{Binding Dash, Converter={StaticResource DashStyleConverter}}"
+                        StrokeStartLineCap="Flat"
+                        StrokeThickness="{Binding LineWidth}">
+                        <!--  ,Converter={StaticResource ColorToBrushConvert}  -->
                     </Path>
                 </Grid>
             </Border>
 
 
-            <Border Width="162" Height="32" Margin="0,12,0,0" BorderThickness="1" BorderBrush="#FFE2E3E6">
+            <Border
+                Width="162"
+                Height="32"
+                Margin="0,12,0,0"
+                BorderBrush="#FFE2E3E6"
+                BorderThickness="1">
                 <Grid Name="ToolGrid">
                     <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="40.5"></ColumnDefinition>
-                        <ColumnDefinition Width="40.5"></ColumnDefinition>
-                        <ColumnDefinition Width="40.5"></ColumnDefinition>
-                        <ColumnDefinition Width="40.5"></ColumnDefinition>
+                        <ColumnDefinition Width="40.5" />
+                        <ColumnDefinition Width="40.5" />
+                        <ColumnDefinition Width="40.5" />
+                        <ColumnDefinition Width="40.5" />
                     </Grid.ColumnDefinitions>
 
 
-                    <ToggleButton Name="SharpRectBtn" Tag="Rect" Width="40.5" Background="Transparent" BorderThickness="0" Click="SharpsBtn_Click" 
-                                  Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpRectBtn,Path=Tag}">
-                        <Rectangle HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" Stroke="#273C62"></Rectangle>
+                    <ToggleButton
+                        Name="SharpRectBtn"
+                        Width="40.5"
+                        Background="Transparent"
+                        BorderThickness="0"
+                        Click="SharpsBtn_Click"
+                        Command="{Binding SharpsTypeCommand}"
+                        CommandParameter="{Binding ElementName=SharpRectBtn, Path=Tag}"
+                        Tag="Rect">
+                        <Rectangle
+                            Width="16"
+                            Height="16"
+                            HorizontalAlignment="Center"
+                            VerticalAlignment="Center"
+                            Stroke="#273C62" />
                     </ToggleButton>
 
-                    <Line Name="line1" HorizontalAlignment="Left"  VerticalAlignment="Center" Grid.Column="1" X1="0" Y1="0" X2="0" Y2="16" StrokeThickness="1" Stroke="#33000000">
+                    <Line
+                        Name="line1"
+                        Grid.Column="1"
+                        HorizontalAlignment="Left"
+                        VerticalAlignment="Center"
+                        Stroke="#33000000"
+                        StrokeThickness="1"
+                        X1="0"
+                        X2="0"
+                        Y1="0"
+                        Y2="16" />
 
-                    </Line>
-
-                    <ToggleButton Name="SharpCircleBtn" Width="40.5" Tag="Circle" Grid.Column="1" Background="Transparent"  BorderThickness="0"  Margin="0,0,0,0" Click="SharpsBtn_Click"
-                                  Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpCircleBtn,Path=Tag}"
-                                  >
-                        <Ellipse Width="16" Height="16" Stroke="#273C62" HorizontalAlignment="Center" VerticalAlignment="Center"  ></Ellipse>
+                    <ToggleButton
+                        Name="SharpCircleBtn"
+                        Grid.Column="1"
+                        Width="40.5"
+                        Margin="0,0,0,0"
+                        Background="Transparent"
+                        BorderThickness="0"
+                        Click="SharpsBtn_Click"
+                        Command="{Binding SharpsTypeCommand}"
+                        CommandParameter="{Binding ElementName=SharpCircleBtn, Path=Tag}"
+                        Tag="Circle">
+                        <Ellipse
+                            Width="16"
+                            Height="16"
+                            HorizontalAlignment="Center"
+                            VerticalAlignment="Center"
+                            Stroke="#273C62" />
                     </ToggleButton>
 
 
-                    <Line Name="line2" HorizontalAlignment="Left" Style="{StaticResource line2Style}" VerticalAlignment="Center" Grid.Column="2" X1="0" Y1="0" X2="0" Y2="16" StrokeThickness="1" Stroke="#33000000"></Line>
-                    <ToggleButton Name="SharpArrowBtn" Width="40.5" Tag="Arrow" Grid.Column="2" Background="Transparent"  BorderThickness="0" Click="SharpsBtn_Click"
-                                    Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpArrowBtn,Path=Tag}"
-                                  >
-                        <Path HorizontalAlignment="Center" VerticalAlignment="Center"  Fill="#273C62" Width="16" Height="16">
+                    <Line
+                        Name="line2"
+                        Grid.Column="2"
+                        HorizontalAlignment="Left"
+                        VerticalAlignment="Center"
+                        Stroke="#33000000"
+                        StrokeThickness="1"
+                        Style="{StaticResource line2Style}"
+                        X1="0"
+                        X2="0"
+                        Y1="0"
+                        Y2="16" />
+                    <ToggleButton
+                        Name="SharpArrowBtn"
+                        Grid.Column="2"
+                        Width="40.5"
+                        Background="Transparent"
+                        BorderThickness="0"
+                        Click="SharpsBtn_Click"
+                        Command="{Binding SharpsTypeCommand}"
+                        CommandParameter="{Binding ElementName=SharpArrowBtn, Path=Tag}"
+                        Tag="Arrow">
+                        <Path
+                            Width="16"
+                            Height="16"
+                            HorizontalAlignment="Center"
+                            VerticalAlignment="Center"
+                            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>
                     </ToggleButton>
 
-                    <Line x:Name="line3" HorizontalAlignment="Left" Style="{StaticResource line3Style}" VerticalAlignment="Center" Grid.Column="3" X1="0" Y1="0" X2="0" Y2="16" StrokeThickness="1" Stroke="#33000000"></Line>
-                    <ToggleButton Name="SharpLineBtn" Width="40.5" Tag="Line" Grid.Column="3" Background="Transparent"  BorderThickness="0" Click="SharpsBtn_Click"
-                                   Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpLineBtn,Path=Tag}"
-                                  >
-                        <Polygon Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="#273C62">
+                    <Line
+                        x:Name="line3"
+                        Grid.Column="3"
+                        HorizontalAlignment="Left"
+                        VerticalAlignment="Center"
+                        Stroke="#33000000"
+                        StrokeThickness="1"
+                        Style="{StaticResource line3Style}"
+                        X1="0"
+                        X2="0"
+                        Y1="0"
+                        Y2="16" />
+                    <ToggleButton
+                        Name="SharpLineBtn"
+                        Grid.Column="3"
+                        Width="40.5"
+                        Background="Transparent"
+                        BorderThickness="0"
+                        Click="SharpsBtn_Click"
+                        Command="{Binding SharpsTypeCommand}"
+                        CommandParameter="{Binding ElementName=SharpLineBtn, Path=Tag}"
+                        Tag="Line">
+                        <Polygon
+                            Width="16"
+                            Height="16"
+                            HorizontalAlignment="Center"
+                            VerticalAlignment="Center"
+                            Fill="#273C62">
                             <Polygon.Points>
                                 13.1757359 1.97573593 14.0242641 2.82426407 2.82426407 14.0242641 1.97573593 13.1757359
                             </Polygon.Points>
@@ -124,22 +233,22 @@
             </Border>
 
 
-            <Grid Margin="0,18,0,0" x:Name="GridFill">
+            <Grid x:Name="GridFill" Margin="0,18,0,0">
                 <Grid.RowDefinitions>
-                    <RowDefinition Height="auto"/>
-                    <RowDefinition/>
+                    <RowDefinition Height="auto" />
+                    <RowDefinition />
                 </Grid.RowDefinitions>
-                <CompositeControl:SlidContent x:Name="layerFill" HorizontalAlignment="Right"/>
-                <CompositeControl:ColorContent Grid.Row="1" x:Name="cusFillColor"/>
+                <CompositeControl:SlidContent x:Name="layerFill" HorizontalAlignment="Right" />
+                <CompositeControl:ColorContent x:Name="cusFillColor" Grid.Row="1" />
             </Grid>
 
             <Grid Margin="0,18,0,0">
                 <Grid.RowDefinitions>
-                    <RowDefinition Height="auto"/>
-                    <RowDefinition/>
+                    <RowDefinition Height="auto" />
+                    <RowDefinition />
                 </Grid.RowDefinitions>
-                <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right"/>
-                <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor"/>
+                <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right" />
+                <CompositeControl:ColorContent x:Name="cusColor" Grid.Row="1" />
 
             </Grid>
 
@@ -147,59 +256,144 @@
 
             <Grid>
                 <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="*"></ColumnDefinition>
-                    <ColumnDefinition Width="auto"></ColumnDefinition>
+                    <ColumnDefinition Width="*" />
+                    <ColumnDefinition Width="auto" />
                 </Grid.ColumnDefinitions>
-                <Slider Name="BorderSlider" VerticalAlignment="Center" Value="{Binding LineWidth}" Margin="12,0,4,0"  Minimum="1" Maximum="12" IsSelectionRangeEnabled="True" IsMoveToPointEnabled="True"
-                    Style="{StaticResource RoundThumbSlider}"  TickFrequency="1" IsSnapToTickEnabled="True" >
+                <Slider
+                    Name="BorderSlider"
+                    Margin="12,0,4,0"
+                    VerticalAlignment="Center"
+                    IsMoveToPointEnabled="True"
+                    IsSelectionRangeEnabled="True"
+                    IsSnapToTickEnabled="True"
+                    Maximum="12"
+                    Minimum="1"
+                    Style="{StaticResource RoundThumbSlider}"
+                    TickFrequency="1"
+                    Value="{Binding LineWidth}">
                     <Slider.Resources>
                         <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#477EDE" />
                         <SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkDarkBrushKey}" Color="#E2E3E6" />
                     </Slider.Resources>
                 </Slider>
 
-                <Border Grid.Column="1" BorderBrush="#E2E3E6"  Width="80" Height="32" Margin="0,0,12,0"  BorderThickness="0">
+                <Border
+                    Grid.Column="1"
+                    Width="80"
+                    Height="32"
+                    Margin="0,0,12,0"
+                    BorderBrush="#E2E3E6"
+                    BorderThickness="0">
                     <Grid>
-                        <ComboBox Name="BorderDropBox" BorderThickness="1" Padding="10 10 0 0" Background="Transparent" BorderBrush="#FFE2E3E6" >
+                        <ComboBox
+                            Name="BorderDropBox"
+                            Padding="10,10,0,0"
+                            Background="Transparent"
+                            BorderBrush="#FFE2E3E6"
+                            BorderThickness="1">
                             <ComboBox.ItemContainerStyle>
                                 <Style TargetType="{x:Type ComboBoxItem}">
-                                    <Setter Property="Padding" Value="10 0 0 0"/>
+                                    <Setter Property="Padding" Value="10,0,0,0" />
                                 </Style>
                             </ComboBox.ItemContainerStyle>
-                            <ComboBoxItem Content="1" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
-                                
-                            </ComboBoxItem>
-                            <ComboBoxItem Content="3" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                            <ComboBoxItem Content="6" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                            <ComboBoxItem Content="9" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                            <ComboBoxItem Content="12" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                            <ComboBoxItem
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Content="1"
+                                Template="{StaticResource comboxitem}" />
+                            <ComboBoxItem
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Content="3"
+                                Template="{StaticResource comboxitem}" />
+                            <ComboBoxItem
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Content="6"
+                                Template="{StaticResource comboxitem}" />
+                            <ComboBoxItem
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Content="9"
+                                Template="{StaticResource comboxitem}" />
+                            <ComboBoxItem
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Content="12"
+                                Template="{StaticResource comboxitem}" />
                             <i:Interaction.Triggers>
                                 <i:EventTrigger EventName="SelectionChanged">
-                                    <i:InvokeCommandAction Command="{Binding ThicknessChangedCommand}" CommandParameter="{Binding ElementName=BorderDropBox,Path=SelectedItem}"/>
+                                    <i:InvokeCommandAction Command="{Binding ThicknessChangedCommand}" CommandParameter="{Binding ElementName=BorderDropBox, Path=SelectedItem}" />
                                 </i:EventTrigger>
                             </i:Interaction.Triggers>
                         </ComboBox>
-                        <TextBox FontFamily="Segoe UI" FontSize="14" Background="White" Height="20" Margin="10,0,35,0" IsReadOnly="True"
-                             BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" Text="{Binding ElementName=BorderSlider,Path=Value}">
-                        </TextBox>
+                        <TextBox
+                            Height="20"
+                            Margin="10,0,35,0"
+                            VerticalAlignment="Center"
+                            Background="White"
+                            BorderThickness="0"
+                            FontFamily="Segoe UI"
+                            FontSize="14"
+                            IsReadOnly="True"
+                            Text="{Binding ElementName=BorderSlider, Path=Value}"
+                            TextAlignment="Left" />
                     </Grid>
                 </Border>
             </Grid>
 
 
-            <StackPanel x:Name="PnlLineStyle" Orientation="Horizontal" Margin="0,20,0,0">
-                <cus:CustomIconToggleBtn x:Name="BtnSolidLine" Tag="Solid" Width="110" Height="32" Click="BtnLineStyle_Click"
-                                         Command="{Binding LineStyleCommand}" CommandParameter="{Binding ElementName=BtnSolidLine,Path=Tag}"
-                                              Style="{StaticResource ToggleBtnViewModeStyle}">
-                    <Border BorderBrush="Black" BorderThickness="1" Padding="8,0,8,0" Width="108" Height="30">
-                        <Line X1="10" Y1="15" X2="260" Y2="15" Stroke="Black" StrokeThickness="2" />
+            <StackPanel
+                x:Name="PnlLineStyle"
+                Margin="0,20,0,0"
+                Orientation="Horizontal">
+                <cus:CustomIconToggleBtn
+                    x:Name="BtnSolidLine"
+                    Width="110"
+                    Height="32"
+                    Click="BtnLineStyle_Click"
+                    Command="{Binding LineStyleCommand}"
+                    CommandParameter="{Binding ElementName=BtnSolidLine, Path=Tag}"
+                    Style="{StaticResource ToggleBtnViewModeStyle}"
+                    Tag="Solid">
+                    <Border
+                        Width="108"
+                        Height="30"
+                        Padding="8,0,8,0"
+                        BorderBrush="Black"
+                        BorderThickness="1">
+                        <Line
+                            Stroke="Black"
+                            StrokeThickness="2"
+                            X1="10"
+                            X2="260"
+                            Y1="15"
+                            Y2="15" />
                     </Border>
                 </cus:CustomIconToggleBtn>
-                <cus:CustomIconToggleBtn x:Name="BtnDottedLine" Tag="Dotted" Width="110" Height="32"
-                                         Command="{Binding LineStyleCommand}" CommandParameter="{Binding ElementName=BtnDottedLine,Path=Tag}"
-                                              Style="{StaticResource ToggleBtnViewModeStyle}" Click="BtnLineStyle_Click">
-                    <Border BorderBrush="Black" BorderThickness="1" Padding="8,0,8,0" Width="108" Height="30" >
-                        <Line X1="10" Y1="15" X2="260" Y2="15" Stroke="Black" StrokeThickness="2" StrokeDashArray="2"/>
+                <cus:CustomIconToggleBtn
+                    x:Name="BtnDottedLine"
+                    Width="110"
+                    Height="32"
+                    Click="BtnLineStyle_Click"
+                    Command="{Binding LineStyleCommand}"
+                    CommandParameter="{Binding ElementName=BtnDottedLine, Path=Tag}"
+                    Style="{StaticResource ToggleBtnViewModeStyle}"
+                    Tag="Dotted">
+                    <Border
+                        Width="108"
+                        Height="30"
+                        Padding="8,0,8,0"
+                        BorderBrush="Black"
+                        BorderThickness="1">
+                        <Line
+                            Stroke="Black"
+                            StrokeDashArray="2"
+                            StrokeThickness="2"
+                            X1="10"
+                            X2="260"
+                            Y1="15"
+                            Y2="15" />
                     </Border>
                 </cus:CustomIconToggleBtn>
             </StackPanel>