Browse Source

Merge branch 'dev' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into dev

lvle 1 year ago
parent
commit
89ab223534
49 changed files with 1058 additions and 510 deletions
  1. BIN
      PDF Office/ComPDFKit.Viewer.dll
  2. 11 5
      PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml
  3. 72 31
      PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml.cs
  4. 1 0
      PDF Office/CustomControl/ToastControl.xaml
  5. 5 1
      PDF Office/EventAggregators/PageEditNotifyEvent.cs
  6. 35 0
      PDF Office/EventAggregators/ViewContentEvent.cs
  7. 22 0
      PDF Office/Helper/CacheFilePath.cs
  8. 6 3
      PDF Office/Model/AnnotPanel/FontBoard.cs
  9. 1 1
      PDF Office/Model/PropertyPanel/AnnotPanel/FontStyleItem.cs
  10. 1 0
      PDF Office/PDF Master.csproj
  11. 6 0
      PDF Office/PDF Master.csproj.user
  12. BIN
      PDF Office/Resources/BOTA/HideAnnot.png
  13. 1 2
      PDF Office/Styles/ExpanderStyle.xaml
  14. 8 0
      PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs
  15. 18 9
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs
  16. 9 1
      PDF Office/ViewModels/Dialog/PropertiesDialogViewModel.cs
  17. 29 70
      PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs
  18. 125 56
      PDF Office/ViewModels/FillAndSign/PropertyPanel/ShapFillPropertyViewModel.cs
  19. 2 2
      PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs
  20. 57 4
      PDF Office/ViewModels/MainContentViewModel.cs
  21. 44 16
      PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs
  22. 95 16
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs
  23. 85 45
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs
  24. 16 2
      PDF Office/ViewModels/PropertyPanel/ViewModular/ViewModularContentViewModel.cs
  25. 6 2
      PDF Office/ViewModels/Tools/AnnotManager/AnnotTransfer.cs
  26. 87 55
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs
  27. 61 20
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs
  28. 28 24
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Layout.cs
  29. 1 1
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs
  30. 7 7
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs
  31. 3 1
      PDF Office/ViewModels/ViewContentViewModel.cs
  32. 6 3
      PDF Office/Views/BOTA/AnnotationContent.xaml
  33. 37 2
      PDF Office/Views/BOTA/AnnotationContent.xaml.cs
  34. 2 0
      PDF Office/Views/BOTA/BookmarkContent.xaml
  35. 8 6
      PDF Office/Views/Dialog/FullScreenWindow.xaml
  36. 4 2
      PDF Office/Views/Dialog/PropertiesDialog.xaml
  37. 56 47
      PDF Office/Views/FillAndSign/PropertyPanel/ShapFillProperty.xaml
  38. 5 6
      PDF Office/Views/HomeContent.xaml
  39. 2 2
      PDF Office/Views/HomePanel/HomeGuidContent.xaml
  40. 9 11
      PDF Office/Views/HomePanel/PDFTools/QuickToolsContent.xaml
  41. 19 13
      PDF Office/Views/HomePanel/PromotionContent.xaml
  42. 3 4
      PDF Office/Views/HomePanel/RecentFiles/DocItemControl.xaml
  43. 17 19
      PDF Office/Views/HomePanel/RecentFiles/DocItemListViewControl.xaml
  44. 11 9
      PDF Office/Views/HomePanel/RecentFiles/RecentFilesContent.xaml
  45. 6 5
      PDF Office/Views/MainWindow.xaml.cs
  46. 2 2
      PDF Office/Views/PageEdit/PageEditContent.xaml
  47. 11 0
      PDF Office/Views/PageEdit/PageEditContent.xaml.cs
  48. 2 0
      PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml
  49. 16 5
      PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml.cs

BIN
PDF Office/ComPDFKit.Viewer.dll


+ 11 - 5
PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml

@@ -2,6 +2,7 @@
     x:Class="PDF_Master.CustomControl.CompositeControl.CustomComboControl"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:convert="clr-namespace:PDF_Master.DataConvert"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:local="clr-namespace:PDF_Master.CustomControl.CompositeControl"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -16,14 +17,19 @@
                 <ResourceDictionary Source="../../Styles/SliderStyle.xaml" />
                 <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
-
+            <convert:BoolToVisible x:Key="BoolToVisible" />
             <DataTemplate x:Key="numberData">
-                <Grid>
+                <StackPanel Orientation="Horizontal">
+                    <!--<TextBlock
+                    HorizontalAlignment="Center"
+                    VerticalAlignment="Center"
+                    Text="*"
+                    Visibility="{Binding NeedFrontTag, Converter={StaticResource BoolToVisible}}" />-->
                     <TextBlock
                         HorizontalAlignment="Center"
                         VerticalAlignment="Center"
                         Text="{Binding Content}" />
-                </Grid>
+                </StackPanel>
             </DataTemplate>
         </ResourceDictionary>
     </UserControl.Resources>
@@ -47,6 +53,7 @@
                         BorderThickness="1"
                         ItemTemplate="{StaticResource numberData}"
                         MaxDropDownHeight="200" />
+
                     <TextBox
                         Name="title"
                         Height="20"
@@ -62,5 +69,4 @@
             </Border>
         </Grid>
     </Grid>
-
-</UserControl>
+</UserControl>

+ 72 - 31
PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml.cs

@@ -21,67 +21,100 @@ namespace PDF_Master.CustomControl.CompositeControl
     //SetItemSource(List<ComboDataItem> items)更换集合List
     //默认:字体集合、IsValueContent为false、Value作为集合某项的值
 
-
     public class ComboDataItem : Prism.Mvvm.BindableBase
     {
+        //private bool needFrontTag = false;
+
+        //public bool NeedFrontTag
+        //{
+        //    get { return needFrontTag; }
+        //    set
+        //    {
+        //        SetProperty(ref needFrontTag, value);
+        //    }
+        //}
+
         //字符串类型的值
         public string ValueStr { get; private set; }
+
         //数字类型的值
         public double Value { get; private set; }
+
         //public string Content { get; private set; }
         //下拉框显示的内容
         private string _content = "";
+
         public string Content
         {
             get { return _content; }
             private set { SetProperty(ref _content, value); }
         }
+
         //下拉框显示的内容+单位:限数字值的单位
         public string Unit { get; private set; }
+
         //数字类型
         public ComboDataItem(double value, string unitStr = "")
         {
             Content = value + unitStr;
             Value = value;
         }
+
         //字符串类型
         public ComboDataItem(string valueStr, string contentStr = "")
         {
             Content = contentStr;
             ValueStr = valueStr;
+            //this.NeedFrontTag = needFrontTag;
         }
 
         public void SetContent(string content)
         {
             Content = content;
         }
-
     }
+
     /// <summary>
     /// CustomComboControl.xaml 的交互逻辑
     /// </summary>
     public partial class CustomComboControl : UserControl
     {
         public List<ComboDataItem> Items { get; private set; }
+
         public event RoutedEventHandler ValueChanged;
 
+        //private string titleStr;
+
+        //public string Title
+        //{
+        //    get
+        //    {
+        //        titleStr = title.Text;
+        //        return titleStr;
+        //    }
+        //    set
+        //    {
+        //        title.Text = titleStr;
+        //    }
+        //}
+
         public CustomComboControl()
         {
             InitializeComponent();
             Items = new List<ComboDataItem>();
             DefaultItems();
         }
+
         private void UserControl_Loaded(object sender, RoutedEventArgs e)
         {
             comBox.SelectionChanged -= comBox_SelectionChanged;
             comBox.SelectionChanged += comBox_SelectionChanged;
         }
 
-
         //更换集合
         public void SetItemSource(List<ComboDataItem> items)
         {
-            SelectedIndex = - 1;//为了触发SelectedIndex
+            SelectedIndex = -1;//为了触发SelectedIndex
             Items = items;
             ItemSource = Items;
         }
@@ -112,7 +145,7 @@ namespace PDF_Master.CustomControl.CompositeControl
             Items.Add(item);
             ItemSource = Items;
         }
- 
+
         //下拉框选中项
         private void comBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
@@ -127,16 +160,12 @@ namespace PDF_Master.CustomControl.CompositeControl
                     Value = item.Value;
                     ValueChanged?.Invoke(Value, null);
                 }
-                    
                 else
                 {
                     ValueStr = item.ValueStr;
                     ValueChanged?.Invoke(ValueStr, null);
                 }
-
             }
-
-
         }
 
         //在外部判断值是否存在于下拉框里
@@ -193,6 +222,26 @@ namespace PDF_Master.CustomControl.CompositeControl
             set { SetValue(SelectedItemsProperty, value); }
         }
 
+        //标题
+        public string Title
+        {
+            get { return (string)GetValue(TitleProperty); }
+            set { SetValue(TitleProperty, value); }
+        }
+
+        public static readonly DependencyProperty TitleProperty =
+        DependencyProperty.Register("Title", typeof(string), typeof(CustomComboControl), new PropertyMetadata("", TitlePropertyChanged));
+
+        private static void TitlePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var control = d as CustomComboControl;
+            var title = (string)e.NewValue;
+            if (control != null)
+            {
+                control.title.Text = title;
+            }
+        }
+
         //外部需要下拉框都不选中时,true为不选中,false为正常选中
         public bool IsSelectedEmpty
         {
@@ -201,34 +250,32 @@ namespace PDF_Master.CustomControl.CompositeControl
         }
 
         public static readonly DependencyProperty IsSelectedEmptyProperty =
-    DependencyProperty.Register("IsSelectedEmpty", typeof(bool), typeof(CustomComboControl), new PropertyMetadata(false, IsSelectedEmptyPropertyChanged));
-
+        DependencyProperty.Register("IsSelectedEmpty", typeof(bool), typeof(CustomComboControl), new PropertyMetadata(false, IsSelectedEmptyPropertyChanged));
 
         public static readonly DependencyProperty SelectedItemsProperty =
-         DependencyProperty.Register("SelectedItems", typeof(ComboDataItem), typeof(CustomComboControl), new PropertyMetadata(null, SelectedItemsPropertyChanged));
-
+        DependencyProperty.Register("SelectedItems", typeof(ComboDataItem), typeof(CustomComboControl), new PropertyMetadata(null, SelectedItemsPropertyChanged));
 
         public static readonly DependencyProperty ValueProperty =
-           DependencyProperty.Register("Value", typeof(double), typeof(CustomComboControl), new PropertyMetadata(1.0));
+        DependencyProperty.Register("Value", typeof(double), typeof(CustomComboControl), new PropertyMetadata(1.0));
 
         public static readonly DependencyProperty ValueStrProperty =
-         DependencyProperty.Register("ValueStr", typeof(string), typeof(CustomComboControl), new PropertyMetadata(""));
+        DependencyProperty.Register("ValueStr", typeof(string), typeof(CustomComboControl), new PropertyMetadata(""));
 
         public static readonly DependencyProperty ItemSourceProperty =
-          DependencyProperty.Register("ItemSource", typeof(List<ComboDataItem>), typeof(CustomComboControl), new PropertyMetadata(null, SelectedItemSourcePropertyChanged));
+        DependencyProperty.Register("ItemSource", typeof(List<ComboDataItem>), typeof(CustomComboControl), new PropertyMetadata(null, SelectedItemSourcePropertyChanged));
 
         public static readonly DependencyProperty SelectedIndexProperty =
         DependencyProperty.Register("SelectedIndex", typeof(int), typeof(CustomComboControl), new PropertyMetadata(-1, SelectedIndexPropertyChanged));
 
         public static readonly DependencyProperty IsValueContentProperty =
-          DependencyProperty.Register("IsValueContent", typeof(bool), typeof(CustomComboControl), new PropertyMetadata(false));
+        DependencyProperty.Register("IsValueContent", typeof(bool), typeof(CustomComboControl), new PropertyMetadata(false));
 
         //集合绑定下拉框 SelectedItems触发属性
         private static void IsSelectedEmptyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
         {
             var control = d as CustomComboControl;
             var isSelectedEmpty = (bool)e.NewValue;
-            if(control != null)
+            if (control != null)
             {
                 //弃用:IsSelectedEmpty属性,可用SelectedItems == null来处理下拉框不选中的情况。
 
@@ -241,7 +288,6 @@ namespace PDF_Master.CustomControl.CompositeControl
                 //}
             }
         }
-        
 
         private static void SelectedItemsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
         {
@@ -249,7 +295,7 @@ namespace PDF_Master.CustomControl.CompositeControl
             var selectedItems = (ComboDataItem)e.NewValue;
             if (control != null /* && control.IsSelectedEmpty == false*/)
             {
-                if(selectedItems != null)
+                if (selectedItems != null)
                 {
                     if (control.comBox.Items != null && control.comBox.Items.Count > 0)
                     {
@@ -280,10 +326,9 @@ namespace PDF_Master.CustomControl.CompositeControl
                         if (temp != null)
                             index = control.Items.IndexOf(temp);
 
-
                         if (index >= 0)
                         {
-                            if(control.SelectedIndex != index)
+                            if (control.SelectedIndex != index)
                             {
                                 control.SelectedIndex = index;
                             }
@@ -292,10 +337,8 @@ namespace PDF_Master.CustomControl.CompositeControl
                         }
                         else
                             control.title.Text = selectedItems.Content;
-
                     }
                 }
-
                 else
                 {
                     control.comBox.SelectedItem = null;
@@ -303,10 +346,7 @@ namespace PDF_Master.CustomControl.CompositeControl
                     control.SelectedItems = null;
                     control.title.Text = "";
                 }
-              
-
             }
-            
         }
 
         //集合绑定下拉框Itemsource触发属性
@@ -330,10 +370,10 @@ namespace PDF_Master.CustomControl.CompositeControl
             var selectedIndex = (int)e.NewValue;
             if (control != null /*&& control.IsSelectedEmpty == false*/)
             {
-                if(control.comBox.Items != null && control.comBox.Items.Count > 0 && selectedIndex != -1)
+                if (control.comBox.Items != null && control.comBox.Items.Count > 0 && selectedIndex != -1)
                 {
                     control.comBox.SelectedIndex = selectedIndex;
-                    if (control.comBox.SelectedItem != null )
+                    if (control.comBox.SelectedItem != null)
                         control.SelectedItems = (ComboDataItem)control.comBox.SelectedItem;
                     else
                         control.SelectedItems = null;
@@ -341,10 +381,11 @@ namespace PDF_Master.CustomControl.CompositeControl
                 control.UpdateSelectedIndex();
             }
         }
+
         //选中项后,更新控件选中的显示内容
         public void UpdateSelectedIndex()
         {
-            if(SelectedIndex < 0  || comBox.Items == null || comBox.Items.Count <= SelectedIndex)
+            if (SelectedIndex < 0 || comBox.Items == null || comBox.Items.Count <= SelectedIndex)
             {
                 title.Text = "";
             }
@@ -355,4 +396,4 @@ namespace PDF_Master.CustomControl.CompositeControl
             }
         }
     }
-}
+}

+ 1 - 0
PDF Office/CustomControl/ToastControl.xaml

@@ -16,6 +16,7 @@
     mc:Ignorable="d">
     <Border
         Name="tipBorder"
+        Padding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=Padding}"
         HorizontalAlignment="Center"
         Background="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=Background}"
         CornerRadius="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ToastControl}, Path=CornerRadius}">

+ 5 - 1
PDF Office/EventAggregators/PageEditNotifyEvent.cs

@@ -58,6 +58,10 @@ namespace PDF_Master.EventAggregators
         /// 选中项
         /// 通过绑定Selected属性来设置选中项有更新不准确的问题
         /// </summary>
-        SelectItems
+        SelectItems,
+        /// <summary>
+        /// 页面总数改变
+        /// </summary>
+        PageCountChanged
     }
 }

+ 35 - 0
PDF Office/EventAggregators/ViewContentEvent.cs

@@ -0,0 +1,35 @@
+using Prism.Events;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Master.EventAggregators
+{
+    /// <summary>
+    /// 用于从阅读页传递给各模块的事件
+    /// </summary>
+    public class ViewContentEvent:PubSubEvent<ViewContentEventArgs>
+    {
+    }
+
+    public class ViewContentEventArgs
+    {
+        public EventType type;
+
+        public string Unicode;
+    }
+
+    public enum EventType
+    {
+        /// <summary>
+        /// 当前页左旋
+        /// </summary>
+        LeftRotate,
+        /// <summary>
+        /// 当前页右旋
+        /// </summary>
+        RightRotate
+    }
+}

+ 22 - 0
PDF Office/Helper/CacheFilePath.cs

@@ -32,6 +32,8 @@ namespace PDF_Master.Helper
         /// </summary>
         List<string> ScanFile = new List<string> { "ScanTemp" };
 
+        private List<string> CreatedFile = new List<string>() { "CreatedFile"};
+
 
         private CPDFDocument copyDoc;
         /// <summary>
@@ -118,6 +120,18 @@ namespace PDF_Master.Helper
             }
         }
 
+
+        /// <summary>
+        /// 用于保存新建的临时文档
+        /// </summary>
+        public string CreatedFilePath
+        {
+            get
+            {
+                return CreateCacheDirectory(CreatedFile);
+            }
+        }
+
         /// <summary>
         ///  在“文档”路径下创建缓存文件夹,传C:\Users\kdan\Documents\PDF Master 以后的文件夹名
         /// </summary>
@@ -212,6 +226,14 @@ namespace PDF_Master.Helper
                 {
                     Directory.Delete(TempPath, true);
                 }
+
+                //清除新建文件夹及该目录中的所有子内容
+                string CreatedFilePath = Path.Combine(App.CurrentPath, CreatedFile[0]);
+                DirectoryInfo CreatedFilePathFolder = new DirectoryInfo(CreatedFilePath);
+                if (CreatedFilePathFolder.Exists)
+                {
+                    Directory.Delete(CreatedFilePath, true);
+                }
             }
             catch { }
         }

+ 6 - 3
PDF Office/Model/AnnotPanel/FontBoard.cs

@@ -384,7 +384,7 @@ namespace PDF_Master.Model.AnnotPanel
         #region 字体样式
 
         //下拉框列表
-        private ComboDataItem _currentFontFamily = new ComboDataItem("Helvatica", "Helvetica");
+        private ComboDataItem _currentFontFamily = new ComboDataItem("Helvatica", "Helvatica");
 
         public ComboDataItem CurrentFontFamily
         {
@@ -547,8 +547,9 @@ namespace PDF_Master.Model.AnnotPanel
             CurrentPresetFont = new ComboDataItem(presetFont, uiStr);
         }
 
-        internal void GetCurrentPresetFont(FreeTextAnnotArgs annot)
+        internal bool GetCurrentPresetFont(FreeTextAnnotArgs annot)
         {
+            bool isExist = false;
             //List<PresetFontItem> presetFontItems = TextFont.GetCachePresetFontList();
             foreach (var item in PresetFontList)
             {
@@ -557,9 +558,11 @@ namespace PDF_Master.Model.AnnotPanel
                     )
                 {
                     CurrentPresetFont = new ComboDataItem(item.mTag, item.mTagContent);
+                    isExist = true;
+                    break;
                 }
             }
-           
+            return isExist;
         }
 
         #endregion 列表选中赋值

+ 1 - 1
PDF Office/Model/PropertyPanel/AnnotPanel/FontStyleItem.cs

@@ -228,7 +228,7 @@ namespace PDF_Master.Model.PropertyPanel.AnnotPanel
             var FontFamilyItems = new List<ComboDataItem>();
             ComboDataItem item = new ComboDataItem("Courier", "Courier New");
             FontFamilyItems.Add(item);
-            item = new ComboDataItem("Helvetica", "Helvetica");
+            item = new ComboDataItem("Helvatica", "Helvatica");
             FontFamilyItems.Add(item);
             item = new ComboDataItem(/*"Times-Roman"*/"Times", "Times New Roman");
             FontFamilyItems.Add(item);

+ 1 - 0
PDF Office/PDF Master.csproj

@@ -376,6 +376,7 @@
     <Compile Include="EventAggregators\SendPrintInfoEvent.cs" />
     <Compile Include="EventAggregators\ShowTipEvent.cs" />
     <Compile Include="EventAggregators\SplitEvent.cs" />
+    <Compile Include="EventAggregators\ViewContentEvent.cs" />
     <Compile Include="Helper\CacheFilePath.cs" />
     <Compile Include="Helper\ConverterHelper.cs" />
     <Compile Include="Helper\CropPageUndoManager.cs" />

+ 6 - 0
PDF Office/PDF Master.csproj.user

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ProjectView>ProjectFiles</ProjectView>
+  </PropertyGroup>
+</Project>

BIN
PDF Office/Resources/BOTA/HideAnnot.png


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

@@ -28,7 +28,6 @@
                                 Fill="#8F96A7"
                                 SnapsToDevicePixels="false" />
                             <ContentPresenter
-                                Margin="4,0,0,0"
                                 HorizontalAlignment="Left"
                                 VerticalAlignment="Center"
                                 RecognizesAccessKey="True"
@@ -74,7 +73,7 @@
                                 x:Name="HeaderSite"
                                 MinWidth="0"
                                 MinHeight="0"
-                                Margin="1"
+                                Margin="0"
                                 Padding="{TemplateBinding Padding}"
                                 HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                 VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"

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

@@ -358,6 +358,8 @@ namespace PDF_Master.ViewModels.BOTA
         /// </summary>
         private void PageSortEvent()
         {
+            if (AnnotationListItems == null) return;
+            if (AnnotationListItems.Count < 0) return;
             ICollectionView v = CollectionViewSource.GetDefaultView(AnnotationListItems);
             v.GroupDescriptions.Clear();
             v.GroupDescriptions.Add(new PropertyGroupDescription(nameof(AnnotHandlerEventArgs.PageIndex)));
@@ -597,6 +599,7 @@ namespace PDF_Master.ViewModels.BOTA
                 default:
                     break;
             }
+            if (AnnotationListItems == null) return;
             if (AnnotationListItems.Count > 0)
             {
                 IsEmptyPanelVisibility = Visibility.Collapsed;
@@ -1143,6 +1146,8 @@ namespace PDF_Master.ViewModels.BOTA
                 if (composite.Parameter is ListBox listBox)
                 {
                     this.listBox = listBox;
+                    //RefreshAnnotationListItems();
+                    SetGroupHeader(listBox);
                 }
             }
         }
@@ -1167,6 +1172,7 @@ namespace PDF_Master.ViewModels.BOTA
                 PdfViewer = pdfview;
             }
             SetGroupHeader(listBox);
+            //RefreshAnnotationListItems();
             KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
             KeyEventsHelper.KeyDown += ShortCut_KeyDown;
             Unicode = App.mainWindowViewModel.SelectedItem.Unicode;
@@ -1229,6 +1235,8 @@ namespace PDF_Master.ViewModels.BOTA
         /// <param name="listBox"></param>
         private async void SetGroupHeader(ListBox listBox)
         {
+            if (listBox == null) { return; }
+
             #region BOTA,注释列表,添加在页面上的注释要默认按照页面上的位置排序,从上往下,从左往右排列
 
             //AnnotationListItems = new ObservableCollection<AnnotationHandlerEventArgs>(AnnotationListItems.OrderBy(item => item.ClientRect.Y).ThenBy(item => item.ClientRect.X));

+ 18 - 9
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs

@@ -1089,17 +1089,26 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
                             PageRangeSelectIndex = 4;
                         }
                     }
-                }
-                else if (parameters.TryGetValue<int>(ParameterNames.PrintCurrentPage, out currentPage))
-                {
-                    PrintSettingsInfo.PageRangeList = PageList;
-                    PrintSettingsInfo.PageRangeList[0]--;
-                    System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
+                    if (parameters.TryGetValue<int>(ParameterNames.PrintCurrentPage, out currentPage))
                     {
-                        PageRangeSelectIndex = 1;
-                    }));
+                        PrintSettingsInfo.PageRangeList = PageList;
+                        PrintSettingsInfo.PageRangeList[0]--;
+                        System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
+                        {
+                            PageRangeSelectIndex = 4;
+                        }));
+                    }
                 }
-                   
+                //else if (parameters.TryGetValue<int>(ParameterNames.PrintCurrentPage, out currentPage))
+                //{
+                //    PrintSettingsInfo.PageRangeList = PageList;
+                //    PrintSettingsInfo.PageRangeList[0]--;
+                //    System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
+                //    {
+                //        PageRangeSelectIndex = 1;
+                //    }));
+                //}
+
                 System.Windows.Size pageSize = PDFViewer.Document.GetPageSize(0);
 
                 if ((pageSize.Height / pageSize.Width > 1.0 && (double)PrintSettingsInfo.PrintDocument.DefaultPageSettings.PaperSize.Height / PrintSettingsInfo.PrintDocument.DefaultPageSettings.PaperSize.Width < 1.0)

+ 9 - 1
PDF Office/ViewModels/Dialog/PropertiesDialogViewModel.cs

@@ -240,7 +240,15 @@ namespace PDF_Master.ViewModels.Dialog
             FileSize = CommonHelper.GetFileSize(Document.FilePath);
             FileTitle = info.Title;
             Author = info.Author;
-            FilePath = Document.FilePath;
+            if ((App.mainWindowViewModel.SelectedItem.DataContext as MainContentViewModel).NewFile)
+            {
+                //新建文档不显示临时路径
+                FilePath = "";
+            }
+            else
+            {
+                FilePath = Document.FilePath;
+            }
             Version = info.Version;
             PageCount = Document.PageCount;
             Creator = info.Creator;

+ 29 - 70
PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs

@@ -55,6 +55,7 @@ using Prism.Services.Dialogs;
 using PDF_Master.ViewModels.Tools.AnnotManager;
 using PDF_Master.Model.FillAndSign;
 using System.Windows.Shapes;
+using Dropbox.Api.TeamLog;
 
 namespace PDF_Master.ViewModels.FillAndSign
 {
@@ -69,11 +70,7 @@ namespace PDF_Master.ViewModels.FillAndSign
         public List<List<Point>> ShapePoints = new List<List<Point>>();
         public string Shape = "HookShape";
         private bool IsFillAndSign
-        {
-            get;
-
-            set;
-        } = true;
+        {get;set;} = true;
         private PopMenu FreeHandAnnotPopMenu;
         private PopMenu FreeTextAnnotPopMenu;
         private PopMenu MultiAnnotPopMenu;
@@ -82,11 +79,13 @@ namespace PDF_Master.ViewModels.FillAndSign
         private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
         public static bool IsEdit = false;
         public static bool IsSignPoint = false;
-        public Brush SelectColor = new SolidColorBrush(Colors.GreenYellow);
+        public Brush SelectColor = new SolidColorBrush(Color.FromArgb(0xff, 0x26, 0x25, 0x29));
         public double FillOpacity = 1;
         public double LineWidth = 2;
         public double LineWidthMultiple = 1;
 
+        public bool IsClickNull=false;
+
         private string DateOrText = "";
 
         private bool _HookShapeIsCheck = false;
@@ -101,10 +100,10 @@ namespace PDF_Master.ViewModels.FillAndSign
         private void InitkeyShape()
         {
 
-            keyShape["HookShape"] = new List<List<Point>> { new List<Point> { new Point(2 ,12.2028), new Point(9.77817 ,19.981), new Point(22.5061 ,2.30333) } };
-            keyShape["ForkShape"] = new List<List<Point>> { new List<Point> { new Point(5,5), new Point(23,23)  }, new List<Point> { new Point(23, 5), new Point( 5,23) } };
+            keyShape["HookShape"] = new List<List<Point>> { new List<Point> { new Point(2, 12.2028), new Point(9.77817, 19.981), new Point(22.5061, 2.30333) } };
+            keyShape["ForkShape"] = new List<List<Point>> { new List<Point> { new Point(5, 5), new Point(23, 23) }, new List<Point> { new Point(23, 5), new Point(5, 23) } };
             keyShape["RectShape"] = new List<List<Point>> { new List<Point> { new Point(1.40002, 1.40002), new Point(20, 1.40002) }, new List<Point> { new Point(20, 1.40002), new Point(20, 20) }, new List<Point> { new Point(20, 20), new Point(1.40002, 20) }, new List<Point> { new Point(1.40002, 20), new Point(1.40002, 1.40002) } };
-            keyShape["LineShape"] = new List<List<Point>> { new List<Point> { new Point(3.19995, 14) ,new Point(25.127, 14) } };
+            keyShape["LineShape"] = new List<List<Point>> { new List<Point> { new Point(3.19995, 14), new Point(25.127, 14) } };
             keyShape["DotShape"] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.19995), new Point(3.19995, 3.19995) } };
 
 
@@ -198,16 +197,16 @@ namespace PDF_Master.ViewModels.FillAndSign
                 }
             }
         }
-
-        #endregion 事件聚合器
         private void InitFillAndSignProperty()
         {
 
             var FreehandDefault = GetAnnotDefault(AnnotArgsType.AnnotFreehand, "FillAndSign");
-            SelectColor = new SolidColorBrush(FreehandDefault.BorderColor != Color.FromArgb(0, 0, 0, 0) ? FreehandDefault.BorderColor : Colors.GreenYellow);
+            SelectColor = new SolidColorBrush(FreehandDefault.BorderColor != Color.FromArgb(0, 0, 0, 0) ? FreehandDefault.BorderColor : Color.FromArgb(0xff, 0x26, 0x25, 0x29));
             FillOpacity = FreehandDefault.Opacity > 0 ? FreehandDefault.Opacity : 1;
             LineWidth = FreehandDefault.Thickness > 0 ? FreehandDefault.Thickness : 2;
         }
+        #endregion 事件聚合器
+
         private System.Windows.Controls.Primitives.Popup popup = null;
         private async void AnnotColorPalette_Menu(object obj)
         {
@@ -376,7 +375,18 @@ namespace PDF_Master.ViewModels.FillAndSign
                         var FreehandDefault = GetAnnotDefault(AnnotArgsType.AnnotFreehand, "FillAndSign");
                         FreehandDefault.BorderColor = color;
                         FreehandDefault.Opacity = freeHand.Transparency;
+
                         FreehandDefault.Thickness = freeHand.LineWidth;
+                        foreach (var point in viewContentViewModel.FillAndSign)
+                        {
+                            if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                            {
+                                if (point.Shape == "DotShape")
+                                {
+                                    FreehandDefault.Thickness = FreehandDefault.Thickness / 5;
+                                }
+                            }
+                        }
                         FreehandDefault.SaveKey = "FillAndSign";
                         var isSolid = AnnotTransfer.IsSolidStyle(freeHand.LineDash);
                         if (isSolid)
@@ -801,15 +811,6 @@ namespace PDF_Master.ViewModels.FillAndSign
 
             //AddToPropertyPanel("ShapFillProperty", "Freehand", selectedArgs, annotAttribsList);
             return freehandArgs;
-        }
-        private bool ListPoint(List<List<Point>> leftpoints, List<List<Point>> rightpoints)
-        {
-
-            if (leftpoints.Count == rightpoints.Count)
-            {
-                if (leftpoints[0][0].X == rightpoints[0][0].X) { return true; }
-            }
-            return false;
         }
 
         /// <summary>
@@ -1310,7 +1311,7 @@ namespace PDF_Master.ViewModels.FillAndSign
             }
         }
 
-        private async void  PDFViewer_AnnotHoverHandler(object sender, AnnotHoverData e)
+        private void PDFViewer_AnnotHoverHandler(object sender, AnnotHoverData e)
         {
             if (e != null && e.DrawContext != null)
             {
@@ -1321,51 +1322,7 @@ namespace PDF_Master.ViewModels.FillAndSign
                     e.PaintRect.Height + 4);
                 Pen hoverPen = new Pen(new SolidColorBrush(Color.FromArgb(0xff, 0x11, 0x8A, 0xff)), 1);
                 hoverPen.DashStyle = DashStyles.Dash;
-                e.DrawContext?.DrawRectangle(null, hoverPen, hoverRect);
-
-            ////Todo: 目前ComPDFKit.Viewer没有e.Annot参数
-            ////便签,显示ToolTip内容
-            //    if (e.Annot != null && e.Annot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_INK)
-            //    {
-                    
-            //        {
-
-            //            var item = new ColorDropBoxPop();
-            //            //item.DataContext = (sender as Ellipse).DataContext;
-            //            item.ColorSelected -= AnnotMenu_ColorSelected;
-            //            item.ColorSelected += AnnotMenu_ColorSelected;
-
-            //            if (popup == null)
-            //            { popup = new System.Windows.Controls.Primitives.Popup(); }
-            //            else { popup.IsOpen = false; }
-
-            //            ContentControl window = null;
-            //            if (PDFViewer.Parent as ContentControl != null)
-            //                window = PDFViewer.Parent as ContentControl;
-            //            else
-            //                window = App.Current.MainWindow;
-
-            //            popup.Child = item;
-            //            popup.PlacementRectangle = new Rect(Mouse.GetPosition(window), new Size(item.Width, item.Height));
-            //            popup.Placement = System.Windows.Controls.Primitives.PlacementMode.MousePoint;
-            //            popup.PlacementTarget = window;
-            //            popup.IsOpen = true;
-
-            //            Window parentWnd = Window.GetWindow(App.Current.MainWindow);
-            //            if (parentWnd != null)
-            //            {
-            //                parentWnd.MouseDown -= parentWnd_MouseDown;
-            //                parentWnd.MouseDown += parentWnd_MouseDown;
-            //            }
-                       
-            //                while (popup!= null &&  popup.IsOpen)
-            //                await Task.Delay(20);
-
-            //            parentWnd.MouseDown -= parentWnd_MouseDown;
-            //            popup = null;
-            //        }
-
-            //    }
+                e.DrawContext?.DrawRectangle(null, hoverPen, hoverRect);
             }
 
             CloseAnnotToolTip();
@@ -1628,6 +1585,7 @@ namespace PDF_Master.ViewModels.FillAndSign
         {
             if (e != null)
             {
+                IsClickNull=false;
                 var annot = e.AnnotItemsList[0];
                 if (annot != null)
                 {
@@ -1715,8 +1673,9 @@ namespace PDF_Master.ViewModels.FillAndSign
             }
             else
             {
-                if(PDFViewer.MouseMode != MouseModes.AnnotCreate)
-                viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                if (PDFViewer.MouseMode != MouseModes.AnnotCreate) { viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null); }
+
+                else { IsClickNull = true; }
             }
         }
         //private void PDFViewer_AnnotEditHandler(object sender, List<AnnotEditEvent> e)
@@ -1841,7 +1800,7 @@ namespace PDF_Master.ViewModels.FillAndSign
                         }
                         if (isDifferen)
                         {
-                            ShowPropertyPanel(true); AddToPropertyPanel("SignatureAnnotProperty"); return;
+                            viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null); return;
                         }
                         viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null); return;
                     }

+ 125 - 56
PDF Office/ViewModels/FillAndSign/PropertyPanel/ShapFillPropertyViewModel.cs

@@ -24,6 +24,8 @@ using PDFSettings;
 using PDF_Master.ViewModels.Tools.AnnotManager;
 using Prism.Common;
 using ComPDFKitViewer.PdfViewer;
+using PDF_Master.CustomControl.CompositeControl;
+using Microsoft.Office.Interop.Word;
 
 namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
 {
@@ -46,6 +48,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
             }
         }
 
+
         public string shapeType = "";
         public string ShapeType
         {
@@ -69,28 +72,14 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
         {
         }
 
-        private Brush selectColor = new SolidColorBrush(Colors.GreenYellow);
+        private Brush selectColor = new SolidColorBrush(Color.FromArgb(0xff, 0x26, 0x25, 0x29));
         public Brush SelectColor
         {
             get { return selectColor; }
             set
             {
-                SetProperty(ref selectColor, value);
-                //if (!fillAndSignContentViewModel.isFirst)
-                //{
-                //    fillAndSignContentViewModel.SelectColor = value;
-                //    //if (FillAndSignContentViewModel.IsEdit)
-                //    {
-                //        // PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * lineWidthMultiple);
-                //        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Color, (selectColor as SolidColorBrush).Color);
-                //    }
-                //    //else
-                //    {
-                //        if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
-
-                //    }
-
-                //}
+                SetProperty(ref selectColor, value);
+                UPDataColor();
 
             }
         }
@@ -126,7 +115,9 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
         public bool IsMultiSelected
         {
             get { return _isMultiSelected; }
-            set { SetProperty(ref _isMultiSelected, value);
+            set
+            {
+                SetProperty(ref _isMultiSelected, value);
                 if (value) { ShapeType = "General Properties"; }
             }
         }
@@ -144,25 +135,73 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
             get { return lineWidth; }
             set
             {
-                SetProperty(ref lineWidth, value);
-                UPDataLineWidth();
-         
+                SetProperty(ref lineWidth, value);
+
+
             }
         }
-        public DelegateCommand<object> SelectedThickCommand { get; set; }
-        public DelegateCommand<object> SelectedColorCommand { get; set; }
-
-
-        //public DelegateCommand<object> LineStyleCommand { get; set; }
+
+
+        private Brush _shapeColortColor = new SolidColorBrush(Color.FromArgb(0xff, 0x26, 0x25, 0x29));
+        public Brush ShapeColorColor
+        {
+            get { return _shapeColortColor; }
+            set { SetProperty(ref _shapeColortColor, value); }
 
+        }
+
+        List<ColorItem> shapeColorItems = new List<ColorItem>();
+
+        public List<ColorItem> ShapeColorItems
+        {
+            get { return shapeColorItems; }
+            set
+            {
+                SetProperty(ref shapeColorItems, value);
+
+            }
+        }
+        private void InitShapeColorList()
+        {
+            ShapeColorItems = new List<ColorItem>();
+            ColorItem colorItem = new ColorItem(Color.FromArgb(0xff, 0xfc, 0x1f, 0x1f), 0);
+            ShapeColorItems.Add(colorItem);
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0x26, 0x25, 0x29), 1);
+            ShapeColorItems.Add(colorItem);
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0x29, 0x53, 0x93), 2);
+            ShapeColorItems.Add(colorItem);
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0x1e, 0x89, 0x56), 3);
+            ShapeColorItems.Add(colorItem);
+
+        }
+
+
+        private DefaultAnnotProperty GetAnnotDefault(AnnotArgsType annotArgsType, string savaKey = "")
+        {
+            var Annot = SettingHelper.GetAnnotDefaultProperty(annotArgsType, savaKey);
+            if (Annot == null)
+            {
+                Annot = new DefaultAnnotProperty();
+                Annot.AnnotToolType = annotArgsType;
+            }
+            return Annot;
+        }
+        public DelegateCommand<object> SelectedThickCommand { get; set; }
+        public DelegateCommand<object> SelectedColorCommand { get; set; }
+
+
+        //public DelegateCommand<object> LineStyleCommand { get; set; }
+        public DelegateCommand<object> SelectedLineWidthValueCommand { get; set; }
         public DelegateCommand<object> SharpsTypeCommand { get; set; }
         public DelegateCommand<object> ThicknessChangedCommand { get; set; }
         public DelegateCommand<object> SelectedOpacityValueCommand { get; set; }
 
         public ShapFillPropertyViewModel()
-        {
+        {
+            InitShapeColorList();
             SelectedThickCommand = new DelegateCommand<object>(SelectedThick_Command);
             SelectedColorCommand = new DelegateCommand<object>(SelectedColor_Command);
+            SelectedLineWidthValueCommand = new DelegateCommand<object>(SelectedLineWitdh_Command);
             //LineStyleCommand = new DelegateCommand<object>(LineStyle_Command);
             SharpsTypeCommand = new DelegateCommand<object>(SharpsType_Command);
             ThicknessChangedCommand = new DelegateCommand<object>(ThicknessChanged_Command);
@@ -476,7 +515,8 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
                 }
             }
         }
-        private void UPDataLineWidth(){
+        private void UPDataLineWidth()
+        {
 
             if (!fillAndSignContentViewModel.isFirst)
             {
@@ -484,8 +524,8 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
 
                 //if (FillAndSignContentViewModel.IsEdit)
                 {
-
-                    PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * lineWidthMultiple);
+                    if (!fillAndSignContentViewModel.IsClickNull)
+                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * lineWidthMultiple);
 
                 }
                 // else
@@ -502,18 +542,24 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
 
             if (!fillAndSignContentViewModel.isFirst)
             {
-                fillAndSignContentViewModel.SelectColor = SelectColor;
-                //if (FillAndSignContentViewModel.IsEdit)
+                var newColor = (ShapeColorColor as SolidColorBrush).Color;
+                var oldColor = (SelectColor as SolidColorBrush).Color;
+                if (newColor.A != oldColor.A || newColor.B != oldColor.B || newColor.R != oldColor.R || newColor.G != oldColor.G)
                 {
-                    // PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * lineWidthMultiple);
-                    PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Color, (selectColor as SolidColorBrush).Color);
-                }
-                //else
-                {
-                    if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
+                    ShapeColorColor = SelectColor;
+                    fillAndSignContentViewModel.SelectColor = SelectColor;
+                    //if (FillAndSignContentViewModel.IsEdit)
+                    {
+                        // PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * lineWidthMultiple);
+                        if (!fillAndSignContentViewModel.IsClickNull)
+                            PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Color, (selectColor as SolidColorBrush).Color);
+                    }
+                    //else
+                    {
+                        if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
 
+                    }
                 }
-
             }
         }
         private void UPDataOpacity()
@@ -524,7 +570,8 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
 
                 //if (FillAndSignContentViewModel.IsEdit)
                 {
-                    PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, fillOpacity);
+                    if (!fillAndSignContentViewModel.IsClickNull)
+                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, fillOpacity);
                 }
 
                 //else
@@ -536,7 +583,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
             }
         }
 
-            private void SelectedColor_Command(object obj)
+        private void SelectedColor_Command(object obj)
         {
             if (obj != null)
             {
@@ -556,8 +603,18 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
             }
 
         }
-        
-            private void SelectedOpacityValue(object obj)
+
+        private void SelectedLineWitdh_Command(object obj)
+        {
+            if (obj != null)
+            {
+                double colorValue = (double)obj;
+                UPDataLineWidth();
+            }
+
+        }
+
+        private void SelectedOpacityValue(object obj)
         {
             if (obj != null)
             {
@@ -643,7 +700,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
 
                 if (IsMultiSelected)
                 {
-
+                    ShapeColorColor = new SolidColorBrush(Colors.Transparent);
                 }
                 else
                 {
@@ -659,22 +716,34 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
             {
                 var annot = Annot as FreehandAnnotArgs;
                 if (annot != null)
-                {
-                    //SelectColor = new SolidColorBrush(annot.InkColor);
-                    //FillOpacity = annot.Transparency;
-                    //LineWidth = annot.LineWidth;
-                    foreach (var point in fillAndSignContentViewModel.viewContentViewModel.FillAndSign)
+                {
+
+                    try
                     {
-                        if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                        foreach (var point in fillAndSignContentViewModel.viewContentViewModel.FillAndSign)
                         {
-                            lineWidthMultiple = 1;
-                            if (point.Shape == "DotShape")
+                            if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
                             {
-                                lineWidthMultiple = 5;
+                                lineWidthMultiple = 1;
+                                if (point.Shape == "DotShape")
+                                {
+                                    lineWidthMultiple = 5;
+                                    LineWidth = annot.LineWidth / 5;
+                                }
+                                else { LineWidth = annot.LineWidth; }
+                                SelectColor = new SolidColorBrush(annot.InkColor);
+
+
+                                FillOpacity = annot.Transparency;
+                                InitShapesType(point.Shape);
+                                Shape = point.Shape;
                             }
-                            InitShapesType(point.Shape);
-                            Shape = point.Shape;
-                        }
+                        }
+                    }
+                    catch
+                    {
+
+
                     }
                 }
 

+ 2 - 2
PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs

@@ -47,9 +47,9 @@ namespace PDF_Master.ViewModels.HomePanel.PDFTools
         #endregion
         #region 属性
         /// <summary>
-        /// 扩展/收缩
+        /// 扩展/收缩 默认展开
         /// </summary>
-        private bool _isExpendTools = false;
+        private bool _isExpendTools = true;
         public bool IsExpendTools
         {
             get { return _isExpendTools; }

+ 57 - 4
PDF Office/ViewModels/MainContentViewModel.cs

@@ -133,8 +133,6 @@ namespace PDF_Master.ViewModels
             set { SetProperty(ref fileChanged, value); }
         }
 
-        private bool isNewDocument = false;
-
         public CPDFViewer PDFViewer { get; set; }
 
         public DelegateCommand<object> CloseTab { get; set; }
@@ -198,6 +196,26 @@ namespace PDF_Master.ViewModels
             }
         }
 
+
+
+        private bool newFile = false;
+        /// <summary>
+        /// 是否是新建的文档
+        /// </summary>
+        public bool NewFile
+        {
+            get { return newFile; }
+            set
+            {
+                SetProperty(ref newFile, value);
+                if(!value)
+                {
+                    IsShowInFolderEnable = true;
+                }
+            }
+        }
+
+
         public IRegionManager toolregion;
 
         public IEventAggregator eventer;
@@ -269,6 +287,16 @@ namespace PDF_Master.ViewModels
             {
                 App.mainWindowViewModel?.CloseTabItem(item);
                 App.OpenedFileList.Remove(FilePath);
+                if(NewFile)
+                {
+                    //新文档 关闭文档后 及时清空临时缓存
+                    DirectoryInfo directory = new DirectoryInfo(CacheFilePath.Instance.CreatedFilePath);
+                    FileInfo fileInfo = new FileInfo(FilePath);
+                    if(directory.GetFiles().ToList().Contains(fileInfo))
+                    {
+                        File.Delete(FilePath);
+                    }
+                }
             }
         }
 
@@ -292,7 +320,6 @@ namespace PDF_Master.ViewModels
             OpenFileInfo isnew = SettingHelper.GetFileInfo(filePath);
             if (isnew == null)
             {
-                isNewDocument = true;
                 if (App.OpenedFileList.Contains(filePath) == false)
                 {
                     App.OpenedFileList.Add(filePath);
@@ -316,7 +343,7 @@ namespace PDF_Master.ViewModels
             toolregion.RequestNavigate(MainContentRegionName, "ViewContent", parameters);
 
             IsReNameEnable = true;
-            if (!string.IsNullOrEmpty(PDFViewer.Document.FilePath))
+            if (!string.IsNullOrEmpty(PDFViewer.Document.FilePath)&&!NewFile)
             {
                 IsShowInFolderEnable = true;
             }
@@ -440,6 +467,9 @@ namespace PDF_Master.ViewModels
                 }
             }
 
+            SaveToTempFile();
+       
+
             PDFViewer.UndoManager.CanSave = true;
             FileChanged = Visibility.Visible;
 
@@ -579,6 +609,8 @@ namespace PDF_Master.ViewModels
 
                 PDFViewer.Document.ImportPages(tempdoc, "");
 
+                SaveToTempFile();
+
                 PDFViewer.UndoManager.CanSave = true;
                 FileChanged = Visibility.Visible;
 
@@ -624,6 +656,27 @@ namespace PDF_Master.ViewModels
             }
         }
 
+        /// <summary>
+        /// 新建的文档 保存至临时文件 解决新建文档没有路径的问题
+        /// </summary>
+        private void SaveToTempFile()
+        {
+            if(PDFViewer!=null)
+            {
+                string tempfile = CacheFilePath.Instance.CreatedFilePath;
+                string file = CommonHelper.CreateFilePath(Path.Combine(tempfile,"Untitle.pdf"));
+                PDFViewer.Document.WriteToFilePath(file);
+
+                PDFViewer.CloseDocument();
+                PDFViewer.InitDocument(file);
+                FilePath = file;
+                //在viewcontent里打开是 会重新load 因此这里不需要load 避免重复
+                FileName = PDFViewer.Document.FileName;
+                NewFile = true;
+            }
+        }
+
+
         private void UndoManager_PropertyChanged(object sender, PropertyChangedEventArgs e)
         {
             if (e.PropertyName == "CanSave")

+ 44 - 16
PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs

@@ -86,6 +86,11 @@ namespace PDF_Master.ViewModels.PageEdit
         /// </summary>
         private bool isFirstLoad = true;
 
+        /// <summary>
+        /// 是否正在拖拽排序中
+        /// </summary>
+        private bool DragSorting = false;
+
         /// <summary>
         /// 记录多选项中最后一项的索引
         /// </summary>
@@ -391,10 +396,6 @@ namespace PDF_Master.ViewModels.PageEdit
         /// </summary>
         public DelegateCommand ReverseCommand { get; set; }
 
-        /// <summary>
-        /// 打印
-        /// </summary>
-        public DelegateCommand PrintCommand { get; set; }
 
         /// <summary>
         /// 放大
@@ -447,12 +448,12 @@ namespace PDF_Master.ViewModels.PageEdit
             CopyCommand = new DelegateCommand(copy);
             PasteCommand = new DelegateCommand(()=> { paste(); }, CanPasteExcute).ObservesProperty(() => CanPaste);
             CutCommand = new DelegateCommand(cut);
-            PrintCommand = new DelegateCommand(print);
             ClearSelectedCommand = new DelegateCommand(clearSelected);
             EnterPageEditCommand = new DelegateCommand(enterpageeditr);
 
             //订阅页面刷新事件
             eventAggregator.GetEvent<PageEditRefreshEvent>().Subscribe(OnPageEditRefreshEvent, e => e.Unicode == unicode);
+            eventAggregator.GetEvent<ViewContentEvent>().Subscribe(ViewContentChangedEvent, e => e.Unicode == unicode);
 
             CacheFilePath.Instance.PropertyChanged += Instance_PropertyChanged;
 
@@ -462,7 +463,20 @@ namespace PDF_Master.ViewModels.PageEdit
 
 
 
+
         #region 事件
+        private void ViewContentChangedEvent(ViewContentEventArgs obj)
+        {
+            //只有在缩略图模式下响应刷新,进入页面编辑时 会刷新可见范围内图片,不需要响应这个事件
+            if(IsBOTAThumb== Visibility.Visible)
+            {
+                PageEditItems[PDFViewer.CurrentIndex].IsGetImage = false;
+                PageEditItems[PDFViewer.CurrentIndex].Size = PDFViewer.Document.GetPageSize(PDFViewer.CurrentIndex);
+                RefreshItemImage(PDFViewer.CurrentIndex, PDFViewer.CurrentIndex);
+            }
+        }
+
+
         /// <summary>
         /// 进入页面编辑
         /// </summary>
@@ -1059,14 +1073,14 @@ namespace PDF_Master.ViewModels.PageEdit
         /// <summary>
         /// 调用打印机
         /// </summary>
-        private void print()
+        public void print(List<int> SelectedPages)
         {
             PDFViewer.GoToPage(listSelecedIndex);
             DialogParameters printValue = new DialogParameters();
             printValue.Add(ParameterNames.PDFViewer, PDFViewer);
             printValue.Add(ParameterNames.FilePath, PDFViewer.Document.FileName);
             printValue.Add(ParameterNames.PrintCurrentPage, PDFViewer.CurrentIndex);
-            printValue.Add(ParameterNames.PageList, selectedPageList);
+            printValue.Add(ParameterNames.PageList, SelectedPages);
             dialogs.ShowDialog(DialogNames.HomePagePrinterDialog, printValue, e => { });
         }
 
@@ -1411,9 +1425,17 @@ namespace PDF_Master.ViewModels.PageEdit
                 {
                     if (PageEditItems[i].Selected)
                     {
-
                         indexList.Add(i);
-
+                    }
+                }
+                
+                //因为虚拟化 可能获取不到所有选中项的页码 需要结合选中项的集合判断一下
+                if(selectedPageList.Count>0&&selectedPageList.Count> indexList.Count)
+                {
+                    indexList = new List<int>();
+                    for(int j=0;j<selectedPageList.Count;j++)
+                    {
+                        indexList.Add(selectedPageList[j]-1);
                     }
                 }
             }
@@ -1932,8 +1954,6 @@ namespace PDF_Master.ViewModels.PageEdit
                         PDFViewer.Document.RotatePage(i, rightRotate ? 1 : -1);
                         PDFViewer.Document.ReleasePages(i);
                         items.Add(i, i);
-
-                        PageEditItems[i].Size = PDFViewer.Document.GetPageSize(i);
                         //重新拿图
                         PageEditItems[i].IsGetImage = false;
                     }
@@ -1944,13 +1964,12 @@ namespace PDF_Master.ViewModels.PageEdit
                 //旋转对应Items集合
                 for (int i = 0; i < pageitems.Count; i++)
                 {
-                    PDFViewer.Document.RotatePage(pageitems[i], rightRotate ? 1 : -1);
+                    var r = PDFViewer.Document.RotatePage(pageitems[i], rightRotate ? 1 : -1);
                     PDFViewer.Document.ReleasePages(pageitems[i]);
                     items.Add(pageitems[i], pageitems[i]);
 
                     //重新拿图
                     PageEditItems[pageitems[i]].IsGetImage = false;
-                    PageEditItems[i].Size = PDFViewer.Document.GetPageSize(i);
                 }
             }
 
@@ -1968,7 +1987,7 @@ namespace PDF_Master.ViewModels.PageEdit
                 PDFViewer.UndoManager.AddHistory(history);
             }
 
-            ReloadAfterOption(false, false, Tuple.Create(0, PageEditItems.Count));
+            ReloadAfterOption(false, false, Tuple.Create(items.Keys.First(),items.Keys.Last()));
             IsLoading = Visibility.Collapsed;
         }
 
@@ -2167,6 +2186,8 @@ namespace PDF_Master.ViewModels.PageEdit
             {
                 if (i <= PageEditItems.Count - 1 && i >= 0 && PageEditItems.Count > 0)
                 {
+                    //先更新一次每个页面的尺寸 确保图的方向正确
+                    PageEditItems[i].Size = PDFViewer.Document.GetPageSize(i);
                     //宽高为样式中图片控件宽高
                     if (PageEditItems[i].isVertical)
                     {
@@ -2203,6 +2224,7 @@ namespace PDF_Master.ViewModels.PageEdit
         /// <param name="pageIndexs"></param>
         public void DragToSort(int targetIndex, List<int> pageIndexs, bool IsFromUndoRedo = false)
         {
+            DragSorting = true;
             //拖拽排序后需要重新选中项的集合
             List<int> selectedPages = new List<int>();
 
@@ -2224,6 +2246,7 @@ namespace PDF_Master.ViewModels.PageEdit
                     result = MoveItemToIndex(pageIndexs[i], targetIndex + i);
                     if (!result)
                     {
+                        DragSorting = false;
                         return;
                     }
                     SourceTargetValue.Add(pageIndexs[i], targetIndex + i);
@@ -2238,6 +2261,7 @@ namespace PDF_Master.ViewModels.PageEdit
                     result = MoveItemToIndex(pageIndexs[pageIndexs.Count - 1 - i], targetIndex - 1 - i);
                     if (!result)
                     {
+                        DragSorting = false;
                         return;
                     }
                     SourceTargetValue.Add(pageIndexs[pageIndexs.Count - 1 - i], targetIndex - 1 - i);
@@ -2263,6 +2287,7 @@ namespace PDF_Master.ViewModels.PageEdit
                     result = MoveItemToIndex(pageIndexs[k - i], targetIndex - 1 - i);
                     if (!result)
                     {
+                        DragSorting = false;
                         return;
                     }
                     SourceTargetValue.Add(pageIndexs[k - i], targetIndex - 1 - i);
@@ -2275,6 +2300,7 @@ namespace PDF_Master.ViewModels.PageEdit
                     result = MoveItemToIndex(pageIndexs[j], newIndex);
                     if (!result)
                     {
+                        DragSorting = false;
                         return;
                     }
                     SourceTargetValue.Add(pageIndexs[j], newIndex);
@@ -2282,6 +2308,7 @@ namespace PDF_Master.ViewModels.PageEdit
                     newIndex++;
                 }
             }
+            DragSorting = false;
             //通知UI选中Items
             NotifyUIToRefresh(selectedPages);
             //刷新页码和图片
@@ -2419,8 +2446,9 @@ namespace PDF_Master.ViewModels.PageEdit
 
         private void PDFViewer_AnnotEditHandler(object sender, List<ComPDFKitViewer.AnnotEvent.AnnotEditEvent> e)
         {
-            if (e != null && e.Count > 0)
+            if (e != null && e.Count > 0&&IsBOTAThumb == Visibility.Visible)
             {
+                //缩略图模式下 刷新页面
                 int pageIndex = e[0].PageIndex;
                 RefreshItemImage(pageIndex, pageIndex);
             }
@@ -2428,7 +2456,7 @@ namespace PDF_Master.ViewModels.PageEdit
 
         private void PDFViewer_InfoChanged(object sender, KeyValuePair<string, object> e)
         {
-            if (e.Key == "PageNum")
+            if (e.Key == "PageNum"&&!viewContentViewModel.isInPageEdit)
             {
                 NotifyUIToRefresh(new List<int> { (e.Value as ComPDFKitViewer.RenderData).PageIndex });
             }

+ 95 - 16
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs

@@ -4,6 +4,7 @@ using PDF_Master.CustomControl.CompositeControl;
 using PDF_Master.Model;
 using PDF_Master.Model.AnnotPanel;
 using PDF_Master.Model.PropertyPanel.AnnotPanel;
+using PDF_Master.Properties;
 using PDF_Master.ViewModels.Tools;
 using PDF_Master.ViewModels.Tools.AnnotManager;
 using PDFSettings;
@@ -69,6 +70,17 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 
         #endregion 文案
 
+        private string title;
+
+        public string Title
+        {
+            get { return title; }
+            set
+            {
+                SetProperty(ref title, value);
+            }
+        }
+
         private FontBoardVm _fontVm = new FontBoardVm(true);
 
         public FontBoardVm FontVm
@@ -266,21 +278,24 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                 var item = FontVm.PresetFontList.FirstOrDefault(temp => temp.mTag == itemComboxItem.ValueStr);
                 if (item != null)
                 {
-                    FontVm.GetCurrentFontSize(item.mFontSize);
-
-                    if (item.mFontFamily != null)
+                    if (item.mTag != "Custom")
                     {
-                        FontVm.GetCurrentFontFamily(item.mFontFamily.ToString(), item.mFontFamily.ToString());
-                    }
+                        FontVm.GetCurrentFontSize(item.mFontSize);
+
+                        if (item.mFontFamily != null)
+                        {
+                            FontVm.GetCurrentFontFamily(item.mFontFamily.ToString(), item.mFontFamily.ToString());
+                        }
 
-                    FontVm.GetFontWeights_Style(item.mFontStyle, item.mFontWeight);
+                        FontVm.GetFontWeights_Style(item.mFontStyle, item.mFontWeight);
 
-                    Dictionary<AnnotAttrib, object> AnnotAttribDir = new Dictionary<AnnotAttrib, object>();
-                    AnnotAttribDir.Add(AnnotAttrib.FontSize, item.mFontSize);
-                    AnnotAttribDir.Add(AnnotAttrib.FontFamily, item.mFontFamily);
-                    AnnotAttribDir.Add(AnnotAttrib.FontStyle, item.mFontStyle);
-                    AnnotAttribDir.Add(AnnotAttrib.FontWeight, item.mFontWeight);
-                    PropertyPanel.UpdateAnnotAllAttribs(AnnotAttribDir);
+                        Dictionary<AnnotAttrib, object> AnnotAttribDir = new Dictionary<AnnotAttrib, object>();
+                        AnnotAttribDir.Add(AnnotAttrib.FontSize, item.mFontSize);
+                        AnnotAttribDir.Add(AnnotAttrib.FontFamily, item.mFontFamily);
+                        AnnotAttribDir.Add(AnnotAttrib.FontStyle, item.mFontStyle);
+                        AnnotAttribDir.Add(AnnotAttrib.FontWeight, item.mFontWeight);
+                        PropertyPanel.UpdateAnnotAllAttribs(AnnotAttribDir);
+                    }
                 }
             }
         }
@@ -296,6 +311,25 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                 AnnotAttribDir.Add(AnnotAttrib.FontStyle, FontVm.FontStyleItem);
                 AnnotAttribDir.Add(AnnotAttrib.FontWeight, FontVm.FontWeightItem);
                 PropertyPanel.UpdateAnnotAllAttribs(AnnotAttribDir);
+
+                var currentItem = FontVm.PresetFontList.FirstOrDefault(temp => temp.mTag == FontVm.CurrentPresetFont.ValueStr);
+                if (currentItem.mTag != "Custom")
+                {
+                    foreach (var item in Settings.Default.PresetFontList)
+                    {
+                        if (item.mTag == currentItem.mTag)
+                        {
+                            if (FontVm.FontWeightItem != item.mFontWeight || FontVm.FontStyleItem != item.mFontStyle)
+                            {
+                                Title = string.Format($"*{currentItem.mTagContent}");
+                            }
+                            else
+                            {
+                                Title = currentItem.mTagContent;
+                            }
+                        }
+                    }
+                }
             }
         }
 
@@ -326,6 +360,26 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         //设置字体大小
         private void FontSizeChanged()
         {
+            var currentItem = FontVm.PresetFontList.FirstOrDefault(temp => temp.mTag == FontVm.CurrentPresetFont.ValueStr);
+            //var comboDataItem = FontVm.PresetFontItems.FirstOrDefault(temp => temp.ValueStr == FontVm.CurrentPresetFont.ValueStr);
+            if (currentItem.mTag != "Custom")
+            {
+                foreach (var item in Settings.Default.PresetFontList)
+                {
+                    if (item.mTag == currentItem.mTag)
+                    {
+                        if (FontVm.CurrentFontSize.Value != item.mFontSize)
+                        {
+                            Title = string.Format($"*{currentItem.mTagContent}");
+                        }
+                        else
+                        {
+                            Title = currentItem.mTagContent;
+                        }
+                    }
+                }
+            }
+
             if (FontVm.CurrentFontSize != null)
             {
                 PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FontSize, FontVm.CurrentFontSize.Value);
@@ -337,6 +391,25 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         //设置字体样式
         private void FontFamilyChanged()
         {
+            var currentItem = FontVm.PresetFontList.FirstOrDefault(temp => temp.mTag == FontVm.CurrentPresetFont.ValueStr);
+            //var comboDataItem = FontVm.PresetFontItems.FirstOrDefault(temp => temp.ValueStr == FontVm.CurrentPresetFont.ValueStr);
+            if (currentItem.mTag != "Custom")
+            {
+                foreach (var item in Settings.Default.PresetFontList)
+                {
+                    if (item.mTag == currentItem.mTag)
+                    {
+                        if (FontVm.CurrentFontFamily.ValueStr != item.mFontFamily.Source)
+                        {
+                            Title = string.Format($"*{currentItem.mTagContent}");
+                        }
+                        else
+                        {
+                            Title = currentItem.mTagContent;
+                        }
+                    }
+                }
+            }
             if (string.IsNullOrEmpty(FontVm.CurrentFontFamily.ValueStr) == false)
             {
                 PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FontFamily, new FontFamily(FontVm.CurrentFontFamily.ValueStr));
@@ -661,10 +734,16 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             BasicVm.FillOpacity = Annot.Transparency;
 
             FontVm.FontColor = new SolidColorBrush(Annot.FontColor);
-            FontVm.GetCurrentFontSize((int)Annot.FontSize);
-            FontVm.GetCurrentPresetFont(Annot);
-            FontVm.GetCurrentFontFamily(Annot.FontFamily.ToString(), Annot.FontFamily.ToString());
-            FontVm.GetFontWeights_Style(Annot.FontStyle, Annot.FontWeight);
+
+            bool isExist = FontVm.GetCurrentPresetFont(Annot);
+            if (isExist == false)
+            {
+                FontVm.CurrentPresetFont = new ComboDataItem("Custom", "自定义");
+                FontVm.GetCurrentFontSize((int)Annot.FontSize);
+
+                FontVm.GetCurrentFontFamily(Annot.FontFamily.ToString(), Annot.FontFamily.ToString());
+                FontVm.GetFontWeights_Style(Annot.FontStyle, Annot.FontWeight);
+            }
 
             GetTimeFormat();
             GetAnnotAlign(Annot.Align);

+ 85 - 45
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs

@@ -24,7 +24,6 @@ using System.Windows.Media;
 
 namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 {
-
     public class DashStyleConverter : IValueConverter
     {
         public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
@@ -52,10 +51,13 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             throw new NotImplementedException();
         }
     }
+
     public class SharpsAnnotPropertyViewModel : BindableBase, INavigationAware
     {
         #region 属性
+
         private bool isRect = false;
+
         public bool IsRect
         {
             get { return isRect; }
@@ -63,6 +65,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         }
 
         private bool isCircle = false;
+
         public bool IsCircle
         {
             get { return isCircle; }
@@ -70,6 +73,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         }
 
         private bool isArrow = false;
+
         public bool IsArrow
         {
             get { return isArrow; }
@@ -77,6 +81,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         }
 
         private bool isLine = false;
+
         public bool IsLine
         {
             get { return isLine; }
@@ -93,9 +98,11 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                 SetProperty(ref _strShapeChecked, value);
             }
         }
+
         public List<ComboDataItem> ThicknessItems { get; protected set; }
 
         private AnnotCommon _basicVm = new AnnotCommon();
+
         public AnnotCommon BasicVm
         {
             get { return _basicVm; }
@@ -103,6 +110,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         }
 
         private Geometry dataPath = null;
+
         public Geometry DataPath
         {
             get { return dataPath; }
@@ -113,6 +121,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         }
 
         private DashStyle dash = new DashStyle();
+
         public DashStyle Dash
         {
             get { return dash; }
@@ -123,6 +132,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         }
 
         private bool _isLineAnnot = false;
+
         public bool IsLineAnnot
         {
             get { return _isLineAnnot; }
@@ -132,7 +142,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
-        #endregion
+        #endregion 属性
 
         public DelegateCommand<object> SelectedThickCommand { get; set; }
         public DelegateCommand<object> SelectedBorderColorCommand { get; set; }
@@ -146,8 +156,8 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         public DelegateCommand<object> ThicknessChangedCommand { get; set; }
         public DelegateCommand<object> SelectedOpacityValueCommand { get; set; }
 
-
         public event EventHandler<object> LoadPropertyHandler;
+
         public SharpsAnnotPropertyViewModel()
         {
             InitColorItems();
@@ -210,21 +220,42 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             if (obj != null)
             {
                 var tag = (string)obj;
-                SharpsType(tag);
+                SharpsType(tag, true);
+                Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
+                switch (tag)
+                {
+                    case "Rect":
+                        changeData[AnnotArgsType.AnnotSquare] = tag;
+                        break;
+
+                    case "Circle":
+                        changeData[AnnotArgsType.AnnotCircle] = tag;
+                        break;
+
+                    case "Arrow":
+                        changeData[AnnotArgsType.AnnotLine] = tag;
+                        break;
+
+                    case "Line":
+                        changeData[AnnotArgsType.AnnotLine] = tag;
+                        break;
+                }
+                PropertyPanel.AnnotTypeChangedInvoke(this, changeData);
             }
         }
 
         private void SharpsType(string tag, bool isFromToolsBtn = false)
         {
-            Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
             switch (tag)
             {
                 case "Rect":
                     RectangleGeometry rectPath = new RectangleGeometry();
                     rectPath.Rect = new Rect(0, 5, 28, 22);
                     DataPath = rectPath;
-                    changeData[AnnotArgsType.AnnotSquare] = tag;
+
                     IsLineAnnot = false;
+                    //if (IsRect == false)
+                    //    IsRect = true;
                     break;
 
                 case "Circle":
@@ -233,13 +264,14 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                     circlePath.RadiusY = 14;
                     circlePath.Center = new Point(14, 14);
                     DataPath = circlePath;
-                    changeData[AnnotArgsType.AnnotCircle] = tag;
+
                     IsLineAnnot = false;
+                    //if (IsCircle == false)
+                    //    IsCircle = true;
                     break;
 
                 case "Arrow":
                     {
-
                         ArrowHelper arrowLine = new ArrowHelper();
                         arrowLine.ArrowLength = 8;
                         arrowLine.LineStart = new Point(8, 24);
@@ -247,8 +279,11 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                         arrowLine.StartSharp = C_LINE_TYPE.LINETYPE_NONE;
                         arrowLine.EndSharp = C_LINE_TYPE.LINETYPE_ARROW;
                         DataPath = arrowLine.BuildArrowBody();
-                        changeData[AnnotArgsType.AnnotLine] = tag;
-                        IsLineAnnot = true;
+
+                        if (IsLineAnnot == false)
+                            IsLineAnnot = true;
+                        //if (isArrow == false)
+                        //    isArrow = true;
                         //  changeData[AnnotArgsType.AnnotLine] = tag;
                     }
 
@@ -260,17 +295,21 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                         arrowLine.LineStart = new Point(0, 32);
                         arrowLine.LineEnd = new Point(32, 0);
                         DataPath = arrowLine.BuildArrowBody();
-                        changeData[AnnotArgsType.AnnotLine] = tag;
-                        IsLineAnnot = true;
+
+                        if (IsLineAnnot == false)
+                            IsLineAnnot = true;
+                        //if (IsLine == false)
+                        //    IsLine = true;
                     }
 
                     break;
             }
 
-            if (isFromToolsBtn == false)
-                PropertyPanel.AnnotTypeChangedInvoke(this, changeData);
+            //if (isFromToolsBtn)
+            //    PropertyPanel.AnnotTypeChangedInvoke(this, changeData);
 
             StrShapeChecked = tag;
+            PropertyPanel.SharpsAnnot = tag;
             BasicVm.SetOtherTag(tag);
         }
 
@@ -301,8 +340,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
-
-
         private void SelectedFillColor_Command(object obj)
         {
             if (obj != null && PropertyPanel != null)
@@ -318,8 +355,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                         PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot);
                 }
             }
-
-
         }
 
         private void SelectedFillOpacity_Command(object obj)
@@ -331,9 +366,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 
                 PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, BasicVm.FillOpacity);
                 PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, BasicVm.FillOpacity);
-
             }
-
         }
 
         private void SelectedOpacityValue(object obj)
@@ -346,14 +379,10 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                 PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, BasicVm.FillOpacity);
                 PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, BasicVm.FillOpacity);
             }
-
         }
 
-
-
         private void SelectedBorderColor(object obj)
         {
-
             if (obj != null && PropertyPanel != null)
             {
                 var colorValue = (Color)obj;
@@ -367,7 +396,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                         PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot);
                 }
             }
-
         }
 
         private void SelectedThick_Command(object obj)
@@ -375,7 +403,8 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             if (obj is double)
             {
                 var tran = (double)obj;
-                BasicVm.AnnotThickness = tran;
+
+                //BasicVm.AnnotThickness = tran;
                 PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, tran);
 
                 if (BasicVm.IsMultiSelected == false)
@@ -391,6 +420,12 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
             BasicVm.IsMultiSelected = false;
+            //PropertyPanel.annot = null;
+            //PropertyPanel.AnnotEvents = null;
+            //PropertyPanel.AnnotEvent = null;
+            //PropertyPanel.annotlists = null;
+            //AnnotEvent = null;
+            //Annot = null;
         }
 
         private void SetAnnotType()
@@ -400,9 +435,11 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                 case AnnotArgsType.AnnotCircle:
                     BasicVm.AnnotTypeTitle = "圆";
                     break;
+
                 case AnnotArgsType.AnnotSquare:
                     BasicVm.AnnotTypeTitle = "矩形";
                     break;
+
                 case AnnotArgsType.AnnotLine:
 
                     var annotLine = Annot as LineAnnotArgs;
@@ -415,12 +452,12 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                     }
                     break;
             }
-
         }
 
         public AnnotAttribEvent AnnotEvent { get; set; }
-        private AnnotHandlerEventArgs Annot;
-        private AnnotTransfer PropertyPanel;
+        public AnnotHandlerEventArgs Annot;
+        public AnnotTransfer PropertyPanel;
+
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
             navigationContext.Parameters.TryGetValue<AnnotTransfer>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
@@ -441,7 +478,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 
                 LoadPropertyHandler?.Invoke(null, Annot);
             }
-
         }
 
         private List<SquareAnnotArgs> ConvertLists()
@@ -461,6 +497,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             else
                 return FreeTextLists;
         }
+
         private void IsAttributeEquals()
         {
             var list = ConvertLists();
@@ -491,12 +528,11 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                     {
                         if (temp.LineColor.A != item.LineColor.A || temp.LineColor.R != item.LineColor.R || temp.LineColor.G != item.LineColor.G || temp.LineColor.B != item.LineColor.B)
                         {
-                            BasicVm.BorderColor = new SolidColorBrush(Color.FromArgb(0x01,0xff,0xff,0xff));
+                            BasicVm.BorderColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
                             isNoEqualsDir["LineColor"] = true;
                         }
                     }
 
-
                     if (isNoEqualsDir["Thickness"] == false)
                     {
                         isNoEqualsDir["Thickness"] = true;
@@ -523,13 +559,11 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                 if (isNoEqualsDir["FillColor"] == false)
                 {
                     BasicVm.FillColor = new SolidColorBrush(temp.BgColor);
-
                 }
 
                 if (isNoEqualsDir["LineColor"] == false)
                 {
                     BasicVm.BorderColor = new SolidColorBrush(temp.LineColor);
-
                 }
 
                 if (isNoEqualsDir["Thickness"] == false)
@@ -547,11 +581,9 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                     BasicVm.IsSolidLine = isSolid;
                     BasicVm.IsDashLine = !isSolid;
                 }
-
             }
         }
 
-
         private bool IsSolidStyle(AnnotHandlerEventArgs annot)
         {
             bool isSolid = true;
@@ -591,10 +623,13 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                             BasicVm.FillOpacity = Square.Transparency;
                             BasicVm.AnnotThickness = Square.LineWidth;
                             Dash = Square.LineDash;
-                            SharpsType("Rect", true);
+                            //SharpsType("Rect", false);
                             BasicVm.AnnotTypeTitle = "矩形";
                             IsLineAnnot = false;
                             IsRect = true;
+                            //IsCircle = false;
+                            //IsArrow=false;
+                            //IsLine= false;
                         }
                         break;
 
@@ -608,10 +643,13 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                             BasicVm.FillOpacity = Circle.Transparency;
                             BasicVm.AnnotThickness = Circle.LineWidth;
                             Dash = Circle.LineDash;
-                            SharpsType("Circle", true);
+                            //SharpsType("Circle", false);
                             BasicVm.AnnotTypeTitle = "圆";
                             IsLineAnnot = false;
                             IsCircle = true;
+                            //IsRect = false;
+                            //IsArrow = false;
+                            //IsLine = false;
                         }
                         break;
 
@@ -628,19 +666,24 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 
                             if (line.TailLineType == C_LINE_TYPE.LINETYPE_ARROW && line.HeadLineType == C_LINE_TYPE.LINETYPE_NONE)
                             {
-                                SharpsType("Arrow", true);
+                                //SharpsType("Arrow", false);
                                 BasicVm.AnnotTypeTitle = "箭头";
                                 IsArrow = true;
+                                //IsCircle = false;
+                                //IsRect = false;
+                                //IsLine = false;
                             }
                             else
                             {
-                                SharpsType("Line", true);
+                                //SharpsType("Line", false);
                                 BasicVm.AnnotTypeTitle = "线条";
                                 IsLine = true;
+                                //IsCircle = false;
+                                //IsRect = false;
+                                //IsArrow = false;
                             }
 
                             IsLineAnnot = true;
-
                         }
 
                         break;
@@ -650,9 +693,6 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                 BasicVm.IsSolidLine = isSolid;
                 BasicVm.IsDashLine = !isSolid;
             }
-
         }
-
-
     }
-}
+}

+ 16 - 2
PDF Office/ViewModels/PropertyPanel/ViewModular/ViewModularContentViewModel.cs

@@ -3,6 +3,7 @@ using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
 using Microsoft.Office.Interop.Word;
 using PDF_Master.CustomControl;
+using PDF_Master.EventAggregators;
 using PDF_Master.Helper;
 using PDF_Master.Model;
 using PDF_Master.Model.BOTA;
@@ -11,6 +12,7 @@ using PDF_Master.Views;
 using PDF_Master.Views.BOTA;
 using PDFSettings.Settings;
 using Prism.Commands;
+using Prism.Events;
 using Prism.Mvvm;
 using Prism.Regions;
 using Prism.Services.Dialogs;
@@ -171,6 +173,13 @@ namespace PDF_Master.ViewModels.PropertyPanel.ViewModular
         private Visibility splitScreenViewVisible = Visibility.Collapsed;
         public OpenFileInfo OpenFileInfo = null;
 
+        private IEventAggregator events;
+
+        /// <summary>
+        /// 用于区分事件的唯一码
+        /// </summary>
+        private string unicode;
+
         /// <summary>
         /// 控制Content的显示 用于显示分屏的模块
         /// </summary>
@@ -276,11 +285,13 @@ namespace PDF_Master.ViewModels.PropertyPanel.ViewModular
 
         public DelegateCommand OpenFullCommand { get; set; }
 
-        public ViewModularContentViewModel(IRegionManager regionManager, IDialogService dialogService)
+        public ViewModularContentViewModel(IRegionManager regionManager, IDialogService dialogService, IEventAggregator eventAggregator)
         {
             InitString();
             region = regionManager;
             dialogs = dialogService;
+            events = eventAggregator;
+            unicode = App.mainWindowViewModel.SelectedItem.Unicode;
             //未显示时无法注册上Region名称,所以需要短暂显示
             //SplitScreenViewVisible = Visibility.Visible;
             //SplitScreenViewRegionName = RegionNames.SplitScreenViewRegionName;
@@ -346,6 +357,9 @@ namespace PDF_Master.ViewModels.PropertyPanel.ViewModular
                 SplitScreenPDFViewer.RotatePage(PageRotate.Rotate90, right, SplitScreenPDFViewer.CurrentIndex);
             }
             PDFViewer.UndoManager.CanSave = true;
+
+            events.GetEvent<ViewContentEvent>().Publish(new ViewContentEventArgs() { type = right ? EventType.RightRotate : EventType.LeftRotate, Unicode = unicode });
+
             //后续需要添加,缩略图旋转改变
 
             if (ViewContentViewModel.OpenBOTA == true)
@@ -519,7 +533,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.ViewModular
             OpenFileInfo fileInfo = SettingHelper.GetFileInfo(PDFViewer.Document.FilePath);
             if (fileInfo != null)
             {
-                if (modeView is SplitMode)
+                if (modeView is ComPDFKitViewer.SplitMode)
                 {
                     fileInfo.LastSplitMode = PDFViewer.Mode;
                 }

+ 6 - 2
PDF Office/ViewModels/Tools/AnnotManager/AnnotTransfer.cs

@@ -30,6 +30,8 @@ namespace PDF_Master.ViewModels.Tools.AnnotManager
         public Dictionary<AnnotArgsType, AnnotHandlerEventArgs> LastAnnotDict = new Dictionary<AnnotArgsType, AnnotHandlerEventArgs>();
         public AnnotHandlerEventArgs LastArrowAnnot = null;
 
+        public string SharpsAnnot = "Rect";
+
         //是否为填写与签名的日期文本
         public bool IsTextFill { get; private set; }
 
@@ -175,6 +177,7 @@ namespace PDF_Master.ViewModels.Tools.AnnotManager
         //单个属性更改
         public void UpdateAnnotAAttrib(AnnotAttrib annotAttrib, object obj)
         {
+            if (annotlists == null) return;
             if (annotlists != null && annotlists.Count > 1)
             {
                 foreach (var itemevent in AnnotEvents)
@@ -183,7 +186,7 @@ namespace PDF_Master.ViewModels.Tools.AnnotManager
                     itemevent?.UpdateAnnot();
                 }
             }
-            else
+            else if (annotlists.Count == 1)
             {
                 AnnotEvent?.UpdateAttrib(annotAttrib, obj);
                 AnnotEvent?.UpdateAnnot();
@@ -194,6 +197,7 @@ namespace PDF_Master.ViewModels.Tools.AnnotManager
         //多个属性更改
         public void UpdateAnnotAllAttribs(Dictionary<AnnotAttrib, object> AnnotAttribDir)
         {
+            if (annotlists == null) return;
             if (annotlists != null && annotlists.Count > 1)
             {
                 foreach (var itemevent in AnnotEvents)
@@ -206,7 +210,7 @@ namespace PDF_Master.ViewModels.Tools.AnnotManager
                     itemevent?.UpdateAnnot();
                 }
             }
-            else
+            else if (annotlists.Count == 1)
             {
                 foreach (var item in AnnotAttribDir)
                 {

+ 87 - 55
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -37,10 +37,10 @@ namespace PDF_Master.ViewModels.Tools
         {
             //属性面板与注释工具栏绑定:属性面板的属性变化,会同步注释工具栏的属性值
             //比如在属性面板里更改注释颜色,会同时更新工具栏对应的工具颜色
-            propertyPanel.DataChanged -= AnnotPropertyPanel_DataChanged;
-            propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
-            propertyPanel.AnnotTypeChanged -= AnnotPropertyPanel_AnnotTypeChanged;
-            propertyPanel.AnnotTypeChanged += AnnotPropertyPanel_AnnotTypeChanged;
+            PropertyPanel.DataChanged -= AnnotPropertyPanel_DataChanged;
+            PropertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
+            PropertyPanel.AnnotTypeChanged -= AnnotPropertyPanel_AnnotTypeChanged;
+            PropertyPanel.AnnotTypeChanged += AnnotPropertyPanel_AnnotTypeChanged;
             //快捷键
             KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
             KeyEventsHelper.KeyDown += ShortCut_KeyDown;
@@ -48,8 +48,8 @@ namespace PDF_Master.ViewModels.Tools
 
         private void UnBindingEvent()
         {
-            propertyPanel.DataChanged -= AnnotPropertyPanel_DataChanged;
-            propertyPanel.AnnotTypeChanged -= AnnotPropertyPanel_AnnotTypeChanged;
+            PropertyPanel.DataChanged -= AnnotPropertyPanel_DataChanged;
+            PropertyPanel.AnnotTypeChanged -= AnnotPropertyPanel_AnnotTypeChanged;
             //快捷盘解绑
             KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
         }
@@ -266,7 +266,7 @@ namespace PDF_Master.ViewModels.Tools
 
                     if (StrAnnotToolChecked == "Link")
                     {
-                        propertyPanel.IsAddLink = false;
+                        PropertyPanel.IsAddLink = false;
                     }
 
                     GetLink(e.AnnotItemsList, e);
@@ -278,11 +278,11 @@ namespace PDF_Master.ViewModels.Tools
                     customStickyPopup.GetPDFViewer = PDFViewer;
                     if (e.IsAnnotCreateReset)
                     {
-                        propertyPanel.annot = e.AnnotItemsList[0];
+                        PropertyPanel.annot = e.AnnotItemsList[0];
                         var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
-                        propertyPanel.AnnotEvents = null;
-                        propertyPanel.AnnotEvent = AnnotEvent;
-                        propertyPanel.annotlists = e.AnnotItemsList;
+                        PropertyPanel.AnnotEvents = null;
+                        PropertyPanel.AnnotEvent = AnnotEvent;
+                        PropertyPanel.annotlists = e.AnnotItemsList;
                     }
                     break;
 
@@ -401,6 +401,7 @@ namespace PDF_Master.ViewModels.Tools
                         {
                             GetSelectedAnnots(e);
                             PDFViewer.SetToolParam(annot);
+
                             //switch (annot.EventType)
                             //{
                             //    case AnnotArgsType.AnnotFreeText:
@@ -528,23 +529,53 @@ namespace PDF_Master.ViewModels.Tools
             {
                 if (viewContentViewModel.CurrentBar != "TabItemAnnotation")
                 {
+                    //viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
                     return;
-                }
-
-                if (StrAnnotToolChecked == "Link")
-                {
-                    if (PDFViewer.MouseMode != MouseModes.AnnotCreate)
-                    {
-                        if (PDFViewer.MouseMode == MouseModes.PanTool && propertyPanel.IsAddLink == false && propertyPanel.IsLocationLink == false)
-                        {
-                            viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
-                        }
-                    }
-                }
-                if (string.IsNullOrWhiteSpace(StrAnnotToolChecked))
+                }
+
+                if (!string.IsNullOrWhiteSpace(StrAnnotToolChecked))
                 {
+                    PropertyPanel.annot = null;
+                    PropertyPanel.AnnotEvents = null;
+                    PropertyPanel.AnnotEvent = null;
+                    PropertyPanel.annotlists = null;
+                    if (StrAnnotToolChecked != "Stamp" && StrAnnotToolChecked != "Freetext")
+                    {
+                        AnnotHandlerEventArgs annotArgs = null;
+                        //propertyPanel.SaveLastAnnot();
+                        FindAnnotTypeKey(StrAnnotToolChecked, ref annotArgs);
+                        //if (annotArgs != null)
+                        //{
+                        //    //设置点击页面会创建对应选中注释工具的注释
+                        //    annotArgs.Author = Settings.Default.AppProperties.Description.Author;
+                        //    PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+                        //    PDFViewer.SetToolParam(annotArgs);
+                        //}
+                    }
+                }
+                else
+                {
+                    PropertyPanel.annot = null;
+                    PropertyPanel.AnnotEvents = null;
+                    PropertyPanel.AnnotEvent = null;
+                    PropertyPanel.annotlists = null;
                     viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
-                }
+                }
+
+                //if (StrAnnotToolChecked == "Link")
+                //{
+                //    if (PDFViewer.MouseMode != MouseModes.AnnotCreate)
+                //    {
+                //        if (PDFViewer.MouseMode == MouseModes.PanTool && propertyPanel.IsAddLink == false && propertyPanel.IsLocationLink == false)
+                //        {
+                //            viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                //        }
+                //    }
+                //}
+                //if (string.IsNullOrWhiteSpace(StrAnnotToolChecked))
+                //{
+                //    viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                //}
             }
         }
 
@@ -907,14 +938,14 @@ namespace PDF_Master.ViewModels.Tools
                     {
                         case ActionType.Add:
 
-                            if (editEvent.EditAnnotArgs is StickyAnnotArgs stickyAnnotArgs)
-                            {
-                                PDFViewer.SelectAnnotation(stickyAnnotArgs.PageIndex, stickyAnnotArgs.AnnotIndex);
-                            }
-                            if (editEvent.EditAnnotArgs is FreeTextAnnotArgs freeTextAnnotArgs)
-                            {
-                                PDFViewer.SelectAnnotation(freeTextAnnotArgs.PageIndex, freeTextAnnotArgs.AnnotIndex);
-                            }
+                            //if (editEvent.EditAnnotArgs is StickyAnnotArgs stickyAnnotArgs)
+                            //{
+                            //    PDFViewer.SelectAnnotation(stickyAnnotArgs.PageIndex, stickyAnnotArgs.AnnotIndex);
+                            //}
+                            //if (editEvent.EditAnnotArgs is FreeTextAnnotArgs freeTextAnnotArgs)
+                            //{
+                            //    PDFViewer.SelectAnnotation(freeTextAnnotArgs.PageIndex, freeTextAnnotArgs.AnnotIndex);
+                            //}
                             //BOTA
                             bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
 
@@ -1018,7 +1049,7 @@ namespace PDF_Master.ViewModels.Tools
                 }
             }
 
-            if (isAdd)
+            if (isAdd && selectAnnotDicts.Count > 1)
             {
                 PDFViewer.ClearSelectAnnots();
 
@@ -1120,21 +1151,21 @@ namespace PDF_Master.ViewModels.Tools
         //同一属性面板,不同的注释类型
         private void AnnotPropertyPanel_AnnotTypeChanged(object sender, Dictionary<AnnotArgsType, object> e)
         {
-            if (e != null)
+            if (e != null && sender is SharpsAnnotPropertyViewModel sharpsAnnot)
             {
                 AnnotHandlerEventArgs annotArgs = null;
-                propertyPanel.SaveLastAnnot();
+                //PropertyPanel.SaveLastAnnot();
 
                 foreach (AnnotArgsType argsType in e.Keys)
                 {
-                    if (propertyPanel.annot.EventType != argsType)
+                    if (PropertyPanel.annot.EventType != argsType)
                     {
                         PDFViewer.SetMouseMode(MouseModes.PanTool);
                     }
-
                     switch (argsType)
                     {
                         case AnnotArgsType.AnnotSquare:
+
                             annotArgs = GetRect();
                             break;
 
@@ -1183,11 +1214,11 @@ namespace PDF_Master.ViewModels.Tools
                                 HighLightOpacity = (double)e[argsType];
                             }
                             //创建注释后,修改注释属性,可用于下次创建的注释
-                            if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                            if (PropertyPanel != null && PropertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
                             {
                                 if (StrAnnotToolChecked == key.Key)
                                 {
-                                    PDFViewer.SetToolParam(propertyPanel.annot);
+                                    PDFViewer.SetToolParam(PropertyPanel.annot);
                                 }
                             }
                             break;
@@ -1202,11 +1233,11 @@ namespace PDF_Master.ViewModels.Tools
                                 underLineOpacity = (double)e[argsType];
                             }
                             //创建注释后,修改注释属性,可用于下次创建的注释
-                            if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                            if (PropertyPanel != null && PropertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
                             {
                                 if (StrAnnotToolChecked == key.Key)
                                 {
-                                    PDFViewer.SetToolParam(propertyPanel.annot);
+                                    PDFViewer.SetToolParam(PropertyPanel.annot);
                                 }
                             }
                             break;
@@ -1221,11 +1252,11 @@ namespace PDF_Master.ViewModels.Tools
                                 SquigglyOpacity = (double)e[argsType];
                             }
                             //创建注释后,修改注释属性,可用于下次创建的注释
-                            if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                            if (PropertyPanel != null && PropertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
                             {
                                 if (StrAnnotToolChecked == key.Key)
                                 {
-                                    PDFViewer.SetToolParam(propertyPanel.annot);
+                                    PDFViewer.SetToolParam(PropertyPanel.annot);
                                 }
                             }
                             break;
@@ -1240,11 +1271,11 @@ namespace PDF_Master.ViewModels.Tools
                                 StrikeoutOpacity = (double)e[argsType];
                             }
                             //创建注释后,修改注释属性,可用于下次创建的注释
-                            if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                            if (PropertyPanel != null && PropertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
                             {
                                 if (StrAnnotToolChecked == key.Key)
                                 {
-                                    PDFViewer.SetToolParam(propertyPanel.annot);
+                                    PDFViewer.SetToolParam(PropertyPanel.annot);
                                 }
                             }
                             break;
@@ -1256,24 +1287,24 @@ namespace PDF_Master.ViewModels.Tools
                                 var annot = e[argsType] as FreehandAnnotArgs;
                                 if (annot != null)
                                 {
-                                    if (propertyPanel != null)
+                                    if (PropertyPanel != null)
                                     {
                                         //属性面板,切换橡皮擦后,再回到画笔时,需要恢复最近画笔的属性值
                                         var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
-                                        propertyPanel.AnnotEvent = AnnotEvent;
+                                        PropertyPanel.AnnotEvent = AnnotEvent;
                                         var AnnotEvents = new List<AnnotAttribEvent>();
                                         AnnotEvents.Add(AnnotEvent);
-                                        propertyPanel.AnnotEvents = AnnotEvents;
-                                        propertyPanel.annot = annot;
+                                        PropertyPanel.AnnotEvents = AnnotEvents;
+                                        PropertyPanel.annot = annot;
                                         //手绘注释工具按钮的属性
                                         // FreehandPath.Opacity = annot.Transparency;
                                         // FreehandPath.Fill = new SolidColorBrush(annot.InkColor);
                                     }
-                                    if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                                    if (PropertyPanel != null && PropertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
                                     {
                                         if (StrAnnotToolChecked == key.Key)
                                         {
-                                            PDFViewer.SetToolParam(propertyPanel.annot);
+                                            PDFViewer.SetToolParam(PropertyPanel.annot);
                                         }
                                     }
                                 }
@@ -1305,11 +1336,12 @@ namespace PDF_Master.ViewModels.Tools
                         case AnnotArgsType.AnnotLine:
                         case AnnotArgsType.AnnotFreeText:
                             //创建注释后,修改注释属性,可用于下次创建的注释
-                            if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                            if (PropertyPanel != null && PropertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
                             {
-                                if (StrAnnotToolChecked == key.Key)
+                                if (StrAnnotToolChecked == key.Key || PropertyPanel.SharpsAnnot == key.Key)
                                 {
-                                    PDFViewer.SetToolParam(propertyPanel.annot);
+                                    PDFViewer.SetToolParam(PropertyPanel.annot);
+                                    PropertyPanel.SaveLastAnnot();
                                 }
                             }
 

+ 61 - 20
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -229,7 +229,25 @@ namespace PDF_Master.ViewModels.Tools
                     break;
 
                 case "Rect"://矩形
-                    annotArgs = GetRect();
+
+                    switch (PropertyPanel.SharpsAnnot)
+                    {
+                        case "Rect":
+                            annotArgs = GetRect();
+                            break;
+
+                        case "Circle":
+                            annotArgs = GetCircle();
+                            break;
+
+                        case "Arrow":
+                            annotArgs = GetArrowLine("Arrow");
+                            break;
+
+                        case "Line":
+                            annotArgs = GetArrowLine("Line");
+                            break;
+                    }
                     break;
 
                 case "Circle"://圆
@@ -274,7 +292,7 @@ namespace PDF_Master.ViewModels.Tools
                         dialogs.ShowDialog(DialogNames.IAPCompareDialog);
                         return;
                     }
-                    propertyPanel.IsAddLink = true;
+                    PropertyPanel.IsAddLink = true;
                     viewContentViewModel.IsRightMenuCreateLink = isRightMenuAdd;
                     annotArgs = GetLink();
                     break;
@@ -297,7 +315,7 @@ namespace PDF_Master.ViewModels.Tools
                 highlightArgs.Transparency = highLightOpacity;
                 highlightArgs.Color = (highLightColor as SolidColorBrush).Color;
 
-                if (propertyPanel.LastAnnotDict[AnnotArgsType.AnnotHighlight] == null)
+                if (PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotHighlight] == null)
                 {
                     var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(highlightArgs.EventType);
                     if (defaultAnnot == null)
@@ -369,7 +387,7 @@ namespace PDF_Master.ViewModels.Tools
                 underlineArgs = new TextUnderlineAnnotArgs();
                 underlineArgs.Transparency = UnderLineOpacity;
                 underlineArgs.Color = (UnderLineColor as SolidColorBrush).Color;
-                if (propertyPanel.LastAnnotDict[AnnotArgsType.AnnotUnderline] == null)
+                if (PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotUnderline] == null)
                 {
                     var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(underlineArgs.EventType);
                     if (defaultAnnot == null)
@@ -412,7 +430,7 @@ namespace PDF_Master.ViewModels.Tools
                 squigglyArgs.Transparency = SquigglyOpacity;
                 squigglyArgs.Color = (squigglyColor as SolidColorBrush).Color;
 
-                if (propertyPanel.LastAnnotDict[AnnotArgsType.AnnotSquiggly] == null)
+                if (PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotSquiggly] == null)
                 {
                     var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(squigglyArgs.EventType);
                     if (defaultAnnot == null)
@@ -455,7 +473,7 @@ namespace PDF_Master.ViewModels.Tools
                 strikeoutArgs.Transparency = strikeoutOpacity;
                 strikeoutArgs.Color = (strikeoutColor as SolidColorBrush).Color;
 
-                if (propertyPanel.LastAnnotDict[AnnotArgsType.AnnotStrikeout] == null)
+                if (PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotStrikeout] == null)
                 {
                     var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(strikeoutArgs.EventType);
                     if (defaultAnnot == null)
@@ -505,7 +523,7 @@ namespace PDF_Master.ViewModels.Tools
                     freehandArgs.InkColor = Color.FromRgb(0x38, 0xE0, 0x2E);
                 }
 
-                if (propertyPanel.LastAnnotDict[AnnotArgsType.AnnotFreehand] == null)
+                if (PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotFreehand] == null)
                 {
                     var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(freehandArgs.EventType);
                     if (defaultAnnot == null)
@@ -542,7 +560,10 @@ namespace PDF_Master.ViewModels.Tools
                 }
                 else
                 {
-                    freehandArgs = propertyPanel.LastAnnotDict[AnnotArgsType.AnnotFreehand] as FreehandAnnotArgs;
+                    freehandArgs = PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotFreehand] as FreehandAnnotArgs;
+                    freehandArgs.AnnotIndex = -1;
+                    freehandArgs.PageIndex = -1;
+                    freehandArgs.ClientRect = Rect.Empty;
                 }
 
                 selectedArgs = new List<AnnotHandlerEventArgs>();
@@ -585,7 +606,7 @@ namespace PDF_Master.ViewModels.Tools
                     freetextArgs.FontColor = Colors.Black;
                 }
 
-                if (propertyPanel.LastAnnotDict[AnnotArgsType.AnnotFreeText] == null)
+                if (PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotFreeText] == null)
                 {
                     var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(freetextArgs.EventType);
                     if (defaultAnnot == null)
@@ -627,7 +648,7 @@ namespace PDF_Master.ViewModels.Tools
                 }
                 else
                 {
-                    FreeTextAnnotArgs freeText = propertyPanel.LastAnnotDict[AnnotArgsType.AnnotFreeText] as FreeTextAnnotArgs;
+                    FreeTextAnnotArgs freeText = PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotFreeText] as FreeTextAnnotArgs;
                     freetextArgs = SetFreetextArgs(freeText);
                     //freetextArgs = SetFreetextArgs(freeText);
                     //freetextArgs.Content = string.Empty;
@@ -846,7 +867,7 @@ namespace PDF_Master.ViewModels.Tools
                     stickyAnnotArgs.Color = Color.FromRgb(0xFF, 0x81, 0x33);
                 }
 
-                if (propertyPanel.LastAnnotDict[AnnotArgsType.AnnotSticky] == null)
+                if (PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotSticky] == null)
                 {
                     var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(stickyAnnotArgs.EventType);
                     if (defaultAnnot == null)
@@ -863,7 +884,7 @@ namespace PDF_Master.ViewModels.Tools
                 }
                 else
                 {
-                    stickyAnnotArgs = propertyPanel.LastAnnotDict[AnnotArgsType.AnnotSticky] as StickyAnnotArgs;
+                    stickyAnnotArgs = PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotSticky] as StickyAnnotArgs;
                     stickyAnnotArgs.Content = string.Empty;
                     stickyAnnotArgs.StickyNote = string.Empty;
                 }
@@ -911,7 +932,7 @@ namespace PDF_Master.ViewModels.Tools
                     squareArgs.BgColor = Colors.Red;
                 }
 
-                if (propertyPanel.LastAnnotDict[AnnotArgsType.AnnotSquare] == null)
+                if (PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotSquare] == null)
                 {
                     var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(squareArgs.EventType);
                     if (defaultAnnot == null)
@@ -947,7 +968,12 @@ namespace PDF_Master.ViewModels.Tools
                 }
                 else
                 {
-                    squareArgs = propertyPanel.LastAnnotDict[AnnotArgsType.AnnotSquare] as SquareAnnotArgs;
+                    SquareAnnotArgs squareAnnot = PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotSquare] as SquareAnnotArgs;
+                    squareArgs.BgColor = squareAnnot.BgColor;
+                    squareArgs.LineColor = squareAnnot.LineColor;
+                    squareArgs.LineWidth = squareAnnot.LineWidth;
+                    squareArgs.Transparency = squareAnnot.Transparency;
+                    squareArgs.LineDash = squareAnnot.LineDash;
                 }
 
                 if (squareArgs != null)
@@ -990,7 +1016,7 @@ namespace PDF_Master.ViewModels.Tools
                     circleAnnotArgs.BgColor = Colors.Red;
                 }
 
-                if (propertyPanel.LastAnnotDict[AnnotArgsType.AnnotCircle] == null)
+                if (PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotCircle] == null)
                 {
                     var defaultAnnot = SettingHelper.GetAnnotDefaultProperty(circleAnnotArgs.EventType);
                     if (defaultAnnot == null)
@@ -1028,7 +1054,12 @@ namespace PDF_Master.ViewModels.Tools
                 }
                 else
                 {
-                    circleAnnotArgs = propertyPanel.LastAnnotDict[AnnotArgsType.AnnotCircle] as CircleAnnotArgs;
+                    CircleAnnotArgs circleAnnot = PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotCircle] as CircleAnnotArgs;
+                    circleAnnotArgs.LineColor = circleAnnot.LineColor;
+                    circleAnnotArgs.BgColor = circleAnnot.BgColor;
+                    circleAnnotArgs.LineWidth = circleAnnot.LineWidth;
+                    circleAnnotArgs.Transparency = circleAnnot.Transparency;
+                    circleAnnotArgs.LineDash = circleAnnot.LineDash;
                 }
 
                 if (circleAnnotArgs != null)
@@ -1073,12 +1104,12 @@ namespace PDF_Master.ViewModels.Tools
                 if (TagStr == "Line")
                 {
                     lineArgs.TailLineType = C_LINE_TYPE.LINETYPE_NONE;
-                    isLastAnnot = (propertyPanel.LastAnnotDict[AnnotArgsType.AnnotLine] != null ? true : false);
+                    isLastAnnot = (PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotLine] != null ? true : false);
                 }
                 else
                 {
                     lineArgs.TailLineType = C_LINE_TYPE.LINETYPE_ARROW;
-                    isLastAnnot = (propertyPanel.LastArrowAnnot != null ? true : false);
+                    isLastAnnot = (PropertyPanel.LastArrowAnnot != null ? true : false);
                 }
 
                 if (isLastAnnot == false)
@@ -1120,14 +1151,23 @@ namespace PDF_Master.ViewModels.Tools
                 }
                 else
                 {
+                    LineAnnotArgs lineAnnot = null;
                     if (lineArgs.TailLineType == C_LINE_TYPE.LINETYPE_ARROW)
                     {
-                        lineArgs = propertyPanel.LastArrowAnnot as LineAnnotArgs;
+                        lineAnnot = PropertyPanel.LastArrowAnnot as LineAnnotArgs;
                     }
                     else
                     {
-                        lineArgs = propertyPanel.LastAnnotDict[AnnotArgsType.AnnotLine] as LineAnnotArgs;
+                        lineAnnot = PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotLine] as LineAnnotArgs;
                     }
+
+                    lineArgs.LineColor = lineAnnot.LineColor;
+                    lineArgs.HeadLineType = lineAnnot.HeadLineType;
+                    lineArgs.TailLineType = lineAnnot.TailLineType;
+                    lineArgs.LineWidth = lineAnnot.LineWidth;
+                    lineArgs.Transparency = lineAnnot.Transparency;
+                    lineArgs.LineDash = lineAnnot.LineDash;
+
                 }
 
                 if (lineArgs != null)
@@ -1229,6 +1269,7 @@ namespace PDF_Master.ViewModels.Tools
             //SnapshotEditMenuViewModel = snapshotEditMenuViewModel;
 
             #endregion to do
+
             StrAnnotToolChecked = "";
             return snapshotArgs;
         }

+ 28 - 24
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Layout.cs

@@ -40,43 +40,48 @@ namespace PDF_Master.ViewModels.Tools
         {
             if (annots != null)
             {
-                propertyPanel.annotlists = annots;
-                propertyPanel.annot = annots[0];
+                PropertyPanel.annotlists = annots;
+                PropertyPanel.annot = annots[0];
             }
             else
             {
-                propertyPanel.annotlists = null;
-                propertyPanel.annot = null;
+                PropertyPanel.annotlists = null;
+                PropertyPanel.annot = null;
             }
-
+            PropertyPanel.AnnotEvents = null;
+            PropertyPanel.AnnotEvent = null;
             if (annots != null)
             {
                 if (annots.Count > 1)
                 {
-                    if (propertyPanel.AnnotEvents == null)
-                        propertyPanel.AnnotEvents = new List<AnnotAttribEvent>();
-
-                    propertyPanel.AnnotEvents.Clear();
-
+                    if (PropertyPanel.AnnotEvents == null)
+                    {
+                        PropertyPanel.AnnotEvents = new List<AnnotAttribEvent>();
+                    }
+
+                    PropertyPanel.AnnotEvents.Clear();
+
                     foreach (var itemAnnot in annots)
                     {
-                        var eventitem = AnnotAttribEvent.GetAnnotAttribEvent(itemAnnot, itemAnnot.GetAnnotAttrib());
-                        propertyPanel.AnnotEvents.Add(eventitem);
+                        var eventitem = AnnotAttribEvent.GetAnnotAttribEvent(itemAnnot, itemAnnot.GetAnnotAttrib());
+                        //eventitem.ClearChangeAttribute();
+                        PropertyPanel.AnnotEvents.Add(eventitem);
                     }
                 }
 
-                propertyPanel.AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annots[0], annots[0].GetAnnotAttrib());
+                PropertyPanel.AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annots[0], annots[0].GetAnnotAttrib());
+                //propertyPanel.AnnotEvent.ClearChangeAttribute();
                 if (annots[0] is LinkAnnotArgs && annotAttribEvent != null)
                 {
-                    propertyPanel.AnnotEvent = annotAttribEvent;
+                    PropertyPanel.AnnotEvent = annotAttribEvent;
                 }
             }
 
-            propertyPanel.SetIsTextFill(false);
+            PropertyPanel.SetIsTextFill(false);
 
             if (string.IsNullOrEmpty(viewContent) == false)
             {
-                viewContentViewModel.SelectedPrpoertyPanel(viewContent, propertyPanel);
+                viewContentViewModel.SelectedPrpoertyPanel(viewContent, PropertyPanel);
             }
         }
 
@@ -292,18 +297,17 @@ namespace PDF_Master.ViewModels.Tools
         private ContextMenu SelectedTextOrImageContextMenu(object sender, AnnotCommandArgs annotCommand)
         {
             ContextMenu popMenu = new ContextMenu();
-            popMenu.FontSize = 14;
-
-            
+            popMenu.FontSize = 14;
+
             MenuItem menuItem = new MenuItem();
             menuItem = new MenuItem();
             menuItem.CommandTarget = (UIElement)sender;
             menuItem.Command = ApplicationCommands.Copy;
             if (annotCommand.CommandTarget == TargetType.ImageSelection && PDFViewer.GetSelectImageCount() > 0)
             {
-                menuItem.IsEnabled= true;
+                menuItem.IsEnabled = true;
             }
-           
+
             popMenu.Items.Add(menuItem);
 
             menuItem = new MenuItem();
@@ -318,11 +322,11 @@ namespace PDF_Master.ViewModels.Tools
                 popMenu.Items.Add(separator);
 
                 SetSelectTextOrImageMenuItem(App.MainPageLoader.GetString("ViewRightMenu_ExtractImage"), "ExportPicture", annotCommand, out menuItem);
-                if(PDFViewer.GetSelectImageCount() > 0)
+                if (PDFViewer.GetSelectImageCount() > 0)
                 {
-                    menuItem.IsEnabled= true;
+                    menuItem.IsEnabled = true;
                 }
-                
+
                 popMenu.Items.Add(menuItem);
             }
             else if (annotCommand.CommandTarget == TargetType.Annot)

+ 1 - 1
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs

@@ -140,7 +140,7 @@ namespace PDF_Master.ViewModels.Tools
         public OpenFileInfo OpenFileInfo = null;
         public CPDFViewer PDFViewer;
         private ViewContentViewModel viewContentViewModel;
-        private AnnotTransfer propertyPanel = new AnnotTransfer();
+        private AnnotTransfer PropertyPanel = new AnnotTransfer();
         private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
         private Dictionary<string, string> ToolTipDict = new Dictionary<string, string>();
         private StickyNotePopup customStickyPopup;

+ 7 - 7
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -188,7 +188,7 @@ namespace PDF_Master.ViewModels.Tools
 
             if (annotBtn.IsChecked == true)
             {
-                propertyPanel.SaveLastAnnot();
+                PropertyPanel.SaveLastAnnot();
                 MyToolCheckedDoing(dictVar, tag);
                 FindAnnotTypeKey(tag, ref annotArgs);
 
@@ -203,8 +203,8 @@ namespace PDF_Master.ViewModels.Tools
             else
             {
                 //取消选中注释工具按钮后,恢复到未编辑注释的状态
-                propertyPanel.IsAddLink = false;
-                propertyPanel.IsLocationLink = false;
+                PropertyPanel.IsAddLink = false;
+                PropertyPanel.IsLocationLink = false;
                 PDFViewer.ToolManager.EnableClickCreate = false;
                 PDFViewer.SetMouseMode(MouseModes.PanTool);
                 ShowPropertyPanel(false);
@@ -370,8 +370,8 @@ namespace PDF_Master.ViewModels.Tools
                 AnnotHandlerEventArgs annotHandler = null;
                 string str = menuItem.Tag.ToString();
                 viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
-                propertyPanel.IsAddLink = false;
-                propertyPanel.IsLocationLink = false;
+                PropertyPanel.IsAddLink = false;
+                PropertyPanel.IsLocationLink = false;
                 if (str == AddAnnotType.AnnotFreehand.ToString())
                 {
                     annotHandler = GetFreehand();
@@ -402,7 +402,7 @@ namespace PDF_Master.ViewModels.Tools
                 }
                 if (str == AddAnnotType.AnnotLink.ToString())
                 {
-                    propertyPanel.IsAddLink = true;
+                    PropertyPanel.IsAddLink = true;
 
                     annotHandler = GetLink();
                 }
@@ -577,7 +577,7 @@ namespace PDF_Master.ViewModels.Tools
                         StrAnnotToolChecked = "Link";
                         List<AnnotHandlerEventArgs> lists = new List<AnnotHandlerEventArgs>();
                         lists.Add(linkArgs);
-                        propertyPanel.IsAddLink = true;
+                        PropertyPanel.IsAddLink = true;
 
                         AnnotHandlerEventArgs annotArgs = GetLink(lists);
                         PDFViewer.SetMouseMode(MouseModes.AnnotCreate);

+ 3 - 1
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -823,6 +823,7 @@ namespace PDF_Master.ViewModels
             eventAggregator.GetEvent<ShowTipEvent>().Subscribe(ShowSelectedTipAsync, e => e.Unicode == unicode);
 
             //TODO:根据缓存 选择用户上次选择的菜单
+            CurrentBar = "TabItemAnnotation";
             EnterSelectedBar("TabItemAnnotation");
         }
 
@@ -2027,7 +2028,7 @@ namespace PDF_Master.ViewModels
         {
             try
             {
-                if (string.IsNullOrEmpty(PDFViewer.Document.FilePath))
+                if (string.IsNullOrEmpty(PDFViewer.Document.FilePath)||mainViewModel.NewFile)
                     return saveAsFile();
 
                 //文档已被修复时 提示另存为
@@ -2271,6 +2272,7 @@ namespace PDF_Master.ViewModels
                     result = PDFViewer.Document.WriteToFilePath(dlg.FileName);
                     if (result)
                     {
+                        mainViewModel.NewFile = false;
                         App.OpenedFileList.Remove(oldpath);
                         DoAfterSaveAs(dlg.FileName);
                     }

+ 6 - 3
PDF Office/Views/BOTA/AnnotationContent.xaml

@@ -45,9 +45,10 @@
             <convert:IntToBooleanConvert x:Key="IntToBooleanConvert" />
             <convert:AnnotateFontSizeConverter x:Key="AnnotateFontSizeConverter" />
             <convert:GroupHeaderConverter x:Key="GroupHeaderConverter" />
+            <convert:UnVisibleToBoolConvert x:Key="UnvisibleToBool" />
         </ResourceDictionary>
     </UserControl.Resources>
-    <Grid>
+    <Grid PreviewMouseLeftButtonDown="Grid_PreviewMouseLeftButtonDown">
         <Grid.RowDefinitions>
             <RowDefinition Height="48" />
             <RowDefinition Height="*" />
@@ -264,7 +265,8 @@
                                     Name="MenuExpandAll"
                                     Width="auto"
                                     Click="MenuExpandAll_Click"
-                                    Header="{Binding T_Expand}">
+                                    Header="{Binding T_Expand}"
+                                    IsEnabled="{Binding IsEmptyPanelVisibility, Converter={StaticResource UnvisibleToBool}}">
                                     <MenuItem.Icon>
                                         <Border Background="Transparent" />
                                     </MenuItem.Icon>
@@ -272,7 +274,8 @@
                                 <MenuItem
                                     Name="MenuCollapseAll"
                                     Click="MenuCollapseAll_Click"
-                                    Header="{Binding T_Collapse}" />
+                                    Header="{Binding T_Collapse}"
+                                    IsEnabled="{Binding IsEmptyPanelVisibility, Converter={StaticResource UnvisibleToBool}}" />
                                 <MenuItem Name="MenuSort" Visibility="Collapsed">
                                     <MenuItem.Header>
                                         <TextBlock Name="MenuSortText" Text="排序" />

+ 37 - 2
PDF Office/Views/BOTA/AnnotationContent.xaml.cs

@@ -1,8 +1,10 @@
 using ComPDFKitViewer.AnnotEvent;
 using PDF_Master.DataConvert;
+using PDF_Master.EventAggregators;
 using PDF_Master.Helper;
 using PDF_Master.Model.BOTA;
 using PDF_Master.ViewModels.BOTA;
+using Prism.Events;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -34,14 +36,23 @@ namespace PDF_Master.Views.BOTA
     {
         private AnnotationContentViewModel viewModel;
 
-        public AnnotationContent()
+        private string unicode;
+        public AnnotationContent(IEventAggregator eventAggregator)
         {
             InitializeComponent();
+            unicode = App.mainWindowViewModel.SelectedItem.Unicode;
             viewModel = this.DataContext as AnnotationContentViewModel;
             if (AnnotationList.Items.Count < 0)
             {
                 MenuExpandAll.IsEnabled = false;
             }
+
+            eventAggregator.GetEvent<CleanSelectAllEvent>().Subscribe(CleanSelectAll, e => e.Unicode == unicode);
+        }
+
+        private void CleanSelectAll(CleanSelectAllArgs obj)
+        {
+            AnnotationList.SelectedIndex = -1;
         }
 
         private void ListBoxItem_PreviewMouseDown(object sender, MouseButtonEventArgs e)
@@ -71,7 +82,8 @@ namespace PDF_Master.Views.BOTA
                         }
                         else
                         {
-                            viewModel.ListBoxItemPreviewMouseLeftButtonDown.Execute(sender);
+                            //直接右键菜单不需要选中Viewer中注释
+                            //viewModel.ListBoxItemPreviewMouseLeftButtonDown.Execute(sender);
                             if (myListBoxItem.DataContext is AnnotationHandlerEventArgs annotation)
                             {
                                 //文本、高亮、下划线、删除线、便签
@@ -94,6 +106,8 @@ namespace PDF_Master.Views.BOTA
                             export.Command = viewModel.ExportCommentsCommand;
                         }
                     }
+                    //拦截响应选中事件
+                    e.Handled = true;
                 }
             }
         }
@@ -336,5 +350,26 @@ namespace PDF_Master.Views.BOTA
                 AnnotationList.SelectedItems.Clear();
             }
         }
+
+        private void Grid_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        {
+            var pos = e.GetPosition(this);
+            var result = VisualTreeHelper.HitTest(this,pos);
+            if(result!=null)
+            {
+                //点击按钮和listboxitem时 不清空多选 其余区域取消多选
+                var item = CommonHelper.FindVisualParent<ListBoxItem>(result.VisualHit);
+                if(item!=null)
+                {
+                    return;
+                }
+                var btn = CommonHelper.FindVisualParent<System.Windows.Controls.Button>(result.VisualHit);
+                if (btn != null)
+                {
+                    return;
+                }
+                AnnotationList.SelectedIndex = -1;
+            }
+        }
     }
 }

+ 2 - 0
PDF Office/Views/BOTA/BookmarkContent.xaml

@@ -46,8 +46,10 @@
                         Height="16"
                         Source="pack://application:,,,/Resources/BOTA/empty_bookmark.png" />-->
                         <Path
+                            VerticalAlignment="Top"
                             Grid.Column="0"
                             Width="16"
+                            Margin="0 9 0 0"
                             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">

+ 8 - 6
PDF Office/Views/Dialog/FullScreenWindow.xaml

@@ -34,7 +34,8 @@
             Name="GridTip"
             Height="32"
             VerticalAlignment="Top"
-            Cursor="Hand">
+            Cursor="Hand"
+            Visibility="Collapsed">
             <TextBlock
                 x:Name="PressEscTip"
                 Padding="0,8,0,0"
@@ -87,15 +88,16 @@
         </Grid>
         <cus:ToastControl
             Width="auto"
-            Height="auto"
-            Margin="0,0,0,300"
-            VerticalAlignment="Bottom"
-            Background="#89000000"
+            Height="auto    "
+            Margin="0,16,0,0"
+            Padding="16,9"
+            VerticalAlignment="Top"
+            Background="{StaticResource color.sys.layout.dark.bg}"
             BeginTime="0:0:0:3"
             CornerRadius="4"
             FontSize="14"
             Foreground="White"
-            StringContent="Press Esc To Exit Full Mode"
+            StringContent="Press esc to exit full screen mode"
             Visibility="{Binding ShowTip}"
             Duration="0:0:0:3" />
         <i:Interaction.Triggers>

+ 4 - 2
PDF Office/Views/Dialog/PropertiesDialog.xaml

@@ -132,10 +132,12 @@
                             Grid.Column="1"
                             Margin="8"
                             Foreground="{StaticResource color.btn.link.text.norm}"
+                            PreviewMouseDown="TextBlock_PreviewMouseDown"
                             Style="{StaticResource TextBlock}"
                             Text="{Binding FilePath}"
-                            PreviewMouseDown="TextBlock_PreviewMouseDown"
-                            TextDecorations="Underline" />
+                            TextDecorations="Underline"
+                            TextTrimming="WordEllipsis"
+                            ToolTip="{Binding FilePath}" />
                     </Grid>
                 </Border>
                 <Label Content="Create Message" Style="{StaticResource Label}" />

+ 56 - 47
PDF Office/Views/FillAndSign/PropertyPanel/ShapFillProperty.xaml

@@ -51,9 +51,9 @@
                 CornerRadius="2"
                 Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
                 >
-                
+
                 <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
-                    
+
                     <Path
                         Name="SharpPath"
                         
@@ -74,7 +74,7 @@
                     <RowDefinition Height="auto" />
                     <RowDefinition />
                 </Grid.RowDefinitions>
-                <TextBlock Text="Color" VerticalAlignment="Center"/>
+                <TextBlock Text="Color" VerticalAlignment="Center" Margin="0,0,0,12"/>
                 <CompositeControl:SlidContent x:Name="layerThick"  HorizontalAlignment="Right" 
                                               
                                               >
@@ -84,11 +84,11 @@
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </CompositeControl:SlidContent>
-                <CompositeControl:ColorContent  x:Name="cusColor" Grid.Row="1" />
+                <CompositeControl:ColorContent  x:Name="cusColor" Grid.Row="1"  ItemSource="{Binding ShapeColorItems}" UIColor="{Binding ShapeColorColor,Mode=TwoWay}"/>
 
             </Grid>
 
-            <Grid Margin="0,18,0,0">
+            <Grid Margin="0,18,0,0" Visibility="Collapsed">
                 <Grid.RowDefinitions>
                     <RowDefinition Height="auto" />
                     <RowDefinition />
@@ -110,11 +110,17 @@
                     Minimum="1"
                     Style="{StaticResource RoundThumbSlider}"
                     TickFrequency="1"
-                    Value="{Binding LineWidth}">
+                    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>
+                        <i:Interaction.Triggers>
+                            <i:EventTrigger EventName="ValueChanged">
+                                <i:InvokeCommandAction Command="{Binding SelectedLineWidthValueCommand}" CommandParameter="{Binding ElementName=BorderSlider,Path=Value}"/>
+                            </i:EventTrigger>
+                        </i:Interaction.Triggers>
                     </Slider>
 
                     <Border
@@ -183,26 +189,28 @@
                     </Border>
                 </Grid>
             </Grid>
-
-            <Border
+            <StackPanel Visibility="{Binding IsSelected,Converter={StaticResource InvertBoolToVisibleConvert}}" Margin="0,18,0,0">
+                <TextBlock Text="Fill Type" VerticalAlignment="Center"/>
+                <Border
                 Width="228"
                 Height="32"
-                Margin="0,12,0,0"
+                Margin="0,10,0,0"
                 BorderBrush="#FFE2E3E6"
                 BorderThickness="1" 
-                Visibility="{Binding IsSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
-                > 
-                <Grid Name="ToolGrid" >
-                    <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="40.5" />
-                        <ColumnDefinition Width="40.5" />
-                        <ColumnDefinition Width="40.5" />
-                        <ColumnDefinition Width="40.5" />
-                        <ColumnDefinition Width="40.5" />
-                    </Grid.ColumnDefinitions>
+                
+                >
 
+                    <Grid Name="ToolGrid" >
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="40.5" />
+                            <ColumnDefinition Width="40.5" />
+                            <ColumnDefinition Width="40.5" />
+                            <ColumnDefinition Width="40.5" />
+                            <ColumnDefinition Width="40.5" />
+                        </Grid.ColumnDefinitions>
 
-                    <ToggleButton
+
+                        <ToggleButton
                         Name="HookShapeBtn"
                         Width="40.5"
                         Background="Transparent"
@@ -211,7 +219,7 @@
                         Command="{Binding SharpsTypeCommand}"
                         CommandParameter="{Binding ElementName=HookShapeBtn, Path=Tag}"
                         Tag="HookShape">
-                        <Path
+                            <Path
                             Width="15"
                             Height="13"
                             HorizontalAlignment="Center"
@@ -219,14 +227,14 @@
                             StrokeThickness="1.6"
                             StrokeLineJoin="Round"
                            Stroke="#616469">
-                            <Path.Data>M0.599976 7.0286L5.57775 11.8L13.4 1.40002
-                            </Path.Data>
-                        </Path>
-                    </ToggleButton>
+                                <Path.Data>M0.599976 7.0286L5.57775 11.8L13.4 1.40002
+                                </Path.Data>
+                            </Path>
+                        </ToggleButton>
 
 
 
-                    <ToggleButton
+                        <ToggleButton
                         Name="ForkShapeBtn"
                         Grid.Column="1"
                         Width="40.5"
@@ -237,7 +245,7 @@
                         Command="{Binding SharpsTypeCommand}"
                         CommandParameter="{Binding ElementName=ForkShapeBtn, Path=Tag}"
                         Tag="ForkShape">
-                        <Path
+                            <Path
                             Width="16"
                             Height="16"
                             HorizontalAlignment="Center"
@@ -245,16 +253,16 @@
                             StrokeThickness="1.6"
                             StrokeLineJoin="Round"
                            Stroke="#616469">
-                            <Path.Data>
-                                M3.19995 3.20001L12.8 12.8
+                                <Path.Data>
+                                    M3.19995 3.20001L12.8 12.8
                                M12.8 3.20001L3.20005 12.8
-                            </Path.Data>
-                        </Path>
-                    </ToggleButton>
+                                </Path.Data>
+                            </Path>
+                        </ToggleButton>
 
 
 
-                    <ToggleButton
+                        <ToggleButton
                         Name="RectShapeBtn"
                         Grid.Column="2"
                         Width="40.5"
@@ -264,7 +272,7 @@
                         Command="{Binding SharpsTypeCommand}"
                         CommandParameter="{Binding ElementName=RectShapeBtn, Path=Tag}"
                         Tag="RectShape">
-                        <Rectangle
+                            <Rectangle
                             Width="9.6"
                             Height="9.6"
                            StrokeThickness="1.6"
@@ -273,10 +281,10 @@
                             HorizontalAlignment="Center"
                             VerticalAlignment="Center"
                             Stroke="#616469" />
-                    </ToggleButton>
+                        </ToggleButton>
 
 
-                    <ToggleButton
+                        <ToggleButton
                         Name="LineShapeBtn"
                         Grid.Column="3"
                         Width="40.5"
@@ -286,7 +294,7 @@
                         Command="{Binding SharpsTypeCommand}"
                         CommandParameter="{Binding ElementName=LineShapeBtn, Path=Tag}"
                         Tag="LineShape">
-                        <Path
+                            <Path
                             Width="14"
                             Height="2"
                             HorizontalAlignment="Center"
@@ -294,13 +302,13 @@
                             StrokeThickness="1.6"
                             StrokeLineJoin="Round"
                            Stroke="#616469">
-                            <Path.Data>
-                                M13.4 1L0.600024 1
-                            </Path.Data>
-                        </Path>
-                    </ToggleButton>
+                                <Path.Data>
+                                    M13.4 1L0.600024 1
+                                </Path.Data>
+                            </Path>
+                        </ToggleButton>
 
-                    <ToggleButton
+                        <ToggleButton
                         Name="DotShapeBtn"
                         Width="40.5"
                         Grid.Column="4"
@@ -310,15 +318,16 @@
                         Command="{Binding SharpsTypeCommand}"
                         CommandParameter="{Binding ElementName=DotShapeBtn, Path=Tag}"
                         Tag="DotShape">
-                        <Ellipse
+                            <Ellipse
                             Width="4.8"
                             Height="4.8"
                             HorizontalAlignment="Center"
                             VerticalAlignment="Center"
                             Fill="#616469" />
-                    </ToggleButton>
-                </Grid>
-            </Border>
+                        </ToggleButton>
+                    </Grid>
+                </Border>
+            </StackPanel>
         </StackPanel>
     </Grid>
 </UserControl>

+ 5 - 6
PDF Office/Views/HomeContent.xaml

@@ -11,13 +11,13 @@
     xmlns:viewmodels="clr-namespace:PDF_Master.ViewModels"
     d:DataContext="{d:DesignInstance Type=viewmodels:HomeContentViewModel}"
     d:DesignHeight="450"
+    d:DesignWidth="800"
+    prism:ViewModelLocator.AutoWireViewModel="True"
     AllowDrop="True"
     DragEnter="UserControl_DragEnter"
-    DragOver="UserControl_DragOver"
     DragLeave="UserControl_DragLeave"
+    DragOver="UserControl_DragOver"
     Drop="UserControl_Drop"
-    d:DesignWidth="800"
-    prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
     <UserControl.InputBindings>
         <KeyBinding Command="{Binding OpenFileCommand}" Gesture="Ctrl+O" />
@@ -61,7 +61,7 @@
             <Button
                 x:Name="BtnOpenPDF"
                 Height="40"
-                Margin="41,54,41,0"
+                Margin="32,32,32,0"
                 Command="{Binding OpenFileCommand}"
                 Foreground="#FFFFFF"
                 Style="{StaticResource btn.brand}">
@@ -75,10 +75,9 @@
                 </StackPanel>
             </Button>
 
-            <Grid Margin="41,8,41,0">
+            <Grid Margin="32,16,32,24">
                 <Button
                     x:Name="BtnCreatPDF"
-                    Width="188"
                     Height="40"
                     Command="{Binding CreateFromOtherFile}"
                     Content="{Binding T_CreatePDF}"

+ 2 - 2
PDF Office/Views/HomePanel/HomeGuidContent.xaml

@@ -23,11 +23,11 @@
                     <RowDefinition Height="Auto" />
                     <RowDefinition />
                 </Grid.RowDefinitions>
-                <pDFTools:QuickToolsContent x:Name="hometool" Margin="32,32,0,0" />
+                <pDFTools:QuickToolsContent x:Name="hometool" Margin="32" />
                 <recentFiles:RecentFilesContent
                     x:Name="Recentlist"
                     Grid.Row="1"
-                    Margin="0,0,32,0" />
+                    Margin="32,0" />
             </Grid>
         </ScrollViewer>
     </Grid>

+ 9 - 11
PDF Office/Views/HomePanel/PDFTools/QuickToolsContent.xaml

@@ -12,7 +12,6 @@
     xmlns:pdftools="clr-namespace:PDF_Master.ViewModels.HomePanel.PDFTools"
     xmlns:prism="http://prismlibrary.com/"
     d:DataContext="{d:DesignInstance Type=pdftools:QuickToolsContentViewModel}"
-    d:DesignHeight="450"
     d:DesignWidth="800"
     prism:ViewModelLocator.AutoWireViewModel="True"
     Loaded="UserControl_Loaded"
@@ -39,7 +38,7 @@
             </DataTemplate>
 
             <ItemsPanelTemplate x:Key="ListItemsPanelTemplate">
-                <controls:VirtualizingWrapPanel />
+                <WrapPanel />
             </ItemsPanelTemplate>
 
             <Style
@@ -47,21 +46,21 @@
                 BasedOn="{StaticResource ListBoxItemStyle}"
                 TargetType="{x:Type customControl:ListItemQuickTool}">
                 <EventSetter Event="PreviewMouseLeftButtonUp" Handler="QuickTools_Click" />
+                <Setter Property="Width" Value="223" />
                 <Setter Property="Margin" Value="8,0" />
-                <Setter Property="Width" Value="218" />
             </Style>
 
         </ResourceDictionary>
 
     </UserControl.Resources>
-    <Grid Grid.ColumnSpan="2" Margin="0,0,20,0">
+    <Grid Grid.ColumnSpan="2">
         <Grid.RowDefinitions>
-            <RowDefinition Height="Auto" />
+            <RowDefinition Height="32" />
             <RowDefinition Height="*" />
         </Grid.RowDefinitions>
         <TextBlock
             x:Name="TxbQuickToolsTitle"
-            Margin="0,2,0,2"
+            Margin="0,2"
             FontFamily="Segoe UI"
             FontSize="20"
             FontWeight="SemiBold"
@@ -73,7 +72,6 @@
             x:Name="PnlToolsUIBtns"
             Grid.Column="0"
             Grid.ColumnSpan="2"
-            Margin="0,0,12,0"
             HorizontalAlignment="Right"
             VerticalAlignment="Center"
             Orientation="Horizontal"
@@ -83,7 +81,6 @@
                 x:Name="BtnTools"
                 Width="68"
                 Height="28"
-                Margin="0,0,0,0"
                 Command="{Binding ShowToolCommand}"
                 Content="Tools"
                 Visibility="Collapsed" />
@@ -91,7 +88,6 @@
                 x:Name="BtnMore"
                 Width="32"
                 Height="32"
-                Margin="12,0,0,16"
                 Command="{Binding OpenMenuCommand}"
                 CommandParameter="{Binding ElementName=BtnMore}"
                 Style="{StaticResource btn.sec}">
@@ -109,14 +105,15 @@
         <Grid
             x:Name="GridAllTools"
             Grid.Row="1"
-            Height="270"
-            Margin="0,0,12,0"
+            Height="152"
+            Margin="0,16,0,0"
             SizeChanged="GridAllTools_SizeChanged">
 
             <customControl:ListBoxEx
                 x:Name="ListBoxExpendToolBars"
                 Grid.Row="3"
                 MinWidth="250"
+                Padding="-8,0,-8,0"
                 HorizontalAlignment="Stretch"
                 AllowDrop="True"
                 Background="Transparent"
@@ -133,6 +130,7 @@
                 x:Name="ListBoxToolBars"
                 Grid.Row="3"
                 MinWidth="250"
+                Padding="-8,0,-8,0"
                 AllowDrop="True"
                 Background="Transparent"
                 BorderThickness="0"

+ 19 - 13
PDF Office/Views/HomePanel/PromotionContent.xaml

@@ -19,6 +19,7 @@
             <DataTemplate x:Key="PromotionDataTemplate">
                 <StackPanel
                     Height="32"
+                    Margin="16 0"
                     Background="Transparent"
                     Cursor="Hand"
                     Orientation="Horizontal">
@@ -26,9 +27,9 @@
                         Width="16"
                         Height="16"
                         Margin="0,0,10,0"
-                        Source="{Binding ImagePath}" 
                         RenderOptions.BitmapScalingMode="HighQuality"
-                        UseLayoutRounding="True"/>
+                        Source="{Binding ImagePath}"
+                        UseLayoutRounding="True" />
                     <TextBlock
                         VerticalAlignment="Center"
                         FontSize="14"
@@ -38,7 +39,7 @@
             </DataTemplate>
         </ResourceDictionary>
     </UserControl.Resources>
-    <ScrollViewer VerticalScrollBarVisibility="Auto">
+    <ScrollViewer Margin="16,0" VerticalScrollBarVisibility="Auto">
         <Grid>
             <Grid.RowDefinitions>
                 <RowDefinition Height="*" />
@@ -47,15 +48,16 @@
             <StackPanel>
                 <Expander
                     x:Name="PDFProSeriesExpander"
-                    Margin="20,20,0,0"
+                    Padding="0"
                     IsExpanded="True"
                     Style="{StaticResource PromotionExpanderStyle}">
                     <Expander.Header>
-                        <Grid
-                            Name="GridHeader"
-                            Height="32"
-                            HorizontalAlignment="Center">
-                            <TextBlock VerticalAlignment="Center" Text="PDF Pro Series" />
+                        <Grid Name="GridHeader" Height="32">
+                            <TextBlock
+                                Margin="16,0"
+                                VerticalAlignment="Center"
+                                Text="PDF Pro Series"
+                                TextAlignment="Left" />
                         </Grid>
                     </Expander.Header>
                     <Border CornerRadius="4">
@@ -71,11 +73,12 @@
                                     <Style BasedOn="{StaticResource EmptyListViewItem}" TargetType="{x:Type ListViewItem}">
                                         <Style.Triggers>
                                             <Trigger Property="IsMouseOver" Value="True">
-                                                <Setter Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
+                                                <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
                                             </Trigger>
                                         </Style.Triggers>
                                         <EventSetter Event="PreviewMouseLeftButtonDown" Handler="FrameworkElement_PreviewMouseLeftButtonDown" />
                                         <Setter Property="AllowDrop" Value="True" />
+                                        <Setter Property="Height" Value="32" />
                                     </Style>
                                 </ListView.ItemContainerStyle>
                             </ListView>
@@ -86,13 +89,14 @@
 
                 <Expander
                     x:Name="OthersExpander"
-                    Margin="20,8,0,0"
+                    Margin="0,8,0,0"
                     IsExpanded="True"
                     Style="{StaticResource PromotionExpanderStyle}">
                     <Expander.Header>
                         <Grid
                             Name="GridHeaderOthers"
                             Height="32"
+                            Margin="16,0"
                             HorizontalAlignment="Center">
                             <TextBlock VerticalAlignment="Center" Text="Others" />
                         </Grid>
@@ -108,13 +112,15 @@
                                 ItemTemplate="{StaticResource PromotionDataTemplate}">
                                 <ListView.ItemContainerStyle>
                                     <Style BasedOn="{StaticResource EmptyListViewItem}" TargetType="{x:Type ListViewItem}">
+
                                         <Style.Triggers>
                                             <Trigger Property="IsMouseOver" Value="True">
-                                                <Setter Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
+                                                <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
                                             </Trigger>
                                         </Style.Triggers>
                                         <EventSetter Event="PreviewMouseLeftButtonDown" Handler="FrameworkElement_PreviewMouseLeftButtonDown" />
                                         <Setter Property="AllowDrop" Value="True" />
+                                        <Setter Property="Height" Value="32" />
                                     </Style>
                                 </ListView.ItemContainerStyle>
                             </ListView>
@@ -129,7 +135,7 @@
                 Grid.Row="1"
                 Width="184"
                 Height="243"
-                Margin="0,30"
+                Margin="0,24"
                 VerticalAlignment="Bottom"
                 PreviewMouseLeftButtonDown="ImgeActivity_PreviewMouseLeftButtonDown" />
         </Grid>

+ 3 - 4
PDF Office/Views/HomePanel/RecentFiles/DocItemControl.xaml

@@ -9,16 +9,14 @@
     d:DesignWidth="800"
     mc:Ignorable="d">
     <Grid
-        Width="226"
-        Height="248"
         DataContext="{Binding}"
         Loaded="Grid_Loaded"
         ToolTip="{Binding FilePath}">
         <Grid.RowDefinitions>
             <RowDefinition Height="auto" />
-            <RowDefinition />
+            <RowDefinition Height="52" />
         </Grid.RowDefinitions>
-        <Grid Height="165" Margin="51,16">
+        <Grid Margin="51,8">
             <Border
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center"
@@ -64,6 +62,7 @@
                 VerticalAlignment="Top"
                 FontSize="14"
                 Text="{Binding FileName}"
+                TextAlignment="Center"
                 TextTrimming="CharacterEllipsis"
                 TextWrapping="Wrap"
                 ToolTip="{Binding FileName}" />

+ 17 - 19
PDF Office/Views/HomePanel/RecentFiles/DocItemListViewControl.xaml

@@ -31,13 +31,7 @@
         DataContext="{Binding}"
         Loaded="Grid_Loaded"
         ToolTip="{Binding FilePath}">
-        <Grid.Background>
-            <SolidColorBrush Opacity="0.01" Color="White" />
-        </Grid.Background>
-        <Grid
-            x:Name="FileInfoGrid"
-            Margin="6,6,6,6"
-            HorizontalAlignment="Stretch">
+        <Grid x:Name="FileInfoGrid" HorizontalAlignment="Stretch">
             <Grid.ColumnDefinitions>
                 <ColumnDefinition Width="4.5*" MinWidth="0" />
                 <ColumnDefinition Width="3*" />
@@ -50,18 +44,22 @@
                     <ColumnDefinition />
                 </Grid.ColumnDefinitions>
 
-                <Border
-                    Margin="10,0"
-                    BorderBrush="{StaticResource color.item-state.sel.border.lv3}"
-                    BorderThickness="1">
-                    <Image
-                        x:Name="CoverImage"
-                        Width="40"
-                        Height="60"
-                        RenderOptions.BitmapScalingMode="HighQuality"
-                        UseLayoutRounding="True" />
-                </Border>
-                <StackPanel Grid.Column="1" Margin="8,8,0,8">
+                <Grid
+                    Width="40"
+                    Height="60"
+                    Margin="10,0">
+                    <Border
+                        HorizontalAlignment="Center"
+                        VerticalAlignment="Center"
+                        BorderBrush="{StaticResource color.sys.layout.divider}"
+                        BorderThickness="1">
+                        <Image
+                            x:Name="CoverImage"
+                            RenderOptions.BitmapScalingMode="HighQuality"
+                            UseLayoutRounding="True" />
+                    </Border>
+                </Grid>
+                <StackPanel Grid.Column="1" Margin="8,12,0,12">
                     <StackPanel Grid.Column="1" Orientation="Horizontal">
                         <Rectangle
                             Name="RecNewMark"

+ 11 - 9
PDF Office/Views/HomePanel/RecentFiles/RecentFilesContent.xaml

@@ -41,7 +41,7 @@
             </DataTemplate>
 
             <ItemsPanelTemplate x:Key="listPanel">
-                <StackPanel Orientation="Vertical" />
+                <StackPanel Margin="0,-30,0,0" Orientation="Vertical" />
             </ItemsPanelTemplate>
 
             <ItemsPanelTemplate x:Key="gridPanel">
@@ -87,7 +87,7 @@
                 TargetType="{x:Type ListViewItem}">
                 <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}" />
                 <Setter Property="HorizontalContentAlignment" Value="Center" />
-                <Setter Property="Margin" Value="0,0,0,0" />
+                <Setter Property="Height" Value="72" />
                 <EventSetter Event="PreviewMouseRightButtonDown" Handler="ListViewItem_PreviewMouseRightButtonDown" />
                 <EventSetter Event="PreviewMouseDoubleClick" Handler="RecentFilesList_PreviewMouseDoubleClick" />
             </Style>
@@ -98,6 +98,10 @@
                 TargetType="{x:Type ListViewItem}">
                 <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}" />
                 <Setter Property="HorizontalContentAlignment" Value="Center" />
+                <Setter Property="VerticalContentAlignment" Value="Center" />
+                <Setter Property="Width" Value="226" />
+                <Setter Property="Height" Value="248" />
+                <Setter Property="Padding" Value="0" />
                 <EventSetter Event="PreviewMouseRightButtonDown" Handler="ListViewItem_PreviewMouseRightButtonDown" />
                 <EventSetter Event="PreviewMouseDoubleClick" Handler="RecentFilesList_PreviewMouseDoubleClick" />
             </Style>
@@ -111,7 +115,7 @@
                 <RowDefinition Height="Auto" />
                 <RowDefinition />
             </Grid.RowDefinitions>
-            <Grid x:Name="GridRecentFilesTile" Margin="32,38,0,13">
+            <Grid x:Name="GridRecentFilesTile">
                 <TextBlock
                     x:Name="TxbRecentlyTile"
                     Margin="0,0,0,0"
@@ -221,7 +225,10 @@
                 </StackPanel>
             </Grid>
 
-            <Grid Grid.Row="2" Visibility="{Binding IsEmpty, Converter={StaticResource InvertBoolToVisibleConvert}}">
+            <Grid
+                Grid.Row="2"
+                Margin="0,16,0,0"
+                Visibility="{Binding IsEmpty, Converter={StaticResource InvertBoolToVisibleConvert}}">
                 <Grid.ColumnDefinitions>
                     <ColumnDefinition Width="799*" />
                     <ColumnDefinition Width="*" />
@@ -232,9 +239,6 @@
                         Grid.ColumnSpan="2"
                         MinWidth="380"
                         MinHeight="216"
-                        Margin="32,0,0,0"
-                        Padding="0,0,0,0"
-                        Background="Transparent"
                         BorderThickness="0"
                         ItemContainerStyle="{StaticResource SubFilesListViewItemStyle}"
                         ItemTemplate="{StaticResource listviewItem}"
@@ -255,8 +259,6 @@
                     Grid.ColumnSpan="2"
                     MinWidth="380"
                     MinHeight="216"
-                    Margin="32,0,0,0"
-                    Padding="0,0,0,0"
                     Background="Transparent"
                     BorderThickness="0"
                     ItemContainerStyle="{StaticResource HomeGridViewItemStyle}"

+ 6 - 5
PDF Office/Views/MainWindow.xaml.cs

@@ -248,11 +248,12 @@ namespace PDF_Master.Views
             if (uiElement != null)
             {
                 var textBox = uiElement as TextBox;
-                if (textBox != null)
-                {
-                    GridRoot.Focusable = true;
-                    GridRoot.Focus();
-                }
+                //会影响页面编辑的下拉框选择  暂时注释
+                //if (textBox != null)
+                //{
+                //    GridRoot.Focusable = true;
+                //    GridRoot.Focus();
+                //}
             }
         }
     }

+ 2 - 2
PDF Office/Views/PageEdit/PageEditContent.xaml

@@ -136,7 +136,7 @@
                     Header="Hide PageSize"
                     Visibility="{Binding ShowedPageSize}" />
                 <Separator Style="{StaticResource HorizontalSeparatorStyle}" Visibility="{Binding IsBOTAThumb, Converter={StaticResource UnVisibleConvert}}" />
-                <MenuItem Command="{Binding PrintCommand}" Header="{x:Static mainpage:MainPage.PageEdit_MenuPrint}" />
+                <MenuItem Click="MenuItem_Click" Header="{x:Static mainpage:MainPage.PageEdit_MenuPrint}" />
             </ContextMenu>
 
             <Style BasedOn="{StaticResource subToolBar}" TargetType="{x:Type Button}">
@@ -155,7 +155,7 @@
         <KeyBinding Command="{Binding CutCommand}" Gesture="Ctrl+X" />
         <KeyBinding Command="{Binding RightRotateCommand}" Gesture="Ctrl+R" />
         <KeyBinding Command="{Binding LeftRotateCommand}" Gesture="Ctrl+L" />
-        <KeyBinding Command="{Binding DeleteCommand}" Gesture="Delete" />
+        <KeyBinding Command="{Binding DeleteCommand}" Gesture="Delete"/>
         <KeyBinding Key="Esc" Command="{Binding ClearSelectedCommand}" />
         <KeyBinding
             Key="Add"

+ 11 - 0
PDF Office/Views/PageEdit/PageEditContent.xaml.cs

@@ -1001,5 +1001,16 @@ namespace PDF_Master.Views.PageEdit
                 ListPageEdit.Focus();
             }
         }
+
+        private void MenuItem_Click(object sender, RoutedEventArgs e)
+        {
+            //因为需要获取准确的选中页面,因此把入口放在.cs代码里
+            List<int> lists = new List<int>();
+            foreach(PageEditItem item in ListPageEdit.SelectedItems)
+            {
+                lists.Add(item.PageNumber);
+            }
+            viewModel.print(lists);
+        }
     }
 }

+ 2 - 0
PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml

@@ -140,6 +140,7 @@
                         x:Name="ComBoxPresetFont"
                         Width="188"
                         Height="32"
+                        Title="{Binding Title}"
                         HorizontalAlignment="Left"
                         IsValueContent="True"
                         ItemSource="{Binding FontVm.PresetFontItems, Mode=OneWay}"
@@ -180,6 +181,7 @@
                         x:Name="FontFamilyBox"
                         Height="32"
                         IsValueContent="True"
+
                         ItemSource="{Binding FontVm.FontFamilyItems, Mode=OneWay}"
                         SelectedItems="{Binding FontVm.CurrentFontFamily, Mode=TwoWay}">
                         <i:Interaction.Triggers>

+ 16 - 5
PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml.cs

@@ -2,6 +2,7 @@
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
 using PDF_Master.CustomControl.CompositeControl;
+using PDF_Master.Helper;
 using PDF_Master.Properties;
 using PDF_Master.ViewModels.PropertyPanel.AnnotPanel;
 using System;
@@ -116,19 +117,30 @@ namespace PDF_Master.Views.PropertyPanel.AnnotPanel
             ContentText.Focus();
             ContentText.CaretIndex = ContentText.Text.Length;
             LoadedColor();
-            if(GetPDFViewer != null)
+            if (GetPDFViewer != null)
             {
                 GetPDFViewer.PreviewMouseLeftButtonDown -= GetPDFViewer_LeftButtonDown;
                 GetPDFViewer.PreviewMouseLeftButtonDown += GetPDFViewer_LeftButtonDown;
+
+                KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
+                KeyEventsHelper.KeyDown += ShortCut_KeyDown;
+            }
+        }
+
+        private void ShortCut_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (KeyEventsHelper.IsSingleKey(Key.Delete))
+            {
+                BtnDelete_Click(null, null);
             }
         }
 
         private void GetPDFViewer_LeftButtonDown(object sender, MouseButtonEventArgs e)
         {
             var ui = e.OriginalSource as FrameworkElement;
-            if(ui != null)
+            if (ui != null)
             {
-                if(ui.DataContext != null && ui.DataContext is ColorItem == false)
+                if (ui.DataContext != null && ui.DataContext is ColorItem == false)
                 {
                     CloseText_MouseUp(this, null);
                     GetPDFViewer.PreviewMouseLeftButtonDown -= GetPDFViewer_LeftButtonDown;
@@ -342,7 +354,7 @@ namespace PDF_Master.Views.PropertyPanel.AnnotPanel
             if (Regex.IsMatch(dateText, "(?<=D\\:)[0-9]+(?=[\\+\\-])"))
             {
                 string dateStr = Regex.Match(dateText, "(?<=D\\:)[0-9]+(?=[\\+\\-])").Value;
-                dateText = dateStr.Substring(4, 2)+ "/" + dateStr.Substring(6, 2) +"/" + dateStr.Substring(0, 4)  + " " + dateStr.Substring(8, 2) + ":" +
+                dateText = dateStr.Substring(4, 2) + "/" + dateStr.Substring(6, 2) + "/" + dateStr.Substring(0, 4) + " " + dateStr.Substring(8, 2) + ":" +
                     dateStr.Substring(10, 2) + ":" + dateStr.Substring(12, 2);
             }
             StickyDate = dateText;
@@ -366,7 +378,6 @@ namespace PDF_Master.Views.PropertyPanel.AnnotPanel
             }
             catch (Exception ex)
             {
-
             }
         }