Browse Source

Merge branch 'practice2' into dev

# Conflicts:
#	PDF Office/App.xaml
#	PDF Office/App.xaml.cs
#	PDF Office/CustomControl/CompositeControl/ColorContent.xaml
#	PDF Office/PDF Office.csproj
#	PDF Office/Styles/ButtonStyle.xaml
#	PDF Office/Styles/CustomBtnStyle.xaml
OYXH\oyxh 2 years ago
parent
commit
8fb4f3254b
65 changed files with 5354 additions and 898 deletions
  1. 6 4
      PDF Office/App.xaml.cs
  2. 66 44
      PDF Office/CustomControl/CompositeControl/ColorContent.xaml
  3. 26 15
      PDF Office/CustomControl/CompositeControl/SlidContent.xaml
  4. 31 0
      PDF Office/DataConvert/AnnotateFontSizeConverter.cs
  5. 38 0
      PDF Office/DataConvert/BoolToTextWrapConvert.cs
  6. 38 0
      PDF Office/DataConvert/CreateTimeToDate.cs
  7. 48 0
      PDF Office/DataConvert/GroupHeaderConverter.cs
  8. 27 0
      PDF Office/DataConvert/IntToBooleanConvert.cs
  9. 57 0
      PDF Office/DataConvert/StringToDateConvert.cs
  10. 29 0
      PDF Office/Model/BOTA/AnnotationHandlerEventArgs.cs
  11. 14 1
      PDF Office/Model/DialogNames.cs
  12. 12 2
      PDF Office/Model/ParameterNames.cs
  13. 16 0
      PDF Office/Model/RegionNames.cs
  14. 65 0
      PDF Office/PDF Office.csproj
  15. 14 1
      PDF Office/Properties/Settings.Designer.cs
  16. BIN
      PDF Office/Resources/BOTA/Annotation/Arrow.png
  17. BIN
      PDF Office/Resources/BOTA/Annotation/Bookmark.png
  18. BIN
      PDF Office/Resources/BOTA/Annotation/Circle.png
  19. BIN
      PDF Office/Resources/BOTA/Annotation/Freehande.png
  20. BIN
      PDF Office/Resources/BOTA/Annotation/Freehande2.png
  21. BIN
      PDF Office/Resources/BOTA/Annotation/Hand.png
  22. BIN
      PDF Office/Resources/BOTA/Annotation/Highlight.png
  23. BIN
      PDF Office/Resources/BOTA/Annotation/Hyperlink.png
  24. BIN
      PDF Office/Resources/BOTA/Annotation/Image.png
  25. BIN
      PDF Office/Resources/BOTA/Annotation/Line.png
  26. BIN
      PDF Office/Resources/BOTA/Annotation/Note.png
  27. BIN
      PDF Office/Resources/BOTA/Annotation/Point.png
  28. BIN
      PDF Office/Resources/BOTA/Annotation/Rectangle.png
  29. BIN
      PDF Office/Resources/BOTA/Annotation/Selecttool.png
  30. BIN
      PDF Office/Resources/BOTA/Annotation/Stamp.png
  31. BIN
      PDF Office/Resources/BOTA/Annotation/Textbox.png
  32. BIN
      PDF Office/Resources/BOTA/Annotation/wavyline2.png
  33. BIN
      PDF Office/Resources/BOTA/empty_annotation.png
  34. 34 5
      PDF Office/Styles/ButtonStyle.xaml
  35. 47 0
      PDF Office/Styles/ComboxStyle.xaml
  36. 110 9
      PDF Office/Styles/CustomBtnStyle.xaml
  37. 284 34
      PDF Office/Styles/ExpanderStyle.xaml
  38. 56 3
      PDF Office/Styles/ListViewStyle.xaml
  39. 4 4
      PDF Office/Styles/PathButtonStyle.xaml
  40. 302 423
      PDF Office/Styles/SliderStyle.xaml
  41. 483 0
      PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs
  42. 171 0
      PDF Office/ViewModels/BOTA/AnnotationListItemViewModel.cs
  43. 4 3
      PDF Office/ViewModels/BOTA/BOTAContentViewModel.cs
  44. 5 0
      PDF Office/ViewModels/BOTA/BookmarkContentViewModel.cs
  45. 197 0
      PDF Office/ViewModels/Dialog/BOTA/AddAnnotationDialogViewModel.cs
  46. 437 0
      PDF Office/ViewModels/Dialog/BOTA/ScreenAnnotationDialogViewModel.cs
  47. 1 0
      PDF Office/ViewModels/PropertyPanel/ViewModular/ReadModeContentViewModel.cs
  48. 213 0
      PDF Office/ViewModels/PropertyPanel/ViewModular/ReadViewContentViewModel.cs
  49. 69 2
      PDF Office/ViewModels/ViewContentViewModel.cs
  50. 301 0
      PDF Office/Views/BOTA/AnnotationContent.xaml
  51. 239 0
      PDF Office/Views/BOTA/AnnotationContent.xaml.cs
  52. 351 0
      PDF Office/Views/BOTA/AnnotationListItem.xaml
  53. 208 0
      PDF Office/Views/BOTA/AnnotationListItem.xaml.cs
  54. 27 15
      PDF Office/Views/BOTA/BookmarkContent.xaml
  55. 307 0
      PDF Office/Views/Dialog/BOTA/AddAnnotationDialog.xaml
  56. 28 0
      PDF Office/Views/Dialog/BOTA/AddAnnotationDialog.xaml.cs
  57. 448 0
      PDF Office/Views/Dialog/BOTA/ScreenAnnotationDialog.xaml
  58. 28 0
      PDF Office/Views/Dialog/BOTA/ScreenAnnotationDialog.xaml.cs
  59. 93 107
      PDF Office/Views/HomePanel/RecentFiles/RecentFilesContent.xaml
  60. 290 96
      PDF Office/Views/PropertyPanel/AnnotPanel/SharpsAnnotProperty.xaml
  61. 53 0
      PDF Office/Views/PropertyPanel/ViewModular/ReadViewContent.xaml
  62. 63 0
      PDF Office/Views/PropertyPanel/ViewModular/ReadViewContent.xaml.cs
  63. 3 3
      PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml.cs
  64. 4 34
      PDF Office/Views/ViewContent.xaml
  65. 7 93
      PDF Office/Views/ViewContent.xaml.cs

+ 6 - 4
PDF Office/App.xaml.cs

@@ -38,9 +38,11 @@ using PDF_Office.Views.FillAndSign.PropertyPanel;
 using PDF_Office.Views.PropertyPanel.ViewModular;
 using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using PDF_Office.Views.Dialog.ConverterDialogs;
+
 using PDF_Office.Helper;
+
 using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter;
-using PDF_Office.Views.EditTools.Watermark; 
+using PDF_Office.Views.EditTools.Watermark;
 using PDF_Office.Views.EditTools.Background;
 using PDF_Office.Views.EditTools.Bates;
 using PDF_Office.Views.EditTools.HeaderFooter;
@@ -89,7 +91,6 @@ namespace PDF_Office
 
             if (Settings.Default.QuickPDFToolsList == null)
                 Settings.Default.QuickPDFToolsList = new PDFSettings.QuickPDFToolsList();
-
         }
 
         protected override void OnStartup(StartupEventArgs e)
@@ -155,7 +156,8 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<SplitScreenContent>();
             containerRegistry.RegisterForNavigation<ThemesContent>();
             containerRegistry.RegisterForNavigation<ReadModeContent>();
-
+            containerRegistry.RegisterForNavigation<AnnotationContent>();
+            containerRegistry.RegisterForNavigation<ReadViewContent>();
 
             containerRegistry.RegisterForNavigation<HomePagePrinterModSizeContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModPosterContent>();
@@ -244,7 +246,7 @@ namespace PDF_Office
             containerRegistry.RegisterDialog<ConverterRTFDialog>(DialogNames.ConverterRTFDialog);
             containerRegistry.RegisterDialog<ConverterExcelDialog>(DialogNames.ConverterExcelDialog);
             containerRegistry.RegisterDialog<ConverterProgressBarDialog>(DialogNames.ConverterProgressBarDialog);
-
+            containerRegistry.RegisterDialog<ScreenAnnotationDialog>(DialogNames.ScreenAnnotationDialog);
 
             #endregion 注册弹窗
         }

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

@@ -1,72 +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" StrokeThickness="1"
-                         PreviewMouseLeftButtonDown="ElcustomColor_PreviewMouseLeftButtonDown">
-                    <Ellipse.Stroke>
-                        <SolidColorBrush Color="#000000" Opacity="0.1"/>
-                    </Ellipse.Stroke>
-                </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>

File diff suppressed because it is too large
+ 26 - 15
PDF Office/CustomControl/CompositeControl/SlidContent.xaml


+ 31 - 0
PDF Office/DataConvert/AnnotateFontSizeConverter.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class AnnotateFontSizeConverter : IValueConverter
+    {
+        //用于注释列表的字体   作者和日期的日期比正文日期小两个规格
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if ((double)value <= 0)
+            {
+                return null;
+            }
+            else
+            {
+                return (double)value - 2;
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

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

@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using System.Windows;
+
+namespace PDF_Office.DataConvert
+{
+    public class BoolToTextWrapConvert : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null)
+            {
+                return TextWrapping.NoWrap;
+            }
+            else
+            {
+                if ((bool)value)
+                {
+                    return TextWrapping.Wrap;
+                }
+                else
+                {
+                    return TextWrapping.NoWrap;
+                }
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 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();
+        }
+    }
+}

+ 48 - 0
PDF Office/DataConvert/GroupHeaderConverter.cs

@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class GroupHeaderConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null || string.IsNullOrEmpty(value.ToString())) return null;
+            if (value.ToString().Length == 8)//日期
+            {
+                string dateStr = value.ToString();
+                string text = dateStr.Substring(0, 4) + "-" + dateStr.Substring(4, 2) + "-" + dateStr.Substring(6, 2);
+                return text;
+            }
+            else//页码
+            {
+                try
+                {
+                    string page = "Page ";
+                    if ((int)value == -1)
+                    {
+                        return null;
+                    }
+                    else
+                    {
+                        return page + ((int)value + 1).ToString();
+                    }
+                }
+                catch (Exception ex)
+                {
+                    return null;
+                }
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 27 - 0
PDF Office/DataConvert/IntToBooleanConvert.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class IntToBooleanConvert : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value is int && ((int)value) > 0)
+            {
+                return true;
+            }
+            return false;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 57 - 0
PDF Office/DataConvert/StringToDateConvert.cs

@@ -0,0 +1,57 @@
+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
+{
+    /// <summary>
+    /// 用于注释 书签等的时间转换
+    /// </summary>
+    public class StringToDateConvert : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            string date = "";
+            if (string.IsNullOrEmpty((string)value) || !Regex.IsMatch(value.ToString(), "(?<=D\\:)[0-9]+(?=[\\+\\-])"))
+            {
+                date = System.DateTime.Now.ToString("HH:mm");
+            }
+            else if (Regex.IsMatch(value.ToString(), "(?<=D\\:)[0-9]+(?=[\\+\\-])"))
+            {
+                string dateStr = Regex.Match(value.ToString(), "(?<=D\\:)[0-9]+(?=[\\+\\-])").Value;
+
+                #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;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            return null;
+        }
+    }
+}

+ 29 - 0
PDF Office/Model/BOTA/AnnotationHandlerEventArgs.cs

@@ -0,0 +1,29 @@
+using ComPDFKit.PDFDocument;
+using ComPDFKitViewer.AnnotEvent;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Media.Imaging;
+
+namespace PDF_Office.Model.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; }
+    }
+}

+ 14 - 1
PDF Office/Model/DialogNames.cs

@@ -95,10 +95,21 @@ namespace PDF_Office.Model
         ///BOTA-书签-添加书签弹窗
         /// </summary>
         public static string AddBookmarkDialog = "AddBookmarkDialog";
+
+        /// <summary>
+        /// BOTA-注释列表-添加笔记
+        /// </summary>
+        public static string AddAnnotationDialog = "AddAnnotationDialog";
+
+        /// <summary>
+        /// BOTA-注释列表-筛选注释
+        /// </summary>
+        public static string ScreenAnnotationDialog = "ScreenAnnotationDialog";
+
         ///<summary>
         ///主页工具-PDF批量工具
         /// </summary>
-        public static string HomePageBatchProcessingDialog ="HomePageBatchProcessingDialog";
+        public static string HomePageBatchProcessingDialog = "HomePageBatchProcessingDialog";
 
         /// <summary>
         /// 注释-图章-动态图章设置弹窗
@@ -114,6 +125,7 @@ namespace PDF_Office.Model
         ///转档-CSVD,PPT,Text,Word,HTML,Img,RTF,Excel弹窗
         /// </summary>
         public static string ConverterCSVDialog = "ConverterCSVDialog";
+
         public static string ConverterPPTDialog = "ConverterPPTDialog";
         public static string ConverterTextDialog = "ConverterTextDialog";
         public static string ConverterWordDialog = "ConverterWordDialog";
@@ -121,6 +133,7 @@ namespace PDF_Office.Model
         public static string ConverterImgDialog = "ConverterImgDialog";
         public static string ConverterRTFDialog = "ConverterRTFDialog";
         public static string ConverterExcelDialog = "ConverterExcelDialog";
+
         ///<summary>
         ///转档进度条弹窗
         /// </summary>

+ 12 - 2
PDF Office/Model/ParameterNames.cs

@@ -12,12 +12,14 @@ namespace PDF_Office.Model
     public static class ParameterNames
     {
         #region ViewModelName
+
         public static string MainViewModel = "MainViewModel";
 
         public static string ViewContentViewModel = "ViewContentViewModel";
 
-        public static string PropertyPanelContentViewModel = "PropertyPanelContentViewModel";
-        #endregion
+        public static string PropertyPanelContentViewModel = "PropertyPanelContentViewModel";
+
+        #endregion ViewModelName
 
         public static string PDFViewer = "PDFViewer";
 
@@ -46,6 +48,14 @@ namespace PDF_Office.Model
 
         public static string BookmarkInfo = "BookmarkInfo";
 
+        /// <summary>
+        /// 注释列表
+        /// </summary>
+
+        public static string Annotation = "Annotation";
+        public static string AnnotEvent = "AnnotEvent";
+        public static string AnnotationList = "AnnotationList";
+
         /// <summary>
         /// 底部工具栏
         /// </summary>

+ 16 - 0
PDF Office/Model/RegionNames.cs

@@ -39,6 +39,14 @@ namespace PDF_Office.Model
             }
         }
 
+        public static string ReadRegionName
+        {
+            get
+            {
+                return GetRegionName("ReadRegionName");
+            }
+        }
+
         /// <summary>
         /// 阅读页PDFViewer 对应的Content RegionName
         /// </summary>
@@ -154,6 +162,14 @@ namespace PDF_Office.Model
             }
         }
 
+        public static string ReadModePageRegionName
+        {
+            get
+            {
+                return GetRegionName("ReadModePageRegionName");
+            }
+        }
+
         /// <summary>
         /// 获取MainWindowsViewModel RegionNames字典里的RegionName,
         /// 如果字典里没有键值就新建一个GUID,并插入到

+ 65 - 0
PDF Office/PDF Office.csproj

@@ -228,11 +228,17 @@
     <Compile Include="CustomControl\WritableComboBox.xaml.cs">
       <DependentUpon>WritableComboBox.xaml</DependentUpon>
     </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" />
     <Compile Include="DataConvert\FileToImageSourceConvert.cs" />
     <Compile Include="DataConvert\InvertBoolConvert.cs" />
     <Compile Include="DataConvert\ObjectConvert.cs" />
     <Compile Include="DataConvert\PropertyPanelVisible.cs" />
+    <Compile Include="DataConvert\StringToDateConvert.cs" />
     <Compile Include="DataConvert\StringToVisibleConvert.cs" />
     <Compile Include="DataConvert\UnVisivleConvert.cs" />
     <Compile Include="DataConvert\WidthConvert.cs" />
@@ -255,6 +261,7 @@
     <Compile Include="Helper\SetterAction.cs" />
     <Compile Include="Helper\SettingHelper.cs" />
     <Compile Include="Helper\ToolMethod.cs" />
+    <Compile Include="Model\BOTA\AnnotationHandlerEventArgs.cs" />
     <Compile Include="Model\AnnotPanel\Stamp.cs" />
     <Compile Include="Model\BOTA\OutlineNode.cs" />
     <Compile Include="Model\CloudDrive\CloudDriveItem.cs" />
@@ -325,11 +332,15 @@
     <Compile Include="ViewModels\EditTools\Bates\BatesCreateContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Bates\BatesDocumentContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Bates\BatesTemplateListContentViewModel.cs" />
+    <Compile Include="ViewModels\BOTA\AnnotationContentViewModel.cs" />
+    <Compile Include="ViewModels\BOTA\AnnotationListItemViewModel.cs" />
     <Compile Include="ViewModels\BOTA\BookmarkContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\BOTA\AddAnnotationDialogViewModel.cs" />
     <Compile Include="ViewModels\BOTA\OutLineControlViewModel.cs" />
     <Compile Include="ViewModels\BOTA\SearchContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\BOTA\AddBookmarkDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\BOTA\BookmarkInfoDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\BOTA\ScreenAnnotationDialogViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Background\BackgroundContentViewModel.cs" />
     <Compile Include="ViewModels\BOTA\BOTAContentViewModel.cs" />
     <Compile Include="ViewModels\BottomToolContentViewModel.cs" />
@@ -363,6 +374,7 @@
     <Compile Include="ViewModels\Form\FormsToolContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\PDFTools\PDFToolsContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\PDFTools\QuickToolsContentViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\ViewModular\ReadViewContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\RecentFiles\RecentFilesContentViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\CustomCreateDialogViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\DynamicPropertyDialogViewModel.cs" />
@@ -433,6 +445,12 @@
     <Compile Include="ViewModels\EditTools\Watermark\WatermarkTemplateListBaseContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Watermark\WatermarkTemplateListFileContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Watermark\WatermarkTemplateListTextContentViewModel.cs" />
+    <Compile Include="Views\BOTA\AnnotationContent.xaml.cs">
+      <DependentUpon>AnnotationContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\BOTA\AnnotationListItem.xaml.cs">
+      <DependentUpon>AnnotationListItem.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\BOTA\BookmarkContent.xaml.cs">
       <DependentUpon>BookmarkContent.xaml</DependentUpon>
     </Compile>
@@ -449,6 +467,12 @@
     <Compile Include="Views\BottomToolContent.xaml.cs">
       <DependentUpon>BottomToolContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\BOTA\AddAnnotationDialog.xaml.cs">
+      <DependentUpon>AddAnnotationDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\BOTA\ScreenAnnotationDialog.xaml.cs">
+      <DependentUpon>ScreenAnnotationDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\ConverterDialogs\ConverterCSVDialog.xaml.cs">
       <DependentUpon>ConverterCSVDialog.xaml</DependentUpon>
     </Compile>
@@ -751,6 +775,9 @@
     <Compile Include="Views\PropertyPanel\ViewModular\ReadModeContent.xaml.cs">
       <DependentUpon>ReadModeContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\PropertyPanel\ViewModular\ReadViewContent.xaml.cs">
+      <DependentUpon>ReadViewContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\PropertyPanel\ViewModular\SplitScreenContent.xaml.cs">
       <DependentUpon>SplitScreenContent.xaml</DependentUpon>
     </Compile>
@@ -911,6 +938,14 @@
       <SubType>Designer</SubType>
       <Generator>XamlIntelliSenseFileGenerator</Generator>
     </Page>
+    <Page Include="Views\BOTA\AnnotationContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\BOTA\AnnotationListItem.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\BOTA\BookmarkContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -931,6 +966,14 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\BOTA\AddAnnotationDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\BOTA\ScreenAnnotationDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\ConverterDialogs\ConverterCSVDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1264,6 +1307,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\PropertyPanel\ViewModular\ReadViewContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\ViewModular\SplitScreenContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1401,6 +1448,24 @@
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
     </None>
     <None Include="source\AnalysisWord\Res\word\_rels\document.xml.rels" />
+    <Resource Include="Resources\BOTA\Annotation\Arrow.png" />
+    <Resource Include="Resources\BOTA\Annotation\Bookmark.png" />
+    <Resource Include="Resources\BOTA\Annotation\Circle.png" />
+    <Resource Include="Resources\BOTA\Annotation\Freehande.png" />
+    <Resource Include="Resources\BOTA\Annotation\Freehande2.png" />
+    <Resource Include="Resources\BOTA\Annotation\Hand.png" />
+    <Resource Include="Resources\BOTA\Annotation\Highlight.png" />
+    <Resource Include="Resources\BOTA\Annotation\Hyperlink.png" />
+    <Resource Include="Resources\BOTA\Annotation\Image.png" />
+    <Resource Include="Resources\BOTA\Annotation\Line.png" />
+    <Resource Include="Resources\BOTA\Annotation\Note.png" />
+    <Resource Include="Resources\BOTA\Annotation\Point.png" />
+    <Resource Include="Resources\BOTA\Annotation\Rectangle.png" />
+    <Resource Include="Resources\BOTA\Annotation\Selecttool.png" />
+    <Resource Include="Resources\BOTA\Annotation\Stamp.png" />
+    <Resource Include="Resources\BOTA\Annotation\Textbox.png" />
+    <Resource Include="Resources\BOTA\Annotation\wavyline2.png" />
+    <Resource Include="Resources\BOTA\empty_annotation.png" />
     <Resource Include="Resources\HomeIcon\PDFTools\background.png" />
     <Resource Include="Resources\HomeIcon\PDFTools\batch-remove.png" />
     <Resource Include="Resources\HomeIcon\PDFTools\batch.png" />

+ 14 - 1
PDF Office/Properties/Settings.Designer.cs

@@ -22,7 +22,20 @@ namespace PDF_Office.Properties {
                 return defaultInstance;
             }
         }
-        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("10")]
+        public double AnnotateFontSize
+        {
+            get
+            {
+                return ((double)(this["AnnotateFontSize"]));
+            }
+            set
+            {
+                this["AnnotateFontSize"] = value;
+            }
+        }
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         public global::PDFSettings.Settings.RecentOpenFiles RecentOpenFiles {

BIN
PDF Office/Resources/BOTA/Annotation/Arrow.png


BIN
PDF Office/Resources/BOTA/Annotation/Bookmark.png


BIN
PDF Office/Resources/BOTA/Annotation/Circle.png


BIN
PDF Office/Resources/BOTA/Annotation/Freehande.png


BIN
PDF Office/Resources/BOTA/Annotation/Freehande2.png


BIN
PDF Office/Resources/BOTA/Annotation/Hand.png


BIN
PDF Office/Resources/BOTA/Annotation/Highlight.png


BIN
PDF Office/Resources/BOTA/Annotation/Hyperlink.png


BIN
PDF Office/Resources/BOTA/Annotation/Image.png


BIN
PDF Office/Resources/BOTA/Annotation/Line.png


BIN
PDF Office/Resources/BOTA/Annotation/Note.png


BIN
PDF Office/Resources/BOTA/Annotation/Point.png


BIN
PDF Office/Resources/BOTA/Annotation/Rectangle.png


BIN
PDF Office/Resources/BOTA/Annotation/Selecttool.png


BIN
PDF Office/Resources/BOTA/Annotation/Stamp.png


BIN
PDF Office/Resources/BOTA/Annotation/Textbox.png


BIN
PDF Office/Resources/BOTA/Annotation/wavyline2.png


BIN
PDF Office/Resources/BOTA/empty_annotation.png


+ 34 - 5
PDF Office/Styles/ButtonStyle.xaml

@@ -1,4 +1,5 @@
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
     <Style x:Key="FocusVisual">
         <Setter Property="Control.Template">
             <Setter.Value>
@@ -13,7 +14,37 @@
             </Setter.Value>
         </Setter>
     </Style>
-
+    <Style x:Key="PageEditToolBtn" BasedOn="{StaticResource TitleBarBtn}" TargetType="{x:Type Button}">
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="BorderBrush" Value="Transparent" />
+        <Setter Property="Width" Value="auto" />
+        <Setter Property="Height" Value="40" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type Button}">
+                    <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
+                        <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="true">
+                            <Setter Property="Background" TargetName="border" Value="#1A000000" />
+                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}" />
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="true">
+                            <Setter Property="Background" TargetName="border" Value="#26000000" />
+                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}" />
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="false">
+                            <Setter Property="Background" TargetName="border" Value="Transparent" />
+                            <Setter Property="BorderBrush" TargetName="border" Value="#33000000" />
+                            <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="#FF999999" />
+                            <Setter Property="Opacity" TargetName="contentPresenter" Value="0.4" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
     <Style x:Key="TitleBarBtn" TargetType="{x:Type Button}">
         <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
         <Setter Property="Background" Value="{StaticResource Button.Static.Background}" />
@@ -277,8 +308,8 @@
     </ControlTemplate>
 
     <!--
-        Style for Btn.cta
-        样式里仅设置了背景色和文字颜色变化,字体大小和控件宽度需要调用时设置
+    Style for Btn.cta
+    样式里仅设置了背景色和文字颜色变化,字体大小和控件宽度需要调用时设置
     -->
     <Style x:Key="Btn.cta" TargetType="{x:Type Button}">
         <Setter Property="FocusVisualStyle" Value="{x:Null}" />
@@ -310,7 +341,6 @@
                 <Setter Property="Foreground" Value="{StaticResource color.btn.cta.text.dis}" />
             </Trigger>
         </Style.Triggers>
-
     </Style>
 
     <!--  style for Btn.Brand  -->
@@ -462,5 +492,4 @@
             </Trigger>
         </Style.Triggers>
     </Style>
-
 </ResourceDictionary>

+ 47 - 0
PDF Office/Styles/ComboxStyle.xaml

@@ -83,4 +83,51 @@
         <Setter Property="FontFamily" Value="Segoe UI" />
         <Setter Property="FontSize" Value="14" />
     </Style>
+
+    <Style x:Key="ContextMenuStyle" TargetType="{x:Type ContextMenu}">
+        <Setter Property="SnapsToDevicePixels" Value="True" />
+        <Setter Property="Grid.IsSharedSizeScope" Value="true" />
+        <Setter Property="HasDropShadow" Value="True" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ContextMenu}">
+                    <Border Uid="Border_93">
+                        <Border.Style>
+                            <Style TargetType="{x:Type Border}">
+                                <Setter Property="Tag" Value="{DynamicResource {x:Static SystemParameters.DropShadowKey}}" />
+                                <Style.Triggers>
+                                    <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource Self}}" Value="True">
+                                        <Setter Property="Effect">
+                                            <Setter.Value>
+                                                <DropShadowEffect
+                                                    BlurRadius="4"
+                                                    Opacity="0.8"
+                                                    ShadowDepth="1" />
+                                            </Setter.Value>
+                                        </Setter>
+                                    </DataTrigger>
+                                </Style.Triggers>
+                            </Style>
+                        </Border.Style>
+                        <Border
+                            Uid="Border_50"
+                            Background="{TemplateBinding Background}"
+                            BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}">
+                            <ScrollViewer
+                                Uid="ScrollViewer_9"
+                                CanContentScroll="True"
+                                Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer,
+                                                                              TypeInTargetAssembly={x:Type FrameworkElement}}}">
+                                <ItemsPresenter
+                                    Uid="ItemsPresenter_5"
+                                    KeyboardNavigation.DirectionalNavigation="Cycle"
+                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                            </ScrollViewer>
+                        </Border>
+                    </Border>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
 </ResourceDictionary>

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

@@ -21,6 +21,111 @@
     <SolidColorBrush x:Key="BlueBtn.Pressed.Background" Color="#1B2944" />
     <SolidColorBrush x:Key="Redact.Background" Color="#477EDE" />
 
+    <Style x:Key="ToggleBtnScreenAnnotationStyle" TargetType="customControl:CustomIconToggleBtn">
+        <Setter Property="Background" Value="{StaticResource Button.Static.Background}" />
+        <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}" />
+        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="HorizontalContentAlignment" Value="Center" />
+        <Setter Property="Margin" Value="4" />
+        <Setter Property="Height" Value="40" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="customControl:CustomIconToggleBtn">
+                    <Border
+                        x:Name="border"
+                        Background="{TemplateBinding Background}"
+                        BorderBrush="Transparent"
+                        CornerRadius="4"
+                        SnapsToDevicePixels="true">
+                        <Grid
+                            Width="40"
+                            Height="40"
+                            HorizontalAlignment="Center"
+                            VerticalAlignment="Center">
+                            <ContentPresenter
+                                x:Name="contentPresenter"
+                                Margin="0"
+                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                Focusable="False"
+                                RecognizesAccessKey="True"
+                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                        </Grid>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="border" Property="Background" Value="#e2e3e5" />
+                            <Setter TargetName="border" Property="BorderBrush" Value="#CED0D4" />
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="True">
+                            <Setter TargetName="border" Property="Background" Value="#e2e3e5" />
+                            <Setter TargetName="border" Property="BorderBrush" Value="#CED0D4" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Style.Triggers>
+
+            <Trigger Property="IsChecked" Value="True">
+                <Setter Property="Background" Value="#e2e3e5" />
+                <Setter Property="BorderBrush" Value="#CED0D4" />
+            </Trigger>
+            <Trigger Property="IsChecked" Value="False">
+                <Setter Property="Background" Value="Transparent" />
+                <Setter Property="BorderBrush" Value="Transparent" />
+            </Trigger>
+            <Trigger Property="IsChecked" Value="{x:Null}">
+                <Setter Property="Background" Value="Transparent" />
+            </Trigger>
+        </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>
+
     <Style x:Key="ToggleBtnViewModeStyle" TargetType="customControl:CustomIconToggleBtn">
         <Setter Property="Background" Value="{StaticResource Button.Static.Background}" />
         <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}" />
@@ -71,10 +176,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>
@@ -173,7 +278,6 @@
         </Style.Triggers>
     </Style>
 
-
     <Style x:Key="BlueBtnStyle" TargetType="{x:Type Button}">
         <Setter Property="Background" Value="#1460F3" />
         <Setter Property="Template">
@@ -236,7 +340,6 @@
                             Focusable="False"
                             RecognizesAccessKey="True"
                             SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
-
                     </Border>
                     <ControlTemplate.Triggers>
                         <Trigger Property="IsMouseOver" Value="true">
@@ -454,7 +557,6 @@
         </Setter>
     </Style>
 
-
     <Style x:Key="HomePageCompressBtn" TargetType="Button">
         <Setter Property="Background" Value="White" />
         <Setter Property="BorderBrush" Value="White" />
@@ -498,5 +600,4 @@
             </Setter.Value>
         </Setter>
     </Style>
-</ResourceDictionary>
-
+</ResourceDictionary>

File diff suppressed because it is too large
+ 284 - 34
PDF Office/Styles/ExpanderStyle.xaml


+ 56 - 3
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>
@@ -389,4 +394,52 @@
             </Setter.Value>
         </Setter>
     </Style>
+
+    <ControlTemplate x:Key="AnnotationListItemStyle" TargetType="{x:Type ListBoxItem}">
+        <Border
+            x:Name="Bd"
+            Margin="5,0,5,10"
+            Padding="5"
+            Background="#f5f5f5"
+            BorderBrush="{TemplateBinding BorderBrush}"
+            BorderThickness="{TemplateBinding BorderThickness}"
+            CornerRadius="4"
+            SnapsToDevicePixels="True">
+            <ContentPresenter
+                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                Content="{TemplateBinding Content}"
+                ContentStringFormat="{TemplateBinding ContentStringFormat}"
+                ContentTemplate="{TemplateBinding ContentTemplate}"
+                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+        </Border>
+        <ControlTemplate.Triggers>
+            <MultiTrigger>
+                <MultiTrigger.Conditions>
+                    <Condition Property="IsMouseOver" Value="True" />
+                </MultiTrigger.Conditions>
+                <Setter TargetName="Bd" Property="Background" Value="#EDEEF0" />
+                <Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" />
+            </MultiTrigger>
+            <MultiTrigger>
+                <MultiTrigger.Conditions>
+                    <Condition Property="Selector.IsSelectionActive" Value="False" />
+                    <Condition Property="IsSelected" Value="True" />
+                </MultiTrigger.Conditions>
+                <Setter TargetName="Bd" Property="Background" Value="#d7d8db" />
+                <Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" />
+            </MultiTrigger>
+            <MultiTrigger>
+                <MultiTrigger.Conditions>
+                    <Condition Property="Selector.IsSelectionActive" Value="True" />
+                    <Condition Property="IsSelected" Value="True" />
+                </MultiTrigger.Conditions>
+                <Setter TargetName="Bd" Property="Background" Value="#d7d8db" />
+                <Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" />
+            </MultiTrigger>
+            <Trigger Property="IsEnabled" Value="False">
+                <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
+            </Trigger>
+        </ControlTemplate.Triggers>
+    </ControlTemplate>
 </ResourceDictionary>

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

@@ -1,7 +1,7 @@
-<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-                    xmlns:customControl="clr-namespace:PDF_Office.CustomControl"
-                    >
+<ResourceDictionary
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:customControl="clr-namespace:PDF_Office.CustomControl">
     <Style TargetType="{x:Type customControl:PathButton}">
         <Setter Property="IconOpacity" Value="1" />
         <Setter Property="IconMouseOverOpacity" Value="1" />

+ 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>

+ 483 - 0
PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs

@@ -0,0 +1,483 @@
+using ComPDFKit.Import;
+using ComPDFKit.PDFAnnotation;
+using ComPDFKit.PDFDocument;
+using ComPDFKit.PDFPage;
+using ComPDFKitViewer;
+using ComPDFKitViewer.AnnotEvent;
+using ComPDFKitViewer.PdfViewer;
+using DryIoc;
+using Microsoft.Office.Interop.Excel;
+using Microsoft.Office.Interop.Word;
+using PDF_Office.CustomControl;
+using PDF_Office.DataConvert;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using PDF_Office.Model.BOTA;
+using PDF_Office.Views.PropertyPanel.AnnotPanel;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Services.Dialogs;
+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.Markup;
+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 static System.Windows.Forms.VisualStyles.VisualStyleElement;
+using Border = System.Windows.Controls.Border;
+using ListBox = System.Windows.Controls.ListBox;
+using Task = System.Threading.Tasks.Task;
+using TextBox = System.Windows.Controls.TextBox;
+
+using Winform = System.Windows.Forms;
+
+namespace PDF_Office.ViewModels.BOTA
+{
+    public class AnnotationContentViewModel : BindableBase, INavigationAware
+    {
+        private ListBox listBox;
+        private IRegionManager region;
+        private IDialogService dialogs;
+        private Visibility isEmptyPanelVisibility = Visibility.Visible;
+
+        public ViewContentViewModel ViewContentViewModel { get; set; }
+        public CPDFViewer PdfViewer { get; set; }
+
+        public Visibility IsEmptyPanelVisibility
+        {
+            get { return isEmptyPanelVisibility; }
+            set
+            {
+                SetProperty(ref isEmptyPanelVisibility, value);
+            }
+        }
+
+        private ObservableCollection<AnnotationHandlerEventArgs> annotationListItems;
+
+        public ObservableCollection<AnnotationHandlerEventArgs> AnnotationListItems
+        {
+            get { return annotationListItems; }
+            set
+            {
+                SetProperty(ref annotationListItems, value);
+            }
+        }
+
+        public DelegateCommand<object> LoadedCommand { get; set; }
+        public DelegateCommand<object> ListBoxItemPreviewMouseLeftButtonDown { get; set; }
+        public DelegateCommand<object> AddNotesCommand { get; set; }
+        public DelegateCommand<object> ScreenCommand { get; set; }
+        public DelegateCommand<object> ExportCommentsCommand { get; set; }
+        public DelegateCommand<object> DeleteCommand { get; set; }
+
+        public DelegateCommand DeleteAllCommand { get; set; }
+
+        public AnnotationContentViewModel(IRegionManager regionManager, IDialogService dialogService)
+        {
+            region = regionManager;
+            dialogs = dialogService;
+            LoadedCommand = new DelegateCommand<object>(Loaded);
+            ListBoxItemPreviewMouseLeftButtonDown = new DelegateCommand<object>(ListBoxItem_PreviewMouseLeftButtonDown);
+            AddNotesCommand = new DelegateCommand<object>(AddNotesEvent);
+            ScreenCommand = new DelegateCommand<object>(ScreenEvent);
+            ExportCommentsCommand = new DelegateCommand<object>(ExportCommentsEvent);
+            DeleteCommand = new DelegateCommand<object>(DelegateEvent);
+            DeleteAllCommand = new DelegateCommand(DeleteAllEvent);
+        }
+
+        /// <summary>
+        /// 删除所有注释
+        /// </summary>
+        private void DeleteAllEvent()
+        {
+            //调用集中删除的接口  方便一次性undo
+            Dictionary<int, List<int>> deleteLists = new Dictionary<int, List<int>>();
+            for (int i = 0; i < annotationListItems.Count; i++)
+            {
+                AnnotationHandlerEventArgs item = annotationListItems[i] as AnnotationHandlerEventArgs;
+                if (!deleteLists.ContainsKey(item.PageIndex))
+                {
+                    deleteLists.Add(item.PageIndex, new List<int>() { item.AnnotIndex });
+                }
+                else
+                {
+                    var pagelist = deleteLists[item.PageIndex];
+                    pagelist.Add(item.AnnotIndex);
+                }
+            }
+            PdfViewer.RemovePageAnnot(deleteLists);
+            annotationListItems.Clear();
+            PdfViewer.UndoManager.CanSave = true;
+        }
+
+        /// <summary>
+        /// 删除注释,单个/多个
+        /// </summary>
+        /// <param name="obj"></param>
+        private void DelegateEvent(object obj)
+        {
+            if (obj is AnnotationHandlerEventArgs annotation)
+            {
+                if (annotation != null)
+                {
+                    var result = PdfViewer.RemovePageAnnot(annotation.PageIndex, annotation.AnnotIndex);
+                    if (result)
+                    {
+                        AnnotationListItems.Remove(annotation);
+                        //记录是删除了哪些页面的注释,然后更新对应页面的注释即可
+                        UpdateAnnotListAfterDelete(annotation.PageIndex, annotation.AnnotIndex);
+                        PdfViewer.UndoManager.CanSave = true;
+                    }
+                }
+            }
+        }
+
+        private void UpdateAnnotListAfterDelete(int pageIndex, int annoteIndex)
+        {
+            var items = PdfViewer.GetAnnotCommentList(pageIndex, PdfViewer.Document);
+            for (int j = 0; j < items.Count; j++)//用修改赋值的方式  可以解决删除后表头折叠的问题
+            {
+                if (items[j].AnnotIndex >= annoteIndex)//只需要更新比删除元素索引大的注释
+                {
+                    for (int k = 0; k < AnnotationListItems.Count; k++)
+                    {
+                        //相当于将后面的索引-1
+                        if (AnnotationListItems[k].PageIndex == pageIndex &&
+                            AnnotationListItems[k].AnnotIndex == (items[j].AnnotIndex + 1) &&
+                            string.Equals(AnnotationListItems[k].MarkupContent, items[j].MarkupContent) &&
+                            string.Equals(AnnotationListItems[k].Content, items[j].Content) &&
+                            string.Equals(AnnotationListItems[k].CreateTime, items[j].CreateTime) &&
+                            string.Equals(AnnotationListItems[k].Author, items[j].Author)
+                            )
+                        {
+                            AnnotationListItems[k].AnnotHandlerEventArgs = items[j];
+                            AnnotationListItems[k].PageIndex = items[j].PageIndex;
+                            AnnotationListItems[k].AnnotIndex = items[j].AnnotIndex;
+                            AnnotationListItems[k].EventType = items[j].EventType;
+                            AnnotationListItems[k].CreateTime = items[j].CreateTime;
+                            AnnotationListItems[k].UpdateTime = items[j].UpdateTime;
+                            AnnotationListItems[k].Content = items[j].Content;
+                            AnnotationListItems[k].MarkupContent = items[j].MarkupContent;
+                            AnnotationListItems[k].Author = items[j].Author;
+                            AnnotationListItems[k].Locked = items[j].Locked;
+                            AnnotationListItems[k].ReadOnly = items[j].ReadOnly;
+                            AnnotationListItems[k].FormField = items[j].FormField;
+                            AnnotationListItems[k].Document = PdfViewer.Document;
+                        }
+                    }
+                }
+            }
+        }
+
+        private void ExportCommentsEvent(object obj)
+        {
+            if (ViewContentViewModel.CanSave)
+            {
+                ViewContentViewModel.SaveFile.Execute();
+            }
+            Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
+            dlg.Filter = "PDF|*.xfdf";
+            dlg.DefaultExt = ".xfdf";
+            dlg.FileName = PdfViewer.Document.FileName;
+            if (dlg.ShowDialog() == true)
+            {
+                string fileName = dlg.FileName;
+                var result = PdfViewer.ExportAnnotationToXFDFPath(fileName);
+                if (result)
+                {
+                    MessageBoxEx.Show("导出成功", "", Winform.MessageBoxButtons.OK);
+                }
+                else
+                {
+                    MessageBoxEx.Show("导出失败", "", Winform.MessageBoxButtons.OK, Winform.MessageBoxIcon.Error);
+                }
+            }
+        }
+
+        private void ScreenEvent(object obj)
+        {
+            DialogParameters value = new DialogParameters();
+            value.Add(ParameterNames.AnnotationList, AnnotationListItems);
+            dialogs.ShowDialog(DialogNames.ScreenAnnotationDialog, value, e =>
+            {
+            });
+        }
+
+        private void AddNotesEvent(object obj)
+        {
+            if (obj is AnnotationHandlerEventArgs data)
+            {
+                if (data != null)
+                {
+                    if (data.EventType != AnnotArgsType.AnnotSticky)
+                    {
+                        DialogParameters value = new DialogParameters();
+                        value.Add(ParameterNames.Annotation, data);
+                        dialogs.ShowDialog(DialogNames.AddAnnotationDialog, value, e =>
+                        {
+                            if (e.Result == ButtonResult.OK && e.Parameters != null)
+                            {
+                                //PdfViewer.UndoManager.CanSave = true;
+                                //    if (e.Parameters.ContainsKey(ParameterNames.Annotation) && e.Parameters.ContainsKey(ParameterNames.AnnotEvent))
+                                //    {
+                                //        AnnotationHandlerEventArgs annotation = e.Parameters.GetValue<AnnotationHandlerEventArgs>(ParameterNames.Annotation);
+
+                                //        //AnnotAttribEvent annotEvent = e.Parameters.GetValue<AnnotAttribEvent>(ParameterNames.AnnotEvent);
+
+                                //        //annotEvent?.UpdateAttrib(AnnotAttrib.NoteText, annotation.MarkupContent);
+                                //        //annotEvent?.UpdateAnnot();
+
+                                //    }
+                            }
+                        });
+                    }
+                    //if(data.EventType == AnnotArgsType.AnnotFreeText)
+                    //{
+                    //    ListBoxItem myListBoxItem = (ListBoxItem)(listBox.ItemContainerGenerator.ContainerFromItem(data));
+                    //    TextBlock txbContent = CommonHelper.FindVisualChild<TextBlock>(myListBoxItem);
+
+                    //    TextBox txtContent = CommonHelper.FindVisualChild<TextBox>(myListBoxItem);
+                    //    txbContent.Visibility = Visibility.Collapsed;
+                    //    txtContent.Visibility = Visibility.Visible;
+                    //}
+                }
+            }
+        }
+
+        /// <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);
+                }
+            }
+        }
+
+        /// <summary>
+        /// 页面加载时
+        /// </summary>
+        /// <param name="obj"></param>
+        private void Loaded(object obj)
+        {
+            if (obj is CompositeCommandParameter composite)
+            {
+                if (composite.Parameter is ListBox listBox)
+                {
+                    this.listBox = listBox;
+                    SetGroupHeader(listBox);
+                }
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            var pdfview = navigationContext.Parameters[ParameterNames.PDFViewer] as CPDFViewer;
+            var viewContentViewModel = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as ViewContentViewModel;
+            if (pdfview != null && viewContentViewModel != null)
+            {
+                ViewContentViewModel = viewContentViewModel;
+                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;
+        }
+
+        /// <summary>
+        /// 获取手绘图案
+        /// </summary>
+        /// <param name="doc"></param>
+        /// <param name="pageIndex"></param>
+        /// <param name="annotIndex"></param>
+        /// <returns></returns>
+        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<AnnotationHandlerEventArgs> obsSender = sender as ObservableCollection<AnnotationHandlerEventArgs>;
+            if (obsSender != null)
+            {
+                if (obsSender.Count < 1)
+                {
+                    IsEmptyPanelVisibility = Visibility.Visible;
+                }
+                else
+                {
+                    IsEmptyPanelVisibility = Visibility.Collapsed;
+                }
+            }
+            else
+            {
+                IsEmptyPanelVisibility = Visibility.Visible;
+            }
+        }
+    }
+}

+ 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;
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 4 - 3
PDF Office/ViewModels/BOTA/BOTAContentViewModel.cs

@@ -67,7 +67,7 @@ namespace PDF_Office.ViewModels.BOTA
             viewNameByTabItem.Add("TabItemThumbnail", "PageEditContent");
             viewNameByTabItem.Add("TabItemOutLine", "OutLineControl");
             viewNameByTabItem.Add("TabItemBookMark", "BookmarkContent");
-            viewNameByTabItem.Add("TabItemAnnotation", "");
+            viewNameByTabItem.Add("TabItemAnnotation", "AnnotationContent");
             viewNameByTabItem.Add("TabItemSearch", "SearchContent");
             viewNameByTabItem.Add("TabItemForm", "");
             viewNameByTabItem.Add("TabItemSign", "");
@@ -81,9 +81,10 @@ namespace PDF_Office.ViewModels.BOTA
         {
             NavigationParameters param = new NavigationParameters();
             param.Add(ParameterNames.PDFViewer, pdfViewer);
-            if(currentBar== "TabItemThumbnail")
+            param.Add(ParameterNames.ViewContentViewModel, viewContentViewModel);
+            if (currentBar == "TabItemThumbnail")
             {
-                param.Add(ParameterNames.BOTAThumb,true);
+                param.Add(ParameterNames.BOTAThumb, true);
             }
             regions.RequestNavigate(BOTAContentRegionName, viewNameByTabItem[currentBar], param);
         }

+ 5 - 0
PDF Office/ViewModels/BOTA/BookmarkContentViewModel.cs

@@ -128,6 +128,10 @@ namespace PDF_Office.ViewModels.BOTA
                     IsEmptyPanelVisibility = Visibility.Collapsed;
                 }
             }
+            else
+            {
+                IsEmptyPanelVisibility = Visibility.Visible;
+            }
         }
 
         /// <summary>
@@ -293,6 +297,7 @@ namespace PDF_Office.ViewModels.BOTA
             int index = PDFViewer.CurrentIndex;
             string mark = string.Format($"第{index + 1}页");
 
+            //检测是否已存在相同数据
             var list = PDFViewer.Document.GetBookmarkList().FindAll(q => q.PageIndex == index);
 
             if (list.Count > 0)

+ 197 - 0
PDF Office/ViewModels/Dialog/BOTA/AddAnnotationDialogViewModel.cs

@@ -0,0 +1,197 @@
+using ComPDFKit.PDFAnnotation;
+using ComPDFKitViewer;
+using ComPDFKitViewer.AnnotEvent;
+using Microsoft.Office.Interop.Word;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using PDF_Office.Model.BOTA;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Annotations;
+using System.Windows.Controls;
+using System.Windows.Markup;
+using System.Windows.Media;
+
+namespace PDF_Office.ViewModels.Dialog.BOTA
+{
+    public class AddAnnotationDialogViewModel : BindableBase, IDialogAware
+    {
+        private string title;
+
+        public string Title
+        {
+            get { return title; }
+            set { SetProperty(ref title, value); }
+        }
+
+        public event Action<IDialogResult> RequestClose;
+
+        private string markupContent;
+
+        public string MarkupContent
+        {
+            get { return markupContent; }
+            set
+            {
+                SetProperty(ref markupContent, value);
+            }
+        }
+
+        private string annotationName;
+
+        public string AnnotationName
+        {
+            get { return annotationName; }
+            set
+            {
+                SetProperty(ref annotationName, value);
+            }
+        }
+
+        public AnnotationHandlerEventArgs Annotation { get; set; }
+        public AnnotAttribEvent AnnotEvent { get; set; }
+
+        public DelegateCommand CreateCommnad { get; set; }
+        public DelegateCommand CancelCommand { get; set; }
+
+        public DelegateCommand<Object> LostFocusCommand { get; set; }
+
+        public AddAnnotationDialogViewModel()
+        {
+            CancelCommand = new DelegateCommand(CancelEvent);
+            CreateCommnad = new DelegateCommand(CreateEvent);
+            LostFocusCommand = new DelegateCommand<object>(LostFocusEvent);
+        }
+
+        private void LostFocusEvent(object obj)
+        {
+            if (obj is CompositeCommandParameter composite)
+            {
+                if (composite.Parameter is TextBox textBox)
+                {
+                    Annotation.MarkupContent = textBox.Text;
+                    Annotation.AnnotHandlerEventArgs.MarkupContent = textBox.Text;
+                }
+            }
+        }
+
+        private void CreateEvent()
+        {
+            DialogParameters valuePairs = new DialogParameters();
+            valuePairs.Add(ParameterNames.Annotation, Annotation);
+            valuePairs.Add(ParameterNames.AnnotEvent, AnnotEvent);
+            RequestClose.Invoke(new DialogResult(ButtonResult.OK, valuePairs));
+        }
+
+        private void CancelEvent()
+        {
+            RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
+        }
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+            AnnotationHandlerEventArgs annotation;
+            parameters.TryGetValue<AnnotationHandlerEventArgs>(ParameterNames.Annotation, out annotation);
+
+            string title = "1";
+
+            if (annotation != null)
+            {
+                Annotation = annotation;
+
+                Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
+
+                switch (annotation.EventType)
+                {
+                    case AnnotArgsType.AnnotFreeText://文本
+                        title = "文本";
+                        //FreeTextAnnotArgs freetextArgs = annotation.AnnotHandlerEventArgs as FreeTextAnnotArgs; ;
+                        //annotAttribsList[AnnotAttrib.Color] = freetextArgs.LineColor;
+                        //annotAttribsList[AnnotAttrib.FillColor] = freetextArgs.BgColor;
+                        //annotAttribsList[AnnotAttrib.Thickness] = freetextArgs.LineWidth;
+                        //annotAttribsList[AnnotAttrib.Transparency] = freetextArgs.Transparency;
+                        //annotAttribsList[AnnotAttrib.FontColor] = freetextArgs.FontColor;
+                        //annotAttribsList[AnnotAttrib.FontSize] = freetextArgs.FontSize;
+                        //annotAttribsList[AnnotAttrib.FontFamily] = freetextArgs.FontFamily;
+                        //annotAttribsList[AnnotAttrib.FontStyle] = freetextArgs.FontStyle;
+                        //annotAttribsList[AnnotAttrib.FontWeight] = freetextArgs.FontWeight;
+                        //annotAttribsList[AnnotAttrib.TextAlign] = TextAlignment.Left;
+                        //annotAttribsList[AnnotAttrib.NoteText] = freetextArgs.TextContent;
+                        //AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(freetextArgs, annotAttribsList);
+                        break;
+
+                    case AnnotArgsType.AnnotHighlight:
+                        title = "高亮";
+                        break;
+
+                    case AnnotArgsType.AnnotFreehand:
+                        title = "手绘";
+                        break;
+
+                    case AnnotArgsType.AnnotSquiggly://波浪线
+                        title = "波浪线";
+                        break;
+
+                    case AnnotArgsType.AnnotStamp:
+                        title = "图章";
+                        break;
+
+                    case AnnotArgsType.AnnotStrikeout://删除线
+                        title = "删除线";
+                        break;
+
+                    case AnnotArgsType.AnnotSticky://便签
+                        break;
+
+                    case AnnotArgsType.AnnotUnderline:
+                        title = "下划线";
+                        break;
+
+                    case AnnotArgsType.AnnotLine:
+                        if ((annotation.AnnotHandlerEventArgs as LineAnnotArgs).HeadLineType >= (C_LINE_TYPE)1 || (annotation.AnnotHandlerEventArgs as LineAnnotArgs).TailLineType >= (C_LINE_TYPE)1)
+                        {
+                            title = "箭头";
+                        }
+                        else
+                        {
+                            title = "线";
+                        }
+                        break;
+
+                    case AnnotArgsType.AnnotSquare:
+                        title = "矩形";
+                        break;
+
+                    case AnnotArgsType.AnnotCircle:
+                        title = "圆";
+                        break;
+                }
+                if (!string.IsNullOrEmpty(annotation.MarkupContent))
+                {
+                    title = title + "-" + annotation.MarkupContent;
+                }
+                Title = title;
+                MarkupContent = annotation.MarkupContent;
+                AnnotationName = "页面" + (annotation.PageIndex + 1).ToString();
+                return;
+            }
+        }
+    }
+}

+ 437 - 0
PDF Office/ViewModels/Dialog/BOTA/ScreenAnnotationDialogViewModel.cs

@@ -0,0 +1,437 @@
+using ComPDFKit.PDFAnnotation;
+using ComPDFKitViewer.AnnotEvent;
+using Dropbox.Api.Users;
+using DryIoc;
+using ImTools;
+using Microsoft.Office.Interop.Word;
+using PDF_Office.CustomControl.CompositeControl;
+using PDF_Office.Model;
+using PDF_Office.Model.BOTA;
+using Prism.Commands;
+using Prism.Common;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Annotations;
+using System.Windows.Media;
+
+namespace PDF_Office.ViewModels.Dialog.BOTA
+{
+    public class AuthorItem : BindableBase
+    {
+        private string name;
+
+        public string Name
+        {
+            get { return name; }
+            set
+            {
+                SetProperty(ref name, value);
+            }
+        }
+
+        public AuthorItem(string name)
+        {
+            Name = name;
+        }
+    }
+
+    public class Compare<T, C> : IEqualityComparer<T>
+    {
+        private Func<T, C> _getField;
+
+        public Compare(Func<T, C> getfield)
+        {
+            this._getField = getfield;
+        }
+
+        public bool Equals(T x, T y)
+        {
+            return EqualityComparer<C>.Default.Equals(_getField(x), _getField(y));
+        }
+
+        public int GetHashCode(T obj)
+        {
+            return EqualityComparer<C>.Default.GetHashCode(this._getField(obj));
+        }
+    }
+
+    public static class CommonHelper
+    {
+        /// <summary>
+        /// 自定义Distinct扩展方法
+        /// </summary>
+        /// <typeparam name="T">要去重的对象类</typeparam>
+        /// <typeparam name="C">自定义去重的字段类型</typeparam>
+        /// <param name="source">要去重的对象</param>
+        /// <param name="getfield">获取自定义去重字段的委托</param>
+        /// <returns></returns>
+        public static IEnumerable<T> MyDistinct<T, C>(this IEnumerable<T> source, Func<T, C> getfield)
+        {
+            return source.Distinct(new Compare<T, C>(getfield));
+        }
+    }
+
+    internal class ScreenAnnotationDialogViewModel : BindableBase, IDialogAware
+    {
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 类型的显示隐藏
+
+        /// <summary>
+        /// 高亮字体
+        /// </summary>
+        private Visibility highlightVisibility = Visibility.Collapsed;
+
+        public Visibility HighlightVisibility
+        {
+            get { return highlightVisibility; }
+            set
+            {
+                SetProperty(ref highlightVisibility, value);
+            }
+        }
+
+        /// <summary>
+        /// 手绘
+        /// </summary>
+        private Visibility freeHandVisibility = Visibility.Collapsed;
+
+        public Visibility FreeHandVisibility
+        {
+            get { return freeHandVisibility; }
+            set
+            {
+                SetProperty(ref freeHandVisibility, value);
+            }
+        }
+
+        /// <summary>
+        /// 便签
+        /// </summary>
+        private Visibility annotStickyVisibility = Visibility.Collapsed;
+
+        public Visibility AnnotStickyVisibility
+        {
+            get { return annotStickyVisibility; }
+            set
+            {
+                SetProperty(ref annotStickyVisibility, value);
+            }
+        }
+
+        /// <summary>
+        /// 图章
+        /// </summary>
+        private Visibility annotStampVisibility = Visibility.Collapsed;
+
+        public Visibility AnnotStampVisibility
+        {
+            get { return annotStampVisibility; }
+            set
+            {
+                SetProperty(ref annotStampVisibility, value);
+            }
+        }
+
+        /// <summary>
+        /// 线
+        /// </summary>
+        private Visibility sharpLineVisibility = Visibility.Collapsed;
+
+        public Visibility SharpLineVisibility
+        {
+            get { return sharpLineVisibility; }
+            set
+            {
+                SetProperty(ref sharpLineVisibility, value);
+            }
+        }
+
+        /// <summary>
+        /// 箭头
+        /// </summary>
+        private Visibility sharpArrowVisibility = Visibility.Collapsed;
+
+        public Visibility SharpArrowVisibility
+        {
+            get { return sharpArrowVisibility; }
+            set
+            {
+                SetProperty(ref sharpArrowVisibility, value);
+            }
+        }
+
+        /// <summary>
+        /// 圆
+        /// </summary>
+        private Visibility annotCircleVisibility = Visibility.Collapsed;
+
+        public Visibility AnnotCircleVisibility
+        {
+            get { return annotCircleVisibility; }
+            set
+            {
+                SetProperty(ref annotCircleVisibility, value);
+            }
+        }
+
+        /// <summary>
+        /// 矩形
+        /// </summary>
+        private Visibility annotSquareVisibility = Visibility.Collapsed;
+
+        public Visibility AnnotSquareVisibility
+        {
+            get { return annotSquareVisibility; }
+            set
+            {
+                SetProperty(ref annotSquareVisibility, value);
+            }
+        }
+
+        /// <summary>
+        /// 文本注释
+        /// </summary>
+        private Visibility annotFreeTextVisibility = Visibility.Collapsed;
+
+        public Visibility AnnotFreeTextVisibility
+        {
+            get { return annotFreeTextVisibility; }
+            set
+            {
+                SetProperty(ref annotFreeTextVisibility, value);
+            }
+        }
+
+        /// <summary>
+        /// 删除线
+        /// </summary>
+        private Visibility annotStrikeoutVisibility = Visibility.Collapsed;
+
+        public Visibility AnnotStrikeoutVisibility
+        {
+            get { return annotStrikeoutVisibility; }
+            set
+            {
+                SetProperty(ref annotStrikeoutVisibility, value);
+            }
+        }
+
+        /// <summary>
+        /// 下划线
+        /// </summary>
+        private Visibility underLineVisibility = Visibility.Collapsed;
+
+        public Visibility UnderLineVisibility
+        {
+            get { return underLineVisibility; }
+            set
+            {
+                SetProperty(ref underLineVisibility, value);
+            }
+        }
+
+        #endregion 类型的显示隐藏
+
+        public DelegateCommand CancelCommand { get; set; }
+
+        public DelegateCommand CreateCommnad { get; set; }
+
+        public ObservableCollection<AnnotationHandlerEventArgs> AnnotationListItems { get; set; }
+
+        private ObservableCollection<ColorItem> annotationColors = new ObservableCollection<ColorItem>();
+
+        public ObservableCollection<ColorItem> AnnotationColors
+        {
+            get { return annotationColors; }
+            set
+            {
+                SetProperty(ref annotationColors, value);
+            }
+        }
+
+        private ObservableCollection<AuthorItem> annotationAuthor = new ObservableCollection<AuthorItem>();
+
+        public ObservableCollection<AuthorItem> AnnotationAuthor
+        {
+            get { return annotationAuthor; }
+            set
+            {
+                SetProperty(ref annotationAuthor, value);
+            }
+        }
+
+        //private List<System.Windows.Media.Color> annotationColors = new List<System.Windows.Media.Color>();
+        //private List<string> annotationAuthor = new List<string>();
+
+        public ScreenAnnotationDialogViewModel()
+        {
+            CancelCommand = new DelegateCommand(CancelEvent);
+            CreateCommnad = new DelegateCommand(CreateEvent);
+        }
+
+        private void CreateEvent()
+        {
+            DialogParameters valuePairs = new DialogParameters();
+            //valuePairs.Add(ParameterNames.Bookmark, Bookmark);
+            RequestClose.Invoke(new DialogResult(ButtonResult.OK, valuePairs));
+        }
+
+        private void CancelEvent()
+        {
+            RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
+        }
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+        }
+
+        private void SetColor(System.Windows.Media.Color color)
+        {
+            if (AnnotationColors.Count > 0)
+            {
+                for (int i = 0; i < AnnotationColors.Count; i++)
+                {
+                    System.Windows.Media.Color color1 = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString(AnnotationColors[i].Color.ToString());
+                    if (color1.R == color.R && color1.G == color.G && color1.B == color.B
+                        && color1.A == color.A)
+                    {
+                        AnnotationColors.Remove(AnnotationColors[i]);
+                    }
+                }
+            }
+            AnnotationColors.Add(new ColorItem(color));
+            //var bFind = AnnotationColors.All<ColorItem>(p => p.Color == new SolidColorBrush(color));
+            //if (bFind)
+            //{
+            //    AnnotationColors.Add(new ColorItem(color));
+            //}
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+            ObservableCollection<AnnotationHandlerEventArgs> list;
+            parameters.TryGetValue<ObservableCollection<AnnotationHandlerEventArgs>>(ParameterNames.AnnotationList, out list);
+            AnnotationListItems = list;
+
+            foreach (var item in AnnotationListItems)
+            {
+                AnnotationAuthor.Add(new AuthorItem(item.Author));
+
+                AnnotHandlerEventArgs data = item.AnnotHandlerEventArgs;
+
+                switch (item.EventType)
+                {
+                    case AnnotArgsType.AnnotFreeText://文本
+                        if (data is FreeTextAnnotArgs textAnnotArgs)
+                        {
+                            SetColor(textAnnotArgs.FontColor);
+                        }
+                        AnnotFreeTextVisibility = Visibility.Visible;
+                        break;
+
+                    case AnnotArgsType.AnnotHighlight://高亮
+                        if (data is TextHighlightAnnotArgs highlightAnnotArgs)
+                        {
+                            SetColor(highlightAnnotArgs.Color);
+                        }
+                        HighlightVisibility = Visibility.Visible;
+                        break;
+
+                    case AnnotArgsType.AnnotFreehand://手绘
+                        if (data is FreehandAnnotArgs freehandAnnotArgs)
+                        {
+                            SetColor(freehandAnnotArgs.InkColor);
+                        }
+                        FreeHandVisibility = Visibility.Visible;
+                        break;
+
+                    case AnnotArgsType.AnnotSquiggly://波浪线
+
+                        break;
+
+                    case AnnotArgsType.AnnotStamp://图章
+                        AnnotStampVisibility = Visibility.Visible;
+                        break;
+
+                    case AnnotArgsType.AnnotStrikeout://删除线
+                        if (data is TextStrikeoutAnnotArgs textStrikeoutAnnotArgs)
+                        {
+                            SetColor(textStrikeoutAnnotArgs.Color);
+                        }
+                        AnnotStickyVisibility = Visibility.Visible;
+                        break;
+
+                    case AnnotArgsType.AnnotSticky://便签
+                        if (data is StickyAnnotArgs stickyAnnotArgs)
+                        {
+                            SetColor(stickyAnnotArgs.Color);
+                        }
+                        AnnotStickyVisibility = Visibility.Visible;
+                        break;
+
+                    case AnnotArgsType.AnnotUnderline://下划线
+                        if (data is TextUnderlineAnnotArgs textUnderlineAnnotArgs)
+                        {
+                            SetColor(textUnderlineAnnotArgs.Color);
+                        }
+                        UnderLineVisibility = Visibility.Visible;
+                        break;
+
+                    case AnnotArgsType.AnnotLine:
+                        if ((item.AnnotHandlerEventArgs as LineAnnotArgs).HeadLineType >= (C_LINE_TYPE)1 || (item.AnnotHandlerEventArgs as LineAnnotArgs).TailLineType >= (C_LINE_TYPE)1)
+                        {
+                            //箭头
+                            SharpArrowVisibility = Visibility.Visible;
+                        }
+                        else
+                        {
+                            //线
+                            SharpLineVisibility = Visibility.Visible;
+                        }
+                        SetColor((item.AnnotHandlerEventArgs as LineAnnotArgs).LineColor);
+
+                        break;
+
+                    case AnnotArgsType.AnnotSquare://矩形
+                        if (data is SquareAnnotArgs squareAnnotArgs)
+                        {
+                            SetColor(squareAnnotArgs.BgColor);
+                            SetColor(squareAnnotArgs.LineColor);
+                        }
+                        AnnotSquareVisibility = Visibility.Visible;
+                        break;
+
+                    case AnnotArgsType.AnnotCircle://圆
+                        if (data is CircleAnnotArgs circleAnnotArgs)
+                        {
+                            SetColor(circleAnnotArgs.BgColor);
+                            SetColor(circleAnnotArgs.LineColor);
+                        }
+                        AnnotCircleVisibility = Visibility.Visible;
+                        break;
+                }
+            }
+            //AnnotationAuthor = AnnotationAuthor.MyDistinct(s => s.Name) as ObservableCollection<AuthorItem>;
+            //AnnotationColors = AnnotationColors.MyDistinct(s => s.Color) as ObservableCollection<ColorItem>;
+
+            AnnotationAuthor = new ObservableCollection<AuthorItem>(AnnotationAuthor.MyDistinct(s => s.Name));
+            //AnnotationColors = new ObservableCollection<ColorItem>(AnnotationColors.MyDistinct(s => s.Color));
+        }
+    }
+}

+ 1 - 0
PDF Office/ViewModels/PropertyPanel/ViewModular/ReadModeContentViewModel.cs

@@ -21,6 +21,7 @@ using TextBox = System.Windows.Controls.TextBox;
 using static System.Windows.Forms.VisualStyles.VisualStyleElement;
 using Button = System.Windows.Controls.Button;
 using System.Windows.Controls.Primitives;
+using Microsoft.Office.Interop.Word;
 
 namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
 {

+ 213 - 0
PDF Office/ViewModels/PropertyPanel/ViewModular/ReadViewContentViewModel.cs

@@ -0,0 +1,213 @@
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
+{
+    public class ReadViewContentViewModel : BindableBase, INavigationAware
+    {
+        public string ReadRegionName { get; set; }
+        public string ReadModeRegionName { get; set; }
+
+        public CPDFViewer PDFViewer { get; set; }
+
+        private bool canSave;
+
+        /// <summary>
+        /// 是否可以保存
+        /// </summary>
+        public bool CanSave
+        {
+            get { return canSave; }
+            set
+            {
+                SetProperty(ref canSave, value);
+            }
+        }
+
+        private bool canUndo;
+
+        /// <summary>
+        /// 是否可以进行Undo
+        /// </summary>
+        public bool CanUndo
+        {
+            get { return canUndo; }
+            set
+            {
+                SetProperty(ref canUndo, value);
+            }
+        }
+
+        private bool canRedo;
+
+        /// <summary>
+        /// 是否可以进行Redo
+        /// </summary>
+        public bool CanRedo
+        {
+            get { return canRedo; }
+            set
+            {
+                SetProperty(ref canRedo, value);
+            }
+        }
+
+        private Visibility readModeContentVisibility = Visibility.Collapsed;
+
+        public Visibility ReadModeContentVisibility
+        {
+            get { return readModeContentVisibility; }
+            set
+            {
+                SetProperty(ref readModeContentVisibility, value);
+            }
+        }
+
+        private Visibility rectangleReadModeVisibility = Visibility.Collapsed;
+
+        public Visibility RectangleReadModeVisibility
+        {
+            get { return rectangleReadModeVisibility; }
+            set
+            {
+                SetProperty(ref rectangleReadModeVisibility, value);
+            }
+        }
+
+        public IRegionManager region;
+
+        public IDialogService dialogs;
+
+        /// <summary>
+        /// 鼠标滚轮缩放的缩放值
+        /// </summary>
+        private double[] zoomLevel = { 1.00f, 10, 25, 50, 75, 100, 125, 150, 200, 300, 400, 600, 800, 1000 };
+
+        public DelegateCommand Load { get; set; }
+
+        public ReadViewContentViewModel(IRegionManager regionManager, IDialogService dialogService)
+        {
+            region = regionManager;
+            dialogs = dialogService;
+            ReadRegionName = RegionNames.ReadRegionName;
+            ReadModeRegionName = RegionNames.ReadModePageRegionName;
+            ReadModeContentVisibility = Visibility.Visible;
+            RectangleReadModeVisibility = Visibility.Collapsed;
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            var pdfview = navigationContext.Parameters[ParameterNames.PDFViewer] as CPDFViewer;
+            if (pdfview != null)
+            {
+                PDFViewer = pdfview;
+                LoadFile();
+            }
+        }
+
+        /// <summary>
+        /// 将PDFViwer添加到Region
+        /// </summary>
+        private void LoadFile()
+        {
+            PDFViewer.MouseWheelZoomHandler += PdfViewer_MouseWheelZoomHandler;
+            PDFViewer.UndoManager.PropertyChanged += UndoManager_PropertyChanged;
+            CanSave = PDFViewer.UndoManager.CanSave;
+            CanUndo = PDFViewer.UndoManager.CanUndo;
+            CanRedo = PDFViewer.UndoManager.CanRedo;
+
+            if (region.Regions.ContainsRegionWithName(ReadRegionName))
+            {
+                if (region.Regions[ReadRegionName].Views.Contains(PDFViewer))
+                {
+                    var contentRegion = region.Regions[ReadRegionName];
+                    contentRegion.Remove(PDFViewer);
+                }
+                region.AddToRegion(ReadRegionName, PDFViewer);
+            }
+
+            System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
+            {
+                NavigationParameters parameters = new NavigationParameters();
+                parameters.Add(ParameterNames.PDFViewer, PDFViewer);
+                parameters.Add(ParameterNames.ViewContentViewModel, this);
+
+                region.RequestNavigate(ReadModeRegionName, "ReadModeContent", parameters);
+            }
+             ));
+        }
+
+        public void PdfViewer_MouseWheelZoomHandler(object sender, bool e)
+        {
+            double newZoom = CheckZoomLevel(PDFViewer.ZoomFactor + (e ? 0.01 : -0.01), e);
+            PDFViewer.Zoom(newZoom);
+        }
+
+        private double CheckZoomLevel(double zoom, bool IsGrowth)
+        {
+            double standardZoom = 100;
+            if (zoom <= 0.01)
+            {
+                return 0.01;
+            }
+            if (zoom >= 10)
+            {
+                return 10;
+            }
+
+            zoom *= 100;
+            for (int i = 0; i < zoomLevel.Length - 1; i++)
+            {
+                if (zoom > zoomLevel[i] && zoom <= zoomLevel[i + 1] && IsGrowth)
+                {
+                    standardZoom = zoomLevel[i + 1];
+                    break;
+                }
+                if (zoom >= zoomLevel[i] && zoom < zoomLevel[i + 1] && !IsGrowth)
+                {
+                    standardZoom = zoomLevel[i];
+                    break;
+                }
+            }
+            return standardZoom / 100;
+        }
+
+        private void UndoManager_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
+        {
+            //不处于页面编辑模式下时,根据PDFVIewer的undo redo状态来更新按钮状态
+            //页面编辑模式下,按钮状态根据页面编辑的undo redo来显示
+            if (e.PropertyName == "CanUndo")
+            {
+                CanUndo = PDFViewer.UndoManager.CanUndo;
+            }
+            if (e.PropertyName == "CanRedo")
+            {
+                CanRedo = PDFViewer.UndoManager.CanRedo;
+            }
+            if (e.PropertyName == "CanSave")
+            {
+                CanSave = PDFViewer.UndoManager.CanSave;
+            }
+        }
+    }
+}

+ 69 - 2
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -52,7 +52,7 @@ namespace PDF_Office.ViewModels
 
         public string ConverterBarContentRegionName { get; set; }
         public string TextEditContentRegionName { get; set; }
-        
+
         public string BackgroundContentRegionName { get; set; }
 
         /// <summary>
@@ -61,6 +61,7 @@ namespace PDF_Office.ViewModels
         public string BottomToolRegionName { get; set; }
 
         private bool _isInPageEdit = false;
+
         /// <summary>
         /// 是否处于页面编辑模式,用于执行undo redo 的具体操作
         /// </summary>
@@ -231,7 +232,6 @@ namespace PDF_Office.ViewModels
             }
         }
 
-
         private bool isPorpertyOpen = false;
 
         /// <summary>
@@ -481,9 +481,11 @@ namespace PDF_Office.ViewModels
                 case "TabItemFill":
                     ToolsBarContentVisible = Visibility.Visible;
                     break;
+
                 case "TabItemEdit":
                     TextEditToolContentVisible = Visibility.Visible;
                     break;
+
                 case "TabItemConvert":
                     ConverterBarContentVisible = Visibility.Visible;
                     break;
@@ -496,6 +498,7 @@ namespace PDF_Office.ViewModels
                 case "RedactionContent":
                     ToolContentVisible = Visibility.Visible;
                     break;
+
                 default:
                     break;
             }
@@ -577,6 +580,70 @@ namespace PDF_Office.ViewModels
             }
         }
 
+        /// <summary>
+        /// 阅读模式
+        /// </summary>
+        /// <param name="viewContent"></param>
+        public async void RbtnReadMode(ViewContent viewContent)
+        {
+            App.IsBookMode = true;
+            IsLoading = Visibility.Visible;
+            await Task.Delay(1);
+            NavigationParameters param = new NavigationParameters();
+            param.Add(ParameterNames.PDFViewer, PDFViewer);
+            param.Add(ParameterNames.ViewContentViewModel, this);
+            region.RequestNavigate(ToolContentRegionName, "ReadViewContent", param);
+
+            //ShowContent(CurrentBar, true);
+            if (GridToolRow != 0)
+            {
+                GridToolRow = 0;
+            }
+
+            if (GridToolRowSpan != 4)
+            {
+                GridToolRowSpan = 4;
+            }
+            //isInPageEdit = true;
+            UpdateShowContent("TabItemPageEdit");
+            IsLoading = Visibility.Collapsed;
+        }
+
+        /// <summary>
+        /// 退出阅读模式
+        /// </summary>
+        public async void UnReadModel()
+        {
+            App.IsBookMode = false;
+            IsLoading = Visibility.Visible;
+            await Task.Delay(1);
+            //region.AddToRegion(ViwerRegionName, PDFViewer);
+
+            if (region.Regions.ContainsRegionWithName(ViwerRegionName))
+            {
+                if (region.Regions[ViwerRegionName].Views.Contains(PDFViewer))
+                {
+                    var contentRegion = region.Regions[ViwerRegionName];
+                    contentRegion.Remove(PDFViewer);
+                }
+                region.AddToRegion(ViwerRegionName, PDFViewer);
+            }
+            if (string.IsNullOrEmpty(CurrentBar) || CurrentBar.Equals("TabItemPageEdit", StringComparison.OrdinalIgnoreCase))
+            {
+                EnterSelectedBar("TabItemAnnotation");
+            }
+            else
+            {
+                EnterSelectedBar(CurrentBar);
+            }
+
+            //isInPageEdit = false;
+            //ShowContent(CurrentBar, false);
+            //isInPageEdit = false;
+
+            IsLoading = Visibility.Collapsed;
+        }
+
         #region PDFViewer鼠标滚轮缩放事件
 
         public void PdfViewer_MouseWheelZoomHandler(object sender, bool e)

File diff suppressed because it is too large
+ 301 - 0
PDF Office/Views/BOTA/AnnotationContent.xaml


+ 239 - 0
PDF Office/Views/BOTA/AnnotationContent.xaml.cs

@@ -0,0 +1,239 @@
+using ComPDFKitViewer.AnnotEvent;
+using PDF_Office.DataConvert;
+using PDF_Office.Helper;
+using PDF_Office.Model.BOTA;
+using PDF_Office.ViewModels.BOTA;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Forms;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
+using ListBox = System.Windows.Controls.ListBox;
+using MenuItem = System.Windows.Controls.MenuItem;
+using UserControl = System.Windows.Controls.UserControl;
+
+namespace PDF_Office.Views.BOTA
+{
+    /// <summary>
+    /// AnnotationContent.xaml 的交互逻辑
+    /// </summary>
+    public partial class AnnotationContent : UserControl
+    {
+        private AnnotationContentViewModel viewModel;
+
+        public AnnotationContent()
+        {
+            InitializeComponent();
+            viewModel = this.DataContext as AnnotationContentViewModel;
+        }
+
+        private void ListBoxItem_PreviewMouseDown(object sender, MouseButtonEventArgs e)
+        {
+            if (e.ClickCount == 1)
+            {
+                if (Mouse.LeftButton == e.ButtonState)
+                {
+                    viewModel.ListBoxItemPreviewMouseLeftButtonDown.Execute(sender);
+                }
+                else if (Mouse.RightButton == e.ButtonState)
+                {
+                    var pos = e.GetPosition(AnnotationList);
+
+                    var result = VisualTreeHelper.HitTest(AnnotationList, pos);
+                    if (result != null)
+                    {
+                        ListBoxItem myListBoxItem = sender as System.Windows.Controls.ListBoxItem;
+                        MenuItem copyText = myListBoxItem.ContextMenu.Items[0] as MenuItem;
+                        MenuItem export = myListBoxItem.ContextMenu.Items[1] as MenuItem;
+                        if (AnnotationList.SelectedItems.Count > 1)
+                        {
+                            export.IsEnabled = false;
+                            copyText.IsEnabled = false;
+                        }
+                        else
+                        {
+                            viewModel.ListBoxItemPreviewMouseLeftButtonDown.Execute(sender);
+                            if (myListBoxItem.DataContext is AnnotationHandlerEventArgs annotation)
+                            {
+                                if (annotation.EventType == AnnotArgsType.AnnotFreeText)
+                                {
+                                    copyText.IsEnabled = true;
+                                }
+                                else
+                                {
+                                    copyText.IsEnabled = false;
+                                }
+                            }
+                            export.IsEnabled = true;
+                            export.Command = viewModel.ExportCommentsCommand;
+                        }
+                    }
+                }
+            }
+            //else if (e.ClickCount == 2)
+            //{
+            //    viewModel.DoubleClikCommand.Execute(sender);
+            //}
+        }
+
+        private void AnnotationList_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
+        {
+            //AnnotationList.ContextMenu.IsEnabled = false;
+        }
+
+        private async void MenuExpandAll_Click(object sender, RoutedEventArgs e)
+        {
+            SetAllExpander(true);
+            await Task.Delay(1);
+            for (int i = 0; i < AnnotationList.Items.Count; i++)
+            {
+                ListBoxItem item = AnnotationList.ItemContainerGenerator.ContainerFromIndex(i) as ListBoxItem;
+                ToggleButton button = GetExpandButton(item);
+                if (button != null && button.Visibility == Visibility.Visible)
+                {
+                    button.IsChecked = true;
+                }
+            }
+        }
+
+        private void MenuCollapseAll_Click(object sender, RoutedEventArgs e)
+        {
+            for (int i = 0; i < AnnotationList.Items.Count; i++)
+            {
+                ListBoxItem item = AnnotationList.ItemContainerGenerator.ContainerFromIndex(i) as ListBoxItem;
+                ToggleButton button = GetExpandButton(item);
+                if (button != null && button.Visibility == Visibility.Visible)
+                {
+                    button.IsChecked = false;
+                }
+            }
+            SetAllExpander(false);
+        }
+
+        private void SetAllExpander(bool isexpand)
+        {
+            AnnotationList.Dispatcher.Invoke(() =>
+            {
+                //开启虚拟化之后 全部展开和折叠会有问题
+                var scroller = GetScrollHost(AnnotationList);
+                var stackpanel = CommonHelper.FindVisualChild<StackPanel>(scroller);
+                int count = VisualTreeHelper.GetChildrenCount(stackpanel);
+                for (int i = 0; i < count; i++)
+                {
+                    var item = VisualTreeHelper.GetChild(stackpanel, i) as GroupItem;
+                    var g = CommonHelper.FindVisualChild<Expander>(item);
+                    if (g != null)
+                        g.IsExpanded = isexpand;
+                }
+            });
+        }
+
+        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 ToggleButton GetExpandButton(ListBoxItem item)
+        {
+            if (item == null) return null;
+            Border border = VisualTreeHelper.GetChild(item, 0) as Border;
+            var btn = CommonHelper.FindVisualChild<ToggleButton>(border);
+            return btn;
+        }
+
+        private void MenuTimeRightSort_Click(object sender, RoutedEventArgs e)
+        {
+            ICollectionView v = CollectionViewSource.GetDefaultView(AnnotationList.ItemsSource);
+            CreateTimeToDate createTimeToDate = new CreateTimeToDate();
+            v.GroupDescriptions.Clear();
+            v.GroupDescriptions.Add(new PropertyGroupDescription(nameof(AnnotHandlerEventArgs.CreateTime), createTimeToDate));
+
+            v.SortDescriptions.Clear();
+            v.SortDescriptions.Add(new SortDescription(nameof(AnnotHandlerEventArgs.CreateTime), ListSortDirection.Ascending));
+            v.SortDescriptions.Add(new SortDescription(nameof(AnnotHandlerEventArgs.AnnotIndex), ListSortDirection.Ascending));
+        }
+
+        private void MenuTimeBackSort_Click(object sender, RoutedEventArgs e)
+        {
+            ICollectionView v = CollectionViewSource.GetDefaultView(AnnotationList.ItemsSource);
+            CreateTimeToDate createTimeToDate = new CreateTimeToDate();
+            v.GroupDescriptions.Clear();
+            v.GroupDescriptions.Add(new PropertyGroupDescription(nameof(AnnotHandlerEventArgs.CreateTime), createTimeToDate));
+            v.SortDescriptions.Clear();
+            v.SortDescriptions.Add(new SortDescription(nameof(AnnotHandlerEventArgs.CreateTime), ListSortDirection.Descending));
+            v.SortDescriptions.Add(new SortDescription(nameof(AnnotHandlerEventArgs.AnnotIndex), ListSortDirection.Descending));
+        }
+
+        private void MenuPageSort_Click(object sender, RoutedEventArgs e)
+        {
+            ICollectionView v = CollectionViewSource.GetDefaultView(AnnotationList.ItemsSource);
+            v.GroupDescriptions.Clear();
+            v.GroupDescriptions.Add(new PropertyGroupDescription(nameof(AnnotHandlerEventArgs.PageIndex)));
+
+            v.SortDescriptions.Clear();
+            v.SortDescriptions.Add(new SortDescription(nameof(AnnotHandlerEventArgs.PageIndex), ListSortDirection.Ascending));
+            v.SortDescriptions.Add(new SortDescription(nameof(AnnotHandlerEventArgs.AnnotIndex), ListSortDirection.Ascending));
+        }
+
+        private void MenuItemCopyText_Click(object sender, RoutedEventArgs e)
+        {
+            if (AnnotationList.SelectedItems.Count == 1)
+            {
+                if (AnnotationList.SelectedItem is AnnotationHandlerEventArgs annotation)
+                {
+                    if (annotation.EventType == AnnotArgsType.AnnotFreeText)
+                    {
+                        StringBuilder Copystr = new StringBuilder();
+                        Copystr.Append(annotation.Content);
+                        System.Windows.Clipboard.SetText(Copystr.ToString());
+                        CustomControl.MessageBoxEx.Show("数据复制成功");
+                    }
+                }
+            }
+        }
+
+        private void MenuItemDelete_Click(object sender, RoutedEventArgs e)
+        {
+            List<int> pagelist = new List<int>();
+            for (int i = 0; i < AnnotationList.SelectedItems.Count; i++)
+            {
+                AnnotationHandlerEventArgs annotation = AnnotationList.SelectedItems[i] as AnnotationHandlerEventArgs;
+                pagelist.Add(AnnotationList.Items.IndexOf(annotation));
+            }
+            pagelist.Sort();
+            for (int i = 0; i < pagelist.Count; i++)
+            {
+                AnnotationHandlerEventArgs annotation = AnnotationList.Items[pagelist[pagelist.Count - i - 1]] as AnnotationHandlerEventArgs;
+                if (annotation == null)
+                {
+                    continue;
+                }
+
+                viewModel.DeleteCommand.Execute(annotation);
+            }
+        }
+    }
+}

File diff suppressed because it is too large
+ 351 - 0
PDF Office/Views/BOTA/AnnotationListItem.xaml


+ 208 - 0
PDF Office/Views/BOTA/AnnotationListItem.xaml.cs

@@ -0,0 +1,208 @@
+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.Model.BOTA;
+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;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.Views.BOTA
+{
+    /// <summary>
+    /// AnnotationListItem.xaml 的交互逻辑
+    /// </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:
+                    BtnAnnotFreeText.Visibility = Visibility.Visible;
+                    TxbMarkUpContent.Foreground = new SolidColorBrush((data as FreeTextAnnotArgs).FontColor);
+                    break;
+
+                case AnnotArgsType.AnnotHighlight:
+                    BtnHighlight.Visibility = Visibility.Visible;
+                    PathHighlight.Fill = new SolidColorBrush((data as TextHighlightAnnotArgs).Color);
+                    //TxbContext.Text = data.Content;
+                    if (!string.IsNullOrEmpty(TxbContext.Text))
+                    {
+                        TxbContext.Background = new SolidColorBrush((data as TextHighlightAnnotArgs).Color);
+                    }
+
+                    break;
+
+                case AnnotArgsType.AnnotFreehand:
+                    BtnFreeHand.Visibility = Visibility.Visible;
+                    PathFreehand.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://删除线
+                    BtnAnnotStrikeout.Visibility = Visibility.Visible;
+
+                    PathStrikeoutyColor.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)
+                    {
+                        BtnSharpArrow.Visibility = Visibility.Visible;
+                        PathArrow.Fill = new SolidColorBrush((data as LineAnnotArgs).LineColor);
+                    }
+                    else
+                    {
+                        PathSharpLine.Fill = new SolidColorBrush((data as LineAnnotArgs).LineColor);
+                        BtnSharpLine.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:
+                    BtnAnnotSquare.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:
+                    BtnAnnotCircle.Visibility = Visibility.Visible;
+                    EllipseCircle.Stroke = new SolidColorBrush((data as CircleAnnotArgs).LineColor);
+                    EllipseCircle.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;
+            }
+        }
+    }
+}

+ 27 - 15
PDF Office/Views/BOTA/BookmarkContent.xaml

@@ -20,6 +20,7 @@
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
                 <ResourceDictionary Source="pack://application:,,,/Styles/ListViewStyle.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
 
             <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
@@ -37,11 +38,20 @@
                             <ColumnDefinition Width="10*" />
                             <ColumnDefinition Width="90*" />
                         </Grid.ColumnDefinitions>
-                        <Image
-                            Grid.Column="0"
-                            Width="16"
-                            Height="16"
-                            Source="pack://application:,,,/Resources/BOTA/empty_bookmark.png" />
+                        <!--<Image
+                        Grid.Column="0"
+                        Width="16"
+                        Height="16"
+                        Source="pack://application:,,,/Resources/BOTA/empty_bookmark.png" />-->
+                        <Path Grid.Column="0"
+                              Width="16"
+                              Height="16" Data="M3 3.47368C3 2.65979 3.65979 2 4.47368 2H11.5263C12.3402 2 13 2.65979 13 3.47368V14.3044C13 14.9486 12.2314 15.2826 11.7604 14.843L8.50276 11.8026C8.21966 11.5384 7.78034 11.5384 7.49724 11.8026L4.2396 14.843C3.7686 15.2826 3 14.9486 3 14.3044V3.47368Z" Fill="#94989C">
+                            <Path.RenderTransform>
+                                <TransformGroup>
+                                    <TranslateTransform Y="-3" />
+                                </TransformGroup>
+                            </Path.RenderTransform>
+                        </Path>
                         <TextBox
                             Name="TxtTitleInput"
                             Grid.Column="1"
@@ -73,18 +83,12 @@
                 x:Key="ContextMenu"
                 DataContext="{Binding PlacementTarget.Tag, RelativeSource={RelativeSource Self}}"
                 FontSize="14">
-                <MenuItem
-                    Click="MenuItemRename_Click"
-                    CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}, Path=PlacementTarget.DataContext}"
-                    Header="重命名" />
+                <MenuItem Click="MenuItemRename_Click" Header="重命名" />
                 <MenuItem
                     Command="{Binding DataContext.EditPageIndexCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
                     CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}, Path=PlacementTarget.DataContext}"
                     Header="更改目标位置" />
-                <MenuItem
-                    Click="MenuItemDeleteCommand_Click"
-                    CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}, Path=PlacementTarget.DataContext}"
-                    Header="删除" />
+                <MenuItem Click="MenuItemDeleteCommand_Click" Header="删除" />
             </ContextMenu>
         </ResourceDictionary>
     </UserControl.Resources>
@@ -107,10 +111,18 @@
                 Width="40"
                 Height="40"
                 Margin="0,0,0,0"
+                Style="{StaticResource PageEditToolBtn}"
                 HorizontalAlignment="Right"
                 Command="{Binding AddBookmarkCommand}"
-                CommandParameter="{Binding ElementName=BookMarkListView}"
-                Content="添加" />
+                CommandParameter="{Binding ElementName=BookMarkListView}">
+                <Path Data="M13.5 8C13.5 11.0376 11.0376 13.5 8 13.5C4.96243 13.5 2.5 11.0376 2.5 8C2.5 4.96243 4.96243 2.5 8 2.5C11.0376 2.5 13.5 4.96243 13.5 8ZM15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM7.25005 4.80003V7.25003H4.80005V8.75003H7.25005V11.2H8.75005V8.75003H11.2V7.25003H8.75005V4.80003H7.25005Z" Fill="#616469">
+                    <Path.RenderTransform>
+                        <TransformGroup>
+                            <TranslateTransform Y="-3" />
+                        </TransformGroup>
+                    </Path.RenderTransform>
+                </Path>
+            </Button>
         </Grid>
         <Grid Grid.Row="1">
             <ListView

File diff suppressed because it is too large
+ 307 - 0
PDF Office/Views/Dialog/BOTA/AddAnnotationDialog.xaml


+ 28 - 0
PDF Office/Views/Dialog/BOTA/AddAnnotationDialog.xaml.cs

@@ -0,0 +1,28 @@
+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.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.Views.Dialog.BOTA
+{
+    /// <summary>
+    /// AddAnnotationDialog.xaml 的交互逻辑
+    /// </summary>
+    public partial class AddAnnotationDialog : UserControl
+    {
+        public AddAnnotationDialog()
+        {
+            InitializeComponent();
+        }
+    }
+}

File diff suppressed because it is too large
+ 448 - 0
PDF Office/Views/Dialog/BOTA/ScreenAnnotationDialog.xaml


+ 28 - 0
PDF Office/Views/Dialog/BOTA/ScreenAnnotationDialog.xaml.cs

@@ -0,0 +1,28 @@
+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.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.Views.Dialog.BOTA
+{
+    /// <summary>
+    /// ScreenAnnotationDialog.xaml 的交互逻辑
+    /// </summary>
+    public partial class ScreenAnnotationDialog : UserControl
+    {
+        public ScreenAnnotationDialog()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 93 - 107
PDF Office/Views/HomePanel/RecentFiles/RecentFilesContent.xaml

@@ -1,8 +1,8 @@
 <UserControl x:Class="PDF_Office.Views.HomePanel.RecentFiles.RecentFilesContent"
              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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
              xmlns:local="clr-namespace:PDF_Office.Views.HomePanel.RecentFiles"
              xmlns:customControl ="clr-namespace:PDF_Office.CustomControl"
              xmlns:DataConvert ="clr-namespace:PDF_Office.DataConvert"
@@ -14,28 +14,27 @@
     <UserControl.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="../../../Styles/ListViewStyle.xaml"/>
-                <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml"/>
-                <ResourceDictionary Source="../../../Styles/RadioButtonStyle.xaml"/>
-                <ResourceDictionary Source="../../../Styles/ButtonStyle.xaml"/>
+                <ResourceDictionary Source="../../../Styles/ListViewStyle.xaml" />
+                <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml" />
+                <ResourceDictionary Source="../../../Styles/RadioButtonStyle.xaml" />
+                <ResourceDictionary Source="../../../Styles/ButtonStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
-            <DataConvert:BoolToVisible x:Key="BoolToVisible"/>
-            <DataConvert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
-            <DataConvert:InvertBoolConvert x:Key="InvertBoolConvert"/>
+            <DataConvert:BoolToVisible x:Key="BoolToVisible" />
+            <DataConvert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
+            <DataConvert:InvertBoolConvert x:Key="InvertBoolConvert" />
 
             <DataTemplate x:Key="listviewItem">
                 <local:DocItemListViewControl HorizontalAlignment="Stretch"
                                               OpenFileItemHandler ="DocItemListViewControl_OpenFileItemHandler"
-                                              DeleteItemHandler="DocItemListViewControl_DeleteItemHandler"
-                                              />
+                                              DeleteItemHandler="DocItemListViewControl_DeleteItemHandler" />
             </DataTemplate>
 
             <DataTemplate x:Key="gridviewItem">
-                <local:DocItemControl HorizontalAlignment="Stretch"/>
+                <local:DocItemControl HorizontalAlignment="Stretch" />
             </DataTemplate>
 
             <ItemsPanelTemplate x:Key="listPanel">
-                <StackPanel Orientation="Vertical"/>
+                <StackPanel Orientation="Vertical" />
             </ItemsPanelTemplate>
 
             <ItemsPanelTemplate x:Key="gridPanel">
@@ -46,70 +45,67 @@
                          Opened="ContextMenu_Opened">
                 <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="FilePathMenuItem" Header="打开文件路径" IsEnabled="True" Click="FilePathMenuItem_Click">
                     <MenuItem.Icon>
                         <Path Fill="Black"
-                                              Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z">
+                              Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z">
                             <Path.RenderTransform>
-                                <TranslateTransform X="3.0000" Y="0"/>
+                                <TranslateTransform X="3.0000" Y="0" />
                             </Path.RenderTransform>
                         </Path>
                     </MenuItem.Icon>
                 </MenuItem>
-                
+
                 <MenuItem Name="DeleteMenuItem" Header="从最近列表删除" IsEnabled="True" Click="DeleteMenuItem_Click">
                     <MenuItem.Icon>
                         <Path Fill="Black" Data="M9 0H3V2H0V3H1V14H11V3H12V2H9V0ZM2 13V3H3H4H8H9H10V13H2ZM8 2V1H4V2H8ZM4 12V4H3V12H4ZM6.5 4V12H5.5V4H6.5ZM9 12V4H8V12H9Z">
                             <Path.RenderTransform>
-                                <TranslateTransform X="5.0000" Y="0"/>
+                                <TranslateTransform X="5.0000" Y="0" />
                             </Path.RenderTransform>
                         </Path>
                     </MenuItem.Icon>
                 </MenuItem>
-
             </ContextMenu>
 
             <Style x:Key="SubFilesListViewItemStyle" BasedOn="{StaticResource FilesListViewItemStyle}" TargetType="{x:Type ListViewItem}">
-                <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}"/>
-                <Setter Property="HorizontalContentAlignment" Value="Center"/>
-                <Setter Property="Margin" Value="12,0,0,0"/>
+                <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}" />
+                <Setter Property="HorizontalContentAlignment" Value="Center" />
+                <Setter Property="Margin" Value="12,0,0,0" />
                 <EventSetter Event="PreviewMouseRightButtonDown"
-                             Handler="ListViewItem_PreviewMouseRightButtonDown"/>
+                             Handler="ListViewItem_PreviewMouseRightButtonDown" />
                 <EventSetter Event="PreviewMouseDoubleClick"
                              Handler="RecentFilesList_PreviewMouseDoubleClick">
                 </EventSetter>
             </Style>
 
             <Style x:Key="HomeGridViewItemStyle" BasedOn="{StaticResource FilesGridItemStyle}" TargetType="{x:Type ListViewItem}">
-                <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}"/>
-                <Setter Property="HorizontalContentAlignment" Value="Center"/>
+                <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}" />
+                <Setter Property="HorizontalContentAlignment" Value="Center" />
                 <EventSetter Event="PreviewMouseRightButtonDown"
-                             Handler="ListViewItem_PreviewMouseRightButtonDown"/>
+                             Handler="ListViewItem_PreviewMouseRightButtonDown" />
                 <EventSetter Event="PreviewMouseDoubleClick"
-                             Handler="RecentFilesList_PreviewMouseDoubleClick"/>
+                             Handler="RecentFilesList_PreviewMouseDoubleClick" />
             </Style>
-
         </ResourceDictionary>
-
     </UserControl.Resources>
 
     <Grid>
         <Grid>
             <Grid.RowDefinitions>
-                <RowDefinition Height="Auto"/>
-                <RowDefinition Height="Auto"/>
+                <RowDefinition Height="Auto" />
+                <RowDefinition Height="Auto" />
                 <RowDefinition />
             </Grid.RowDefinitions>
             <Grid x:Name="GridRecentFilesTile" Margin="32,38,0,13">
-                <TextBlock x:Name="TxbRecentlyTile" Text="Recent" HorizontalAlignment="Left" FontWeight="Semibold" FontSize="20" Padding="0,6,0,0" Margin="0,0,0,0"/>
+                <TextBlock x:Name="TxbRecentlyTile" Text="Recent" HorizontalAlignment="Left" FontWeight="Semibold" FontSize="20" Padding="0,6,0,0" Margin="0,0,0,0" />
                 <StackPanel x:Name="PnlRightBtns" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,0,0" Orientation="Horizontal" HorizontalAlignment="Right">
                     <Border  Background="#EEF2F3" Height="30" CornerRadius="4" Padding="1,0,1,0">
                         <StackPanel Orientation="Horizontal">
-                            <RadioButton x:Name="BtnListMode" GroupName="Mode" Tag="ListMode" Width="40" Height="28" Foreground="#333333" 
+                            <RadioButton x:Name="BtnListMode" GroupName="Mode" Tag="ListMode" Width="40" Height="28" Foreground="#333333"
                                          HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
                                          IsChecked="{Binding IsListMode,Mode=OneTime}"
                                          Style="{StaticResource ListModeRadioBtnStyle}">
@@ -120,14 +116,14 @@
                                 </Grid>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="Checked">
-                                        <i:InvokeCommandAction Command="{Binding ListModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnListMode,Path =Tag}"/>
+                                        <i:InvokeCommandAction Command="{Binding ListModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnListMode,Path =Tag}" />
                                     </i:EventTrigger>
                                 </i:Interaction.Triggers>
                             </RadioButton>
 
                             <RadioButton x:Name="BtnGridMode" GroupName="Mode" Tag="GridMode" Width="40" Height="28" Foreground="#6B869C"
                                          HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
-                                        IsChecked="{Binding IsListMode,Converter={StaticResource InvertBoolConvert},Mode=OneTime}"
+                                         IsChecked="{Binding IsListMode,Converter={StaticResource InvertBoolConvert},Mode=OneTime}"
                                          Style="{StaticResource ListModeRadioBtnStyle}">
                                 <Grid  Margin="-5,0,0,0" HorizontalAlignment="Center">
                                     <Grid.RowDefinitions>
@@ -135,108 +131,98 @@
                                         <RowDefinition />
                                     </Grid.RowDefinitions>
                                     <Grid.ColumnDefinitions>
-                                        <ColumnDefinition/>
-                                        <ColumnDefinition/>
+                                        <ColumnDefinition />
+                                        <ColumnDefinition />
                                     </Grid.ColumnDefinitions>
-                                    <Rectangle Grid.Row="0" Grid.Column="0" Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round"/>
-                                    <Rectangle Grid.Row="0" Grid.Column="1"  Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round"/>
-                                    <Rectangle Grid.Row="1" Grid.Column="0"  Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round"/>
-                                    <Rectangle Grid.Row="1" Grid.Column="1"  Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round"/>
+                                    <Rectangle Grid.Row="0" Grid.Column="0" Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round" />
+                                    <Rectangle Grid.Row="0" Grid.Column="1"  Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round" />
+                                    <Rectangle Grid.Row="1" Grid.Column="0"  Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round" />
+                                    <Rectangle Grid.Row="1" Grid.Column="1"  Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round" />
                                 </Grid>
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="Checked">
-                                        <i:InvokeCommandAction Command="{Binding ListModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnGridMode,Path =Tag}"/>
+                                        <i:InvokeCommandAction Command="{Binding ListModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnGridMode,Path =Tag}" />
                                     </i:EventTrigger>
                                 </i:Interaction.Triggers>
                             </RadioButton>
                         </StackPanel>
                     </Border>
-                    
-                    <Separator  Margin="1 0 1 0" Width="1" Height="16" BorderBrush="#1A000000" BorderThickness="1"/>
 
-                    <Button x:Name="BtnDelete" Margin="0" Padding="0,0,0,0" MaxHeight="40" Width="28" Height="28" Background="Transparent" BorderThickness="0" 
+                    <Separator  Margin="1 0 1 0" Width="1" Height="16" BorderBrush="#1A000000" BorderThickness="1" />
+
+                    <Button x:Name="BtnDelete" Margin="0" Padding="0,0,0,0" MaxHeight="40" Width="28" Height="28" Background="Transparent" BorderThickness="0"
                             IsEnabled="{Binding IsEmpty,Converter={StaticResource InvertBoolConvert},Mode=OneWay}"
                             Command="{Binding RemoveFilesFromContainerCommand}" CommandParameter="{Binding ElementName=RecentFilesList,Path=SelectedItems}"
-                         Style="{StaticResource OnlyContentBtn}" Foreground="#6B6F7D"
-                            >
+                            Style="{StaticResource OnlyContentBtn}" Foreground="#6B6F7D">
                         <Grid Width="20" Height="20">
-                            <Path Data="M8 2H12" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round"/>
-                            <Path Data="M5 5V17H15V5" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round"/>
-                            <Path Data="M17 5H3" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round"/>
-                            <Path Data="M10 9V13" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round"/>
+                            <Path Data="M8 2H12" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round" />
+                            <Path Data="M5 5V17H15V5" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round" />
+                            <Path Data="M17 5H3" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round" />
+                            <Path Data="M10 9V13" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round" />
                         </Grid>
                     </Button>
-
                 </StackPanel>
-
             </Grid>
 
-                <Grid  Grid.Row="2" Visibility="{Binding IsEmpty,Converter={StaticResource InvertBoolToVisibleConvert}}">
-                    <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="799*"/>
-                        <ColumnDefinition Width="*"/>
-                    </Grid.ColumnDefinitions>
+            <Grid  Grid.Row="2" Visibility="{Binding IsEmpty,Converter={StaticResource InvertBoolToVisibleConvert}}">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="799*" />
+                    <ColumnDefinition Width="*" />
+                </Grid.ColumnDefinitions>
                 <Border Visibility="{Binding IsListMode,Converter={StaticResource BoolToVisible}}">
-                    <ListView x:Name="RecentFilesList" 
-                      ItemsSource="{Binding RecentFilesGroup}"
-                      Margin="32,0,0,0"
-                      VirtualizingPanel.IsVirtualizing="True" 
-                      VirtualizingPanel.CacheLengthUnit="Page"
-                      VirtualizingPanel.CacheLength="1"
-                      VirtualizingPanel.ScrollUnit="Pixel"
-                      ScrollViewer.HorizontalScrollBarVisibility="Disabled"
-                      ScrollViewer.VerticalScrollBarVisibility="Auto"
-                      Background="Transparent" BorderThickness="0" 
-                      Padding="0,0,0,0" MinHeight="216" MinWidth="380" 
-                      SelectionMode="Multiple"
-                      ItemContainerStyle="{StaticResource SubFilesListViewItemStyle}"
-                      Style="{StaticResource FilesListViewStyle}"
-                      ItemTemplate="{StaticResource listviewItem}"
-                     ItemsPanel="{StaticResource listPanel}" Grid.ColumnSpan="2"
-                     >
+                    <ListView x:Name="RecentFilesList"
+                              ItemsSource="{Binding RecentFilesGroup}"
+                              Margin="32,0,0,0"
+                              VirtualizingPanel.IsVirtualizing="True"
+                              VirtualizingPanel.CacheLengthUnit="Page"
+                              VirtualizingPanel.CacheLength="1"
+                              VirtualizingPanel.ScrollUnit="Pixel"
+                              ScrollViewer.HorizontalScrollBarVisibility="Disabled"
+                              ScrollViewer.VerticalScrollBarVisibility="Auto"
+                              Background="Transparent" BorderThickness="0"
+                              Padding="0,0,0,0" MinHeight="216" MinWidth="380"
+                              SelectionMode="Multiple"
+                              ItemContainerStyle="{StaticResource SubFilesListViewItemStyle}"
+                              Style="{StaticResource FilesListViewStyle}"
+                              ItemTemplate="{StaticResource listviewItem}"
+                              ItemsPanel="{StaticResource listPanel}" Grid.ColumnSpan="2">
                     </ListView>
                 </Border>
-                   
 
-                    <ListView x:Name="GridRecentFilesList" 
-                      Visibility="{Binding IsListMode,Converter={StaticResource InvertBoolToVisibleConvert}}"
-                      ItemsSource="{Binding RecentFilesGroup}"   
-                      Margin="32,0,0,0"
-                      VirtualizingPanel.IsVirtualizing="True" 
-                      VirtualizingPanel.CacheLengthUnit="Page"
-                      VirtualizingPanel.CacheLength="1"
-                      VirtualizingPanel.ScrollUnit="Pixel"
-                      ScrollViewer.HorizontalScrollBarVisibility="Disabled"
-                      ScrollViewer.VerticalScrollBarVisibility="Auto"
-                      Background="Transparent" BorderThickness="0" 
-                      Padding="0,0,0,0" MinHeight="216" MinWidth="380" 
-                      SelectionMode="Multiple"
-                      ItemContainerStyle="{StaticResource HomeGridViewItemStyle}"
-                      Style="{StaticResource FilesGridViewStyle}"
-                      ItemTemplate="{StaticResource gridviewItem}"
-                     ItemsPanel="{StaticResource gridPanel}" Grid.ColumnSpan="2"
-                     >
-                    </ListView>
-
-                </Grid>
+                <ListView x:Name="GridRecentFilesList"
+                          Visibility="{Binding IsListMode,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                          ItemsSource="{Binding RecentFilesGroup}"
+                          Margin="32,0,0,0"
+                          VirtualizingPanel.IsVirtualizing="True"
+                          VirtualizingPanel.CacheLengthUnit="Page"
+                          VirtualizingPanel.CacheLength="1"
+                          VirtualizingPanel.ScrollUnit="Pixel"
+                          ScrollViewer.HorizontalScrollBarVisibility="Disabled"
+                          ScrollViewer.VerticalScrollBarVisibility="Auto"
+                          Background="Transparent" BorderThickness="0"
+                          Padding="0,0,0,0" MinHeight="216" MinWidth="380"
+                          SelectionMode="Multiple"
+                          ItemContainerStyle="{StaticResource HomeGridViewItemStyle}"
+                          Style="{StaticResource FilesGridViewStyle}"
+                          ItemTemplate="{StaticResource gridviewItem}"
+                          ItemsPanel="{StaticResource gridPanel}" Grid.ColumnSpan="2">
+                </ListView>
+            </Grid>
 
-            <StackPanel x:Name="BlankContentPanel" Grid.Row="1" Grid.RowSpan="2"  HorizontalAlignment="Center" VerticalAlignment="Center" 
+            <StackPanel x:Name="BlankContentPanel" Grid.Row="1" Grid.RowSpan="2"  HorizontalAlignment="Center" VerticalAlignment="Center"
                         Visibility="{Binding IsEmpty,Converter={StaticResource BoolToVisible}}">
-                <!--<Image Source="../../Resources/Image/Home/empty_recent2x.png" Width="140" Height="140" Stretch="Uniform" VerticalAlignment="Center"/>-->
+                <!--<Image Source="../../Resources/Image/Home/empty_recent2x.png" Width="140" Height="140" Stretch="Uniform" VerticalAlignment="Center" />-->
                 <TextBlock x:Name="NoFilesText" Text="No documents" TextAlignment="Center"  HorizontalAlignment="Center" FontSize="16" LineHeight="22" Foreground="#FF333333" FontFamily="Segoe UI" />
                 <StackPanel Orientation="Horizontal" Margin="0,12,0,0">
-                    <TextBlock x:Name="clickFileText" Text="Drop documents here or click the '" Foreground="#FF999999" VerticalAlignment="Center" FontSize="14"/>
+                    <TextBlock x:Name="clickFileText" Text="Drop documents here or click the '" Foreground="#FF999999" VerticalAlignment="Center" FontSize="14" />
                     <TextBlock  Margin="2,0,2,0" VerticalAlignment="Center" FontSize="15">
                         <Hyperlink  Command="{Binding OpenFilesCommand}">
-                            <TextBlock x:Name="OpenFilesLinkText" Text="Open Files"/>
+                            <TextBlock x:Name="OpenFilesLinkText" Text="Open Files" />
                         </Hyperlink>
                     </TextBlock>
-                    <TextBlock x:Name="dropFileText" Text="' button in the Sidebar" Foreground="#FF999999" VerticalAlignment="Center" FontSize="14"/>
+                    <TextBlock x:Name="dropFileText" Text="' button in the Sidebar" Foreground="#FF999999" VerticalAlignment="Center" FontSize="14" />
                 </StackPanel>
-
             </StackPanel>
-
         </Grid>
     </Grid>
-
-</UserControl>
+</UserControl>

+ 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>

+ 53 - 0
PDF Office/Views/PropertyPanel/ViewModular/ReadViewContent.xaml

@@ -0,0 +1,53 @@
+<UserControl
+    x:Class="PDF_Office.Views.PropertyPanel.ViewModular.ReadViewContent"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:Viewer="clr-namespace:ComPDFKitViewer.PdfViewer;assembly=ComPDFKit.Viewer"
+    xmlns:convert="clr-namespace:PDF_Office.DataConvert"
+    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.ViewModular"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    xmlns:viewmodels="clr-namespace:PDF_Office.ViewModels.PropertyPanel.ViewModular"
+    d:DataContext="{d:DesignInstance Type=viewmodels:ReadViewContentViewModel}"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    KeyDown="UserControl_KeyDown"
+    mc:Ignorable="d">
+    <i:Interaction.Triggers>
+        <i:EventTrigger EventName="Loaded">
+            <prism:InvokeCommandAction Command="{Binding Load}" />
+        </i:EventTrigger>
+    </i:Interaction.Triggers>
+    <Grid>
+        <ContentControl
+            x:Name="PDFViewerContent"
+            HorizontalAlignment="Stretch"
+            prism:RegionManager.RegionName="{Binding ReadRegionName}" />
+        <!--阅读模式下的页面控件-->
+        <ContentControl
+            x:Name="ReadModeContent"
+            Height="44"
+            Margin="0,0,0,5"
+            HorizontalAlignment="Center"
+            VerticalAlignment="Bottom"
+            prism:RegionManager.RegionName="{Binding ReadModeRegionName}"
+            MouseEnter="RectangleReadMode_MouseEnter"
+            MouseLeave="ReadModeContent_MouseLeave"
+            Visibility="{Binding ReadModeContentVisibility}" />
+
+        <Rectangle
+            x:Name="RectangleReadMode"
+            Width="{Binding ActualWidth, ElementName=ReadModeContent, Mode=OneWay}"
+            Height="44"
+            Margin="0,0,0,5"
+            HorizontalAlignment="Center"
+            VerticalAlignment="Bottom"
+            Fill="Transparent"
+            MouseEnter="RectangleReadMode_MouseEnter"
+            Visibility="{Binding RectangleReadModeVisibility}" />
+    </Grid>
+</UserControl>

+ 63 - 0
PDF Office/Views/PropertyPanel/ViewModular/ReadViewContent.xaml.cs

@@ -0,0 +1,63 @@
+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.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using System.Windows.Threading;
+
+namespace PDF_Office.Views.PropertyPanel.ViewModular
+{
+    /// <summary>
+    /// ReadViewContent.xaml 的交互逻辑
+    /// </summary>
+    public partial class ReadViewContent : UserControl
+    {
+        public ReadViewContent()
+        {
+            InitializeComponent();
+        }
+
+        /// <summary>
+        /// 鼠标移动到控件范围时显示控件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void RectangleReadMode_MouseEnter(object sender, MouseEventArgs e)
+        {
+            Dispatcher.BeginInvoke(DispatcherPriority.Send, new Action(delegate
+            {
+                if (App.IsBookMode)
+                {
+                    this.ReadModeContent.Visibility = Visibility.Visible;
+                    this.RectangleReadMode.Visibility = Visibility.Collapsed;
+                }
+            }));
+        }
+
+        /// <summary>
+        /// 鼠标移开页面控件,三秒后隐藏该控件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private async void ReadModeContent_MouseLeave(object sender, MouseEventArgs e)
+        {
+            await System.Threading.Tasks.Task.Delay(3000);
+            //Thread.Sleep(3000);
+            this.ReadModeContent.Visibility = Visibility.Collapsed;
+            this.RectangleReadMode.Visibility = Visibility.Visible;
+        }
+
+        private void UserControl_KeyDown(object sender, KeyEventArgs e)
+        {
+        }
+    }
+}

+ 3 - 3
PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml.cs

@@ -41,10 +41,10 @@ namespace PDF_Office.Views.PropertyPanel.ViewModular
                 {
                     if (main.ContentMain.Content is ViewContent viewContent)
                     {
-                        viewContent.RbtnReadMode_Click(sender, e);
-
+                        //viewContent.RbtnReadMode(sender, e);
+                        ViewContentViewModel model = viewContent.DataContext as ViewContentViewModel;
+                        model.RbtnReadMode(viewContent);
                     }
-
                 }
             }
         }

+ 4 - 34
PDF Office/Views/ViewContent.xaml

@@ -172,11 +172,8 @@
             </TabControl>
         </Grid>
 
-        <!--底部工具栏-->
-        <ContentControl
-            Grid.Row="3"
-            prism:RegionManager.RegionName="{Binding BottomToolRegionName}"
-            Visibility="{Binding IsReadMode}" />
+        <!--  底部工具栏  -->
+        <ContentControl Grid.Row="3" prism:RegionManager.RegionName="{Binding BottomToolRegionName}" />
 
         <!--  专门用来显示菜单二级工具栏  -->
         <!--  调整工具栏的显示图层,方便阅读模式处理  -->
@@ -226,7 +223,7 @@
                 </ColumnDefinition>
             </Grid.ColumnDefinitions>
 
-            <ContentControl prism:RegionManager.RegionName="{Binding BOTARegionName}" Visibility="{Binding IsReadMode}" />
+            <ContentControl prism:RegionManager.RegionName="{Binding BOTARegionName}" />
             <GridSplitter
                 Grid.Column="1"
                 Width="12"
@@ -239,34 +236,8 @@
                 HorizontalAlignment="Stretch"
                 prism:RegionManager.RegionName="{Binding ViwerRegionName}" />
             <ScrollViewer Grid.Column="4" VerticalScrollBarVisibility="Auto">
-                <ContentControl prism:RegionManager.RegionName="{Binding PropertyRegionName}" Visibility="{Binding IsReadMode}" />
+                <ContentControl prism:RegionManager.RegionName="{Binding PropertyRegionName}" />
             </ScrollViewer>
-            <!--  阅读模式下的页面控件  -->
-            <ContentControl
-                x:Name="ReadModeContent"
-                Grid.Column="0"
-                Grid.ColumnSpan="5"
-                Height="44"
-                Margin="0,0,0,5"
-                HorizontalAlignment="Center"
-                VerticalAlignment="Bottom"
-                prism:RegionManager.RegionName="{Binding ReadModeRegionName}"
-                MouseEnter="RectangleReadMode_MouseEnter"
-                MouseLeave="ReadModeContent_MouseLeave"
-                Visibility="Collapsed" />
-
-            <Rectangle
-                x:Name="RectangleReadMode"
-                Grid.Column="0"
-                Grid.ColumnSpan="5"
-                Width="{Binding ActualWidth, ElementName=ReadModeContent, Mode=OneWay}"
-                Height="44"
-                Margin="0,0,0,5"
-                HorizontalAlignment="Center"
-                VerticalAlignment="Bottom"
-                Fill="Transparent"
-                MouseEnter="RectangleReadMode_MouseEnter"
-                Visibility="Collapsed" />
         </Grid>
 
         <!--  用于显示页面编辑、水印、背景、标记密文等功能的区域  -->
@@ -277,6 +248,5 @@
             prism:RegionManager.RegionName="{Binding ToolContentRegionName}"
             Visibility="{Binding ToolContentVisible}" />
         <cus:LoadingControl Grid.RowSpan="3" Visibility="{Binding IsLoading}" />
-
     </Grid>
 </UserControl>

+ 7 - 93
PDF Office/Views/ViewContent.xaml.cs

@@ -1,8 +1,12 @@
 using ComPDFKitViewer;
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.Model;
 using PDF_Office.ViewModels;
 using PDF_Office.Views.PropertyPanel.ViewModular;
+using Prism.Regions;
 using System;
 using System.Threading;
+using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
@@ -24,67 +28,6 @@ namespace PDF_Office.Views
             viewModel = (ViewContentViewModel)this.DataContext;
         }
 
-        /// <summary>
-        /// 阅读模式
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        public void RbtnReadMode_Click(object sender, RoutedEventArgs e)
-        {
-            if (viewModel != null)
-            {
-                App.IsBookMode = true;
-                SetReadMode(true);
-            }
-        }
-
-        /// <summary>
-        /// 设置阅读模式下的控件
-        /// </summary>
-        /// <param name="isBookMode"></param>
-        private void SetReadMode(bool isBookMode)
-        {
-            if (isBookMode)
-            {
-                viewModel.IsReadMode = Visibility.Collapsed;
-                viewModel.IsPropertyOpen = false;
-                //viewModel.ToolContentVisible = Visibility.Collapsed;
-                //viewModel.ToolsBarContentVisible = Visibility.Collapsed;
-                //viewModel.ConverterBarContentVisible = Visibility.Collapsed;
-                this.ReadModeContent.Visibility = Visibility.Visible;
-                this.RectangleReadMode.Visibility = Visibility.Collapsed;
-                Grid.SetColumn(this.PDFViewerContent, 0);
-                Grid.SetColumnSpan(this.PDFViewerContent, 4);
-                Grid.SetRow(this.DocumentView, 0);
-                Grid.SetRowSpan(this.DocumentView, 4);
-            }
-            else
-            {
-                viewModel.IsReadMode = Visibility.Visible;
-                viewModel.IsPropertyOpen = true;
-                //if (viewModel.CurrentBar == "TabItemConvert")
-                //{
-                //    viewModel.ConverterBarContentVisible = Visibility.Visible;
-                //}
-                //else if (viewModel.CurrentBar == "TabItemPageEdit")
-                //{
-                //    viewModel.ToolContentVisible = Visibility.Visible;
-                //}
-                //else
-                //{
-                //    viewModel.ToolsBarContentVisible = Visibility.Visible;
-                //}
-                //viewModel.ToolContentVisible = Visibility.Visible;
-
-                this.ReadModeContent.Visibility = Visibility.Collapsed;
-                this.RectangleReadMode.Visibility = Visibility.Visible;
-                Grid.SetColumn(this.PDFViewerContent, 2);
-                Grid.SetColumnSpan(this.PDFViewerContent, 1);
-                Grid.SetRow(this.DocumentView, 2);
-                Grid.SetRowSpan(this.DocumentView, 1);
-            }
-        }
-
         /// <summary>
         /// 退出阅读模式
         /// </summary>
@@ -96,40 +39,11 @@ namespace PDF_Office.Views
             {
                 if (viewModel != null)
                 {
-                    App.IsBookMode = false;
-                    SetReadMode(false);
+                    //App.IsBookMode = false;
+                    //SetReadMode(false);
+                    viewModel.UnReadModel();
                 }
             }
         }
-
-        /// <summary>
-        /// 鼠标移开页面控件,三秒后隐藏该控件
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private async void ReadModeContent_MouseLeave(object sender, RoutedEventArgs e)
-        {
-            await System.Threading.Tasks.Task.Delay(3000);
-            //Thread.Sleep(3000);
-            this.ReadModeContent.Visibility = Visibility.Collapsed;
-            this.RectangleReadMode.Visibility = Visibility.Visible;
-        }
-
-        /// <summary>
-        /// 鼠标移动到控件范围时显示控件
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void RectangleReadMode_MouseEnter(object sender, MouseEventArgs e)
-        {
-            Dispatcher.BeginInvoke(DispatcherPriority.Send, new Action(delegate
-            {
-                if (App.IsBookMode)
-                {
-                    this.ReadModeContent.Visibility = Visibility.Visible;
-                    this.RectangleReadMode.Visibility = Visibility.Collapsed;
-                }
-            }));
-        }
     }
 }