Browse Source

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

ZhouJieSheng 1 year ago
parent
commit
9d98461b72

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

@@ -304,7 +304,7 @@ namespace PDF_Master
             InitSettings();
 
 #if DEBUG
-            IsLogin = false;
+            IsLogin = true;
 #endif
 
             CachePath = CacheFilePath.Instance;

+ 1 - 1
PDF Office/CustomControl/ColorDropBox.xaml.cs

@@ -196,7 +196,7 @@ namespace PDF_Master.CustomControl
 
         private void ColorPop_ColorSelected(object sender, Color e)
         {
-            if (SelectedColor != e)
+            //if (SelectedColor != e)
             {
               //  NormalColorRectControl.Visibility = Visibility.Collapsed;
                // TransparentRectControl.Visibility = Visibility.Collapsed;

+ 19 - 7
PDF Office/CustomControl/CompositeControl/ColorContent.xaml

@@ -118,20 +118,32 @@
             BorderBrush="#E2E3E6"
             BorderThickness="1"
             CornerRadius="4">
-            <StackPanel Orientation="Horizontal">
-
-                <Ellipse
+            
+                <StackPanel Orientation="Horizontal">
+                <Grid     Margin="4,0">
+                    <Ellipse
+                    x:Name="defaultColor"
+                   
+            Panel.ZIndex="2"
+                    Width="20"
+                    Height="20"
+                    Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ColorContent}, Path=DefaultColorVisibility, Mode=TwoWay}"
+                     Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ColorContent}, Path=DefaultColor, Mode=TwoWay}"
+                    />
+                    <Ellipse
                     x:Name="ElcustomColor"
                     Width="20"
                     Height="20"
-                    Margin="4,0"
-                    Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ColorContent}, Path=SelectedColor, Mode=TwoWay, Converter={StaticResource colorBrushConvert}}"
-                    PreviewMouseLeftButtonDown="ElcustomColor_PreviewMouseLeftButtonDown" />
+                
+                     Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ColorContent}, Path=SelectedColor, Mode=OneTime, Converter={StaticResource colorBrushConvert}}"
+                    />
+                </Grid>
                 <cus:ColorDropBox
                     x:Name="ColorDropPicker"
                     Margin="4,0"
                     SelectedColorChanged="ColorDropPicker_SelectedColorChanged" />
-            </StackPanel>
+                </StackPanel>
+         
         </Border>
         <cus:ColorDropBox
             x:Name="PnlColor"

+ 28 - 2
PDF Office/CustomControl/CompositeControl/ColorContent.xaml.cs

@@ -81,6 +81,7 @@ namespace PDF_Master.CustomControl.CompositeControl
         private ObservableCollection<ColorItem> colors = new ObservableCollection<ColorItem>();
         public event EventHandler<Color> SelectedColorHandler;
         public event RoutedEventHandler SelectedColorInvoke;
+        public event RoutedEventHandler DefaultColorInvoke;
         private ColorItem ChangedColorItem;
 
         public ColorSelectorType ColorType
@@ -115,6 +116,24 @@ namespace PDF_Master.CustomControl.CompositeControl
         public static readonly DependencyProperty ceshiColorProperty =
             DependencyProperty.Register("UIColor", typeof(Brush), typeof(ColorContent), new PropertyMetadata(new SolidColorBrush(Color.FromArgb(0x6C,0x33,0xF8,0xCC)), SelectedColorPropertyChanged));
 
+        public Brush DefaultColor
+        {
+            get { return (Brush)GetValue(DefaultColorProperty); }
+            set { SetValue(DefaultColorProperty, value); }
+        }
+
+        public static readonly DependencyProperty DefaultColorProperty =
+            DependencyProperty.Register("DefaultColor", typeof(Brush), typeof(ColorContent), new PropertyMetadata(new SolidColorBrush(Color.FromArgb(0x00, 0xFF, 0xFF, 0xFF))));
+
+        public Visibility DefaultColorVisibility
+        {
+            get { return (Visibility)GetValue(DefaultColorVisibilityProperty); }
+            set { SetValue(DefaultColorVisibilityProperty, value); }
+        }
+
+        public static readonly DependencyProperty DefaultColorVisibilityProperty =
+            DependencyProperty.Register("DefaultColorVisibility", typeof(Visibility), typeof(ColorContent), new PropertyMetadata(Visibility.Collapsed));
+
         public List<ColorItem> ItemSource
         {
             get { return (List<ColorItem>)GetValue(ItemSourceProperty); }
@@ -161,18 +180,20 @@ namespace PDF_Master.CustomControl.CompositeControl
 
                 foreach(var item in control.colors)
                 {
+                    if (co == null) { break; }
                     var colorItem = (item.Color as SolidColorBrush).Color;
                     if (colorItem.A == co.Color.A && colorItem.G == co.Color.G && colorItem.B == co.Color.B && colorItem.R == co.Color.R)
                     {
                         control.ListColor.SelectedItem = item;
                         control.SelectedColor = colorItem;
-                        //control.ElcustomColor.Fill = new SolidColorBrush(Colors.Transparent);
+                        if (control.ElcustomColor.Fill == null) { control.ElcustomColor.Fill = co; }
+                     
                         isFoundListItem = true;
                         break;
                     }
                 }
 
-                if(isFoundListItem == false)
+                if (isFoundListItem == false)
                 {
                     control.ElcustomColor.Fill = co;
                     control.ListColor.SelectedItem = null;
@@ -192,11 +213,15 @@ namespace PDF_Master.CustomControl.CompositeControl
 
         private void ColorDropPicker_SelectedColorChanged(object sender, Color? e)
         {
+            if (ElcustomColor.Fill == null) {
+                ElcustomColor.Fill= new SolidColorBrush(Colors.Transparent);
+            }
             IsExistForContainer((ElcustomColor.Fill as SolidColorBrush).Color);
             SelectedColorHandler?.Invoke(this, e.Value);
             ElcustomColor.Fill = new SolidColorBrush(e.Value);
             SelectedColor = e.Value;
             SelectedColorInvoke?.Invoke(e.Value, null);
+            DefaultColorInvoke?.Invoke(e.Value, null);
         }
 
         private void ListColor_SelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -213,6 +238,7 @@ namespace PDF_Master.CustomControl.CompositeControl
                 SelectedColor = selectCo;
                 SelectedColorHandler?.Invoke(this, selectCo);
                 SelectedColorInvoke?.Invoke(selectCo, null);
+                
             }
         }
 

+ 3 - 3
PDF Office/Model/AnnotPanel/AnnotCommon.cs

@@ -68,7 +68,7 @@ namespace PDF_Master.Model.AnnotPanel
         }
 
         //当前填充颜色
-        private Brush _currentFillColor = new SolidColorBrush(Colors.Transparent);
+        private Brush _currentFillColor = App.Current.FindResource("color.sys.layout.divider.text-date-fill") as Brush; 
 
         public Brush CurrentFillColor
         {
@@ -125,7 +125,7 @@ namespace PDF_Master.Model.AnnotPanel
         }
 
         //当前边框颜色
-        private Brush _currentBorderColor = new SolidColorBrush(Colors.Transparent);
+        private Brush _currentBorderColor = App.Current.FindResource("color.sys.layout.divider.shapes-border") as Brush;
 
         public Brush CurrentBorderColor
         {
@@ -142,7 +142,7 @@ namespace PDF_Master.Model.AnnotPanel
         }
 
         //当前边框颜色
-        private Brush _currentFontColor = new SolidColorBrush(Colors.Transparent);
+        private Brush _currentFontColor=App.Current.FindResource("color.sys.layout.divider.pen") as Brush;
 
         public Brush CurrentFontColor
         {

+ 12 - 0
PDF Office/Themes/Alias_Light.xaml

@@ -55,6 +55,18 @@
     <SolidColorBrush x:Key="color.sys.layout.anti">#ffffff</SolidColorBrush>
     <SolidColorBrush x:Key="color.sys.layout.accent">#1770F4</SolidColorBrush>
     <SolidColorBrush x:Key="color.sys.layout.brand">#273C62</SolidColorBrush>
+
+    <SolidColorBrush x:Key="color.sys.layout.divider.highlight">#7A44FF</SolidColorBrush>
+    <SolidColorBrush x:Key="color.sys.layout.divider.strikethough">#252629</SolidColorBrush>
+    <SolidColorBrush x:Key="color.sys.layout.divider.underline">#252629</SolidColorBrush>
+    <SolidColorBrush x:Key="color.sys.layout.divider.pen">#252629</SolidColorBrush>
+    <SolidColorBrush x:Key="color.sys.layout.divider.text-date-fill">#BDDFFD</SolidColorBrush>
+    <SolidColorBrush x:Key="color.sys.layout.divider.note">#9462FF</SolidColorBrush>
+    <SolidColorBrush x:Key="color.sys.layout.divider.shapes-border">#252629</SolidColorBrush>
+    <SolidColorBrush x:Key="color.sys.layout.divider.shapes-fill">#BDDFFD</SolidColorBrush>
+    <SolidColorBrush x:Key="color.sys.layout.divider.signature">#273C62</SolidColorBrush>
+    <SolidColorBrush x:Key="color.sys.layout.divider.background">#BDDFFD</SolidColorBrush>
+    <SolidColorBrush x:Key="color.sys.layout.divider.fill-sign">#FFFFFF</SolidColorBrush>
     <SolidColorBrush
         x:Key="color.sys.layout.divider"
         Opacity=" 0.1"

+ 1 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs

@@ -51,7 +51,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             set { SetProperty(ref _sharpColor, value); SharpCurrentColor = _sharpColor; }
         }
 
-        private Brush _sharpCurrentColor;
+        private Brush _sharpCurrentColor= App.Current.FindResource("color.sys.layout.divider.note") as Brush;
 
         public Brush SharpCurrentColor
         {

+ 102 - 21
PDF Office/ViewModels/PropertyPanel/AnnotPanel/TextAnnotPropertyViewModel.cs

@@ -13,6 +13,8 @@ using Prism.Regions;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
+using System.Diagnostics;
+using System.Diagnostics.Eventing.Reader;
 using System.Globalization;
 using System.Windows;
 using System.Windows.Data;
@@ -63,10 +65,20 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
             throw new NotImplementedException();
         }
     }
-    public class TextAnnotPropertyViewModel:BindableBase, INavigationAware
+    public class TextAnnotPropertyViewModel : BindableBase, INavigationAware
     {
 
         #region 属性
+        private ViewContentViewModel ViewContentViewModel;
+        //当前边框颜色
+        private Brush _textDefaultColor;
+
+        public Brush TextDefaultColor
+        {
+            get { return _textDefaultColor; }
+            set => SetProperty(ref _textDefaultColor, value);
+        }
+
         private AnnotCommon _basicVm = new AnnotCommon();
         public AnnotCommon BasicVm
         {
@@ -83,6 +95,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 
         public List<ColorItem> HighlightItems { get; set; }
         public List<ColorItem> UnderLineItems { get; set; }
+        public List<ColorItem> StrikeoutItems { get; set; }
 
         #endregion 属性
 
@@ -91,10 +104,11 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         private AnnotTransfer PropertyPanel;
         public DelegateCommand<object> SelectedColorChangedCommand { get; set; }
         public DelegateCommand<object> SelectedOpacityChangedCommand { get; set; }
-
+        public DelegateCommand<object> DefaultColorChangedCommand { get; set; }
         public TextAnnotPropertyViewModel()
         {
             SelectedColorChangedCommand = new DelegateCommand<object>(SelectedColorChanged);
+            DefaultColorChangedCommand = new DelegateCommand<object>(DefaultColorChanged);
             SelectedOpacityChangedCommand = new DelegateCommand<object>(SelectedOpacityChanged);
             InitHighlightItems();
             InitUnderLinetItems();
@@ -108,7 +122,8 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 
         private void InitUnderLinetItems()
         {
-            UnderLineItems = AnnotColorList.GetColorList(ColorSelectorType.Border); 
+            UnderLineItems = AnnotColorList.GetColorList(ColorSelectorType.Border);
+            StrikeoutItems = AnnotColorList.GetColorList(ColorSelectorType.Border);
         }
 
 
@@ -146,11 +161,55 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 
                 }
             }
+        }
+
+        private Brush HighlightDefaultColor = App.Current.FindResource("color.sys.layout.divider.highlight") as Brush;
+        private Brush UnderlineDefaultColor = App.Current.FindResource("color.sys.layout.divider.strikethough") as Brush;
+        private Brush StrikeoutDefaultColor = App.Current.FindResource("color.sys.layout.divider.underline") as Brush;
+        private AnnotArgsType annotArgsType = AnnotArgsType.AnnotHighlight;
+        public void DefaultColorChanged(object color)
+        {
+            if (color != null)
+            {
+                var colorValue = (Color)color;
+                if (colorValue != null)
+                {
+                    TextDefaultColor = new SolidColorBrush(colorValue);
+                    switch (annotArgsType)
+                    {
+                        case AnnotArgsType.AnnotHighlight:
+
+                            {
+                                HighlightDefaultColor = new SolidColorBrush(colorValue);
+
+                            }
+                            break;
+
+                        case AnnotArgsType.AnnotUnderline:
+                            {
+                                UnderlineDefaultColor = new SolidColorBrush(colorValue);
+                            }
+                            break;
+
+                        case AnnotArgsType.AnnotStrikeout:
+                            {
+                                StrikeoutDefaultColor = new SolidColorBrush(colorValue);
+                            }
+                            break;
+
+                        case AnnotArgsType.AnnotSquiggly:
+                            {
+
+                            }
+                            break;
+
+                    }
+                }
+            }
         }
-
         private void SetAnnotType()
         {
-            if(BasicVm.IsMultiSelected)
+            if (BasicVm.IsMultiSelected)
             {
                 BasicVm.AnnotTypeTitle = "General Properties";
                 return;
@@ -171,8 +230,8 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                     BasicVm.AnnotTypeTitle = "波浪线";
                     break;
             }
-        }
-
+        }
+
         public bool IsNavigationTarget(NavigationContext navigationContext)
         {
             return true;
@@ -184,10 +243,10 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         }
 
         public void OnNavigatedTo(NavigationContext navigationContext)
-        {
-
+        {
+            navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out ViewContentViewModel);
             navigationContext.Parameters.TryGetValue<AnnotTransfer>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
-            if(PropertyPanel != null)
+            if (PropertyPanel != null)
             {
                 AllVariable();
                 SetAnnotType();
@@ -205,8 +264,8 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
                     else
                     {
                         BasicVm.FontColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
-                    }
-                    
+                    }
+
                 }
                 else
                 {
@@ -219,15 +278,20 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 
         private void SelectedColorItems()
         {
-            if(BasicVm.AnnotType == AnnotArgsType.AnnotHighlight)
+            if (BasicVm.AnnotType == AnnotArgsType.AnnotHighlight)
             {
                 BasicVm.ColorItems = HighlightItems;
                 ColorType = ColorSelectorType.Highlight;
-            }
-            else
+            }
+            else if (BasicVm.AnnotType == AnnotArgsType.AnnotUnderline)
             {
                 BasicVm.ColorItems = UnderLineItems;
                 ColorType = ColorSelectorType.Border;
+            }
+            else
+            {
+                BasicVm.ColorItems = StrikeoutItems;
+                ColorType = ColorSelectorType.Border;
             }
         }
 
@@ -243,29 +307,46 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         private void GetAnnotProperty()
         {
             if (Annot != null)
-            {
+            {
+                annotArgsType = Annot.EventType;
                 switch (Annot.EventType)
                 {
-                    case AnnotArgsType.AnnotHighlight:
-                      if (Annot is TextHighlightAnnotArgs)
-                        {
+                    case AnnotArgsType.AnnotHighlight:
+                        if (Annot is TextHighlightAnnotArgs)
+                        {
+                            
                             var Hightlight = Annot as TextHighlightAnnotArgs;
+                            if (ViewContentViewModel.IsSettingOut)
+                            {
+                                HighlightDefaultColor = new SolidColorBrush(Hightlight.Color);
+                                ViewContentViewModel.IsSettingOut = false;
+                            }
+                            TextDefaultColor = HighlightDefaultColor;
                             BasicVm.FillOpacity = Hightlight.Transparency;
                             BasicVm.FontColor = new SolidColorBrush(Hightlight.Color);
                         }
                         break;
 
                     case AnnotArgsType.AnnotUnderline:
-                        {
+                        {
                             var Underline = Annot as TextUnderlineAnnotArgs;
+                            if (ViewContentViewModel.IsSettingOut)
+                            { UnderlineDefaultColor = new SolidColorBrush(Underline.Color); 
+                                ViewContentViewModel.IsSettingOut = false; }
+                            TextDefaultColor = UnderlineDefaultColor;
                             BasicVm.FillOpacity = Underline.Transparency;
                             BasicVm.FontColor = new SolidColorBrush(Underline.Color);
                         }
                         break;
 
                     case AnnotArgsType.AnnotStrikeout:
-                        {
+                        {
                             var Strikeout = Annot as TextStrikeoutAnnotArgs;
+                            if (ViewContentViewModel.IsSettingOut)
+                            { StrikeoutDefaultColor = new SolidColorBrush(Strikeout.Color);
+                                ViewContentViewModel.IsSettingOut = false;
+                            }
+                            TextDefaultColor = StrikeoutDefaultColor;
                             BasicVm.FillOpacity = Strikeout.Transparency;
                             BasicVm.FontColor = new SolidColorBrush(Strikeout.Color);
                         }

+ 4 - 0
PDF Office/ViewModels/PropertyPanel/ViewModular/PageContentViewModel.cs

@@ -1,4 +1,5 @@
 using ComPDFKitViewer;
+using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
 using Microsoft.Office.Interop.Word;
 using PDF_Master.Model;
@@ -288,6 +289,9 @@ namespace PDF_Master.ViewModels.PropertyPanel.ViewModular
                     PageCount = PDFViewer.Document.PageCount;
                     CurrentPage = PDFViewer.CurrentIndex + 1;
                     this.PDFViewer.InfoChanged += PDFViewer_InfoChanged;
+                    PDFViewer.SetMouseMode(MouseModes.PanTool);
+                    var annotArgs = new SelectToolArgs();
+                    PDFViewer.SetToolParam(annotArgs);
                 }
             }
         }

+ 18 - 5
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -147,8 +147,13 @@ namespace PDF_Master.ViewModels.Tools
             if (e.ClickCount == 1)
             {
                 //不禁止取消选中注释
-                PDFViewer.DisableClearSelectAnnot(false);
-
+                //PDFViewer.DisableClearSelectAnnot(false);
+                //if (viewContentViewModel.mainViewModel.IsBookMode)
+                //{
+                //    PDFViewer.SetMouseMode(MouseModes.PanTool);
+                //    var annotArgs = new SelectToolArgs();
+                //    PDFViewer.SetToolParam(annotArgs);
+                //}
                 //PropertyPanel.IsSharpAnnotSelected = true;
                 //PropertyPanel.IsFreeHandSelected = true;
                 //PDFViewer.ClearSelectAnnots();
@@ -514,13 +519,14 @@ namespace PDF_Master.ViewModels.Tools
                                 PropertyPanel.IsFreeHandSelected = true;
                             }
                             isShowPropertyPanel = viewContentViewModel.IsPropertyOpen;
+                            if(viewContentViewModel.mainViewModel.IsBookMode == false)
                             GetSelectedAnnots(e);
 
                             SelectedSignature(e.AnnotItemsList);
 
                             if (Settings.Default.AppProperties.InitialVIew.AutoExpandProperty
                                 && annot.EventType != AnnotArgsType.AnnotStamp && StrAnnotToolChecked != "Signature"
-                                && annot.EventType != AnnotArgsType.AnnotLink)
+                                && annot.EventType != AnnotArgsType.AnnotLink && viewContentViewModel.mainViewModel.IsBookMode==false)
                             {
                                 var signAnnot = viewContentViewModel.AnnotSignatures.FirstOrDefault(temp => temp.Item1 == annot.PageIndex && temp.Item2 == annot.AnnotIndex);
                                 if (signAnnot == null)
@@ -661,7 +667,14 @@ namespace PDF_Master.ViewModels.Tools
                         PropertyPanel.annotlists = e.AnnotItemsList;
                         viewContentViewModel.IsMultiSelected = true;
                         viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
-                        ShowPropertyPanel(true);
+                        if (viewContentViewModel.mainViewModel.IsBookMode)
+                        {
+                            ShowPropertyPanel(false);
+                        }
+                        else
+                        {
+                            ShowPropertyPanel(true);
+                        }
 
                         #region MVP 在对多选注释做处理
                         //bool isDifferentAnnotTyle = AnnotTransfer.IsDifferentTypeAnnots(e.AnnotItemsList);
@@ -1733,7 +1746,7 @@ namespace PDF_Master.ViewModels.Tools
                             //创建注释后,修改注释属性,可用于下次创建的注释
                             if (PropertyPanel != null && PropertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
                             {
-                                if (StrAnnotToolChecked == "Rect" && PropertyPanel.SharpsAnnot == key.Key)
+                                if (StrAnnotToolChecked == "Rect" && PropertyPanel.SharpsAnnot == key.Key ||(PropertyPanel.SharpsAnnot != key.Key && key.Key== "Arrow"))
                                 {
                                     PDFViewer.SetToolParam(PropertyPanel.annot);
                                     PropertyPanel.SaveLastAnnot();

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

@@ -527,9 +527,12 @@ namespace PDF_Master.ViewModels.Tools
                         SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
                         Settings.Default.Save();
                     }
-
+                    underlineArgs.Color = defaultAnnot.ForgoundColor;
                     UnderLineOpacity = underlineArgs.Transparency = defaultAnnot.Opacity;
                 }
+                else
+                {
+                }
 
                 selectedArgs = new List<AnnotHandlerEventArgs>();
                 selectedArgs.Add(underlineArgs);
@@ -615,7 +618,7 @@ namespace PDF_Master.ViewModels.Tools
                         SettingHelper.SetAnnotDefaultProperty(defaultAnnot);
                         Settings.Default.Save();
                     }
-
+                    strikeoutArgs.Color =defaultAnnot.ForgoundColor;
                     strikeoutArgs.Transparency = defaultAnnot.Opacity;
                 }
 
@@ -672,7 +675,7 @@ namespace PDF_Master.ViewModels.Tools
 
                     freehandArgs.Transparency = defaultAnnot.Opacity;
                     freehandArgs.LineWidth = defaultAnnot.Thickness;
-
+                    freehandArgs.InkColor = defaultAnnot.ForgoundColor;
                     if (defaultAnnot.DashArray == null || defaultAnnot.DashArray.Count == 0)
                     {
                         freehandArgs.LineDash = DashStyles.Solid;
@@ -769,7 +772,7 @@ namespace PDF_Master.ViewModels.Tools
                     freetextArgs.FontWeight = defaultAnnot.FontWeight;
                     freetextArgs.FontStyle = defaultAnnot.FontStyle;
                     freetextArgs.LineWidth = defaultAnnot.Thickness;
-
+                    freetextArgs.BgColor= defaultAnnot.BackgroundColor;
                     int align = (int)Settings.Default.AppProperties.Annotate.TextAlign;
 
                     if (align == 0)

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

@@ -1752,6 +1752,7 @@ namespace PDF_Master.ViewModels.Tools
                             case AnnotArgsType.AnnotSticky:
                                 if (PDFViewer.ToolManager.HasTool)
                                 {
+                                    //PDFViewer.RemoveTool(false);
                                     events.GetEvent<StickyNoteEvent>().Subscribe(UnStickyNote, q => q.Unicode == Unicode);
                                 }
                                 else

+ 13 - 8
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -210,7 +210,7 @@ namespace PDF_Master.ViewModels
         public CPDFViewer PDFViewer { get; set; }
         public bool ReadModeIsShowProperty { get; set; } = false;
         public MainContentViewModel mainViewModel { get; set; }
-
+        public bool IsSettingOut = false;
         public IRegionManager region;
 
         public IDialogService dialogs;
@@ -535,10 +535,11 @@ namespace PDF_Master.ViewModels
                 //或者手动点击按钮时 也展开
                 if (Settings.Default.AppProperties.InitialVIew.AutoExpandProperty || FromClick)
                 {
-                    if (mainViewModel.IsBookMode)
-                    {
-                        this.events.GetEvent<ReadModePropertyOpenEvent>().Publish(new ReadModePropertyOpenArgs() { Unicode = unicode });
-                    }
+                    //阅读模式 不显示属性面板
+                    //if (mainViewModel.IsBookMode)
+                    //{
+                    //    this.events.GetEvent<ReadModePropertyOpenEvent>().Publish(new ReadModePropertyOpenArgs() { Unicode = unicode });
+                    //}
 
                     SetProperty(ref isPorpertyOpen, value);
                 }
@@ -1450,6 +1451,7 @@ namespace PDF_Master.ViewModels
                 var annotate = Settings.Default.AppProperties.Annotate;
                 if (annotToolContent != null)
                 {
+                    IsSettingOut = true;
                     //与注释联动修改颜色
                     UpdateFreeHand(annotate, annotToolContent);
                     UpdateTextHighlight(annotate, annotToolContent);
@@ -1457,8 +1459,10 @@ namespace PDF_Master.ViewModels
                     UpdateStrikethrough(annotate, annotToolContent);
                     UpdateLine(annotate, annotToolContent);
                     UpdateArrow(annotate, annotToolContent);
+                    //IsSettingOut =false;
                 }
             });
+
             if (PDFViewer != null)
             {
                 PDFViewer.SetBackgroundBrush(new System.Windows.Media.SolidColorBrush(Settings.Default.AppProperties.InitialVIew.BackGround));
@@ -1851,7 +1855,9 @@ namespace PDF_Master.ViewModels
             await Task.Delay(1);
             PDFViewer.DisableClearSelectAnnot(false);
             PDFViewer.ClearSelectAnnots();
-            PDFViewer.SetMouseMode(MouseModes.PanTool);
+            PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+            var annotArgs = new SelectToolArgs();
+            PDFViewer.SetToolParam(annotArgs);
 
             #region 旧版本
 
@@ -1981,7 +1987,7 @@ namespace PDF_Master.ViewModels
 
             PDFViewer.DisableClearSelectAnnot(false);
             PDFViewer.ClearSelectAnnots();
-            PDFViewer.SetMouseMode(MouseModes.PanTool);
+            PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
             var annotArgs = new SelectToolArgs();
             PDFViewer.SetToolParam(annotArgs);
             ShowTip(true);
@@ -1991,7 +1997,6 @@ namespace PDF_Master.ViewModels
             await Task.Delay(3000);
             //ReadModelTip = Visibility.Collapsed;
             TipVisible = Visibility.Collapsed;
-
         }
 
         #region PDFViewer鼠标滚轮缩放事件

+ 5 - 2
PDF Office/Views/PropertyPanel/AnnotPanel/TextAnnotProperty.xaml

@@ -126,14 +126,16 @@
                     FontSize="12"
                     Foreground="{StaticResource color.sys.text.neutral.lv2}"
                     Text="Color" />
-
+                
                 <CompositeControl:ColorContent
                     x:Name="cusColor"
                     Grid.Row="1"
                     Margin="0,8,0,0"
                     ColorType="{Binding ColorType}"
                     ItemSource="{Binding BasicVm.ColorItems}"
-                    UIColor="{Binding BasicVm.CurrentFontColor, Mode=OneWay}">
+                    UIColor="{Binding BasicVm.CurrentFontColor, Mode=OneWay}" DefaultColor="{Binding TextDefaultColor,Mode=TwoWay}" 
+                    DefaultColorVisibility="Visible"
+                    DefaultColorInvoke="cusColor_DefaultColorInvoke">
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedColorInvoke">
                             <i:InvokeCommandAction Command="{Binding SelectedColorChangedCommand}" CommandParameter="{Binding ElementName=cusColor, Path=SelectedColor}" />
@@ -142,5 +144,6 @@
                 </CompositeControl:ColorContent>
             </Grid>
         </StackPanel>
+       
     </Grid>
 </UserControl>

+ 6 - 1
PDF Office/Views/PropertyPanel/AnnotPanel/TextAnnotProperty.xaml.cs

@@ -29,7 +29,12 @@ namespace PDF_Master.Views.PropertyPanel.AnnotPanel
         public TextAnnotProperty()
         {
             InitializeComponent();
-        }
+        }
+
+        private void cusColor_DefaultColorInvoke(object sender, RoutedEventArgs e)
+        {
+            ViewModel.DefaultColorChangedCommand?.Execute(sender);
+        }
     }
    
 }

+ 101 - 115
PDF Office/Views/ViewContent.xaml

@@ -20,7 +20,6 @@
     DragOver="UserControl_DragOver"
     Drop="UserControl_Drop"
     IsVisibleChanged="UserControl_IsVisibleChanged"
-    KeyDown="UserControl_KeyDown"
     MouseDown="UserControl_MouseDown"
     Unloaded="UserControl_Unloaded"
     mc:Ignorable="d">
@@ -432,7 +431,6 @@
                 </ToggleButton>
             </StackPanel>
 
-
             <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Disabled" VerticalAlignment="Center" Margin="180,0,160,0" x:Name="ScrViewTab">
                 <TabControl
                     x:Name="ToolTabControl"
@@ -446,7 +444,6 @@
                     Style="{StaticResource TabControlWithUnderLineStyle}"
                     Visibility="{Binding IsReadMode}">
 
-
                     <cus:IconAndTextTabItem
                         x:Name="TabItemAnnotation"
                         Header="{Binding T_Annotation}"
@@ -506,120 +503,109 @@
                 </TabControl>
             </ScrollViewer>
 
-
-
             <!--<ScrollViewer HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Disabled" VerticalAlignment="Center" Margin="180,0,160,0">
-                <TabControl
-                    x:Name="ToolTabControl"
-                    Grid.Row="0"
-                    Grid.RowSpan="2"
-                    HorizontalAlignment="Center"
-                    VerticalAlignment="Top"
-                    BorderThickness="0"
-                    PreviewMouseLeftButtonDown="ToolTabControl_PreviewMouseLeftButtonDown"
-                    SelectedIndex="{Binding TabSelectedIndex, Mode=TwoWay}"
-                    Style="{StaticResource TabControlWithUnderLineStyle}"
-                    Visibility="{Binding IsReadMode}">
-
-
-                    <cus:IconAndTextTabItem
-                        x:Name="TabItemAnnotation"
-                        Header="{Binding T_Annotation}"
-                        Style="{StaticResource ToolbarTabs}">
-                        <Grid Grid.Row="1" Height="40" />
-                    </cus:IconAndTextTabItem>
-                    <cus:IconAndTextTabItem
-                        x:Name="TabItemPageEdit"
-                        Header="{Binding T_PageEdit}"
-                        Style="{StaticResource ToolbarTabs}" />
-                    <cus:IconAndTextTabItem
-                        x:Name="TabItemConvert"
-                        Header="{Binding T_Converter}"
-                        Style="{StaticResource ToolbarTabs}" />
-                    <cus:IconAndTextTabItem
-                        x:Name="TabItemScan"
-                        Header="扫描和OCR"
-                        Style="{StaticResource ToolbarTabs}"
-                        Visibility="Collapsed">
-                        <Grid Grid.Row="1" Height="40" />
-                    </cus:IconAndTextTabItem>
-                    <cus:IconAndTextTabItem
-                        x:Name="TabItemEdit"
-                        Height="40"
-                        Header="编辑"
-                        Style="{StaticResource ToolbarTabs}"
-                        Visibility="Collapsed">
-                        <Grid Grid.Row="1" Height="40" />
-                    </cus:IconAndTextTabItem>
-                    <cus:IconAndTextTabItem
-                        x:Name="TabItemForm"
-                        Height="40"
-                        Header="表单"
-                        Style="{StaticResource ToolbarTabs}"
-                        Visibility="Collapsed">
-                        <Grid Grid.Row="1" Height="40" />
-                    </cus:IconAndTextTabItem>
-                    <cus:IconAndTextTabItem
-                        x:Name="TabItemFill"
-                        Height="40"
-                        Header="{Binding T_FillSign}"
-                        Style="{StaticResource ToolbarTabs}">
-                        <Grid Grid.Row="1" Height="40" />
-                    </cus:IconAndTextTabItem>
-                    <cus:IconAndTextTabItem
-                        x:Name="TabItemTool"
-                        Height="40"
-                        Header="{Binding T_Tools}"
-                        Style="{StaticResource ToolbarTabs}">
-                        <Grid Grid.Row="1" Height="40" />
-                    </cus:IconAndTextTabItem>
-                    <i:Interaction.Triggers>
-                        <i:EventTrigger EventName="SelectionChanged">
-                            <i:InvokeCommandAction Command="{Binding TabControlSelectionChangedCommand}" PassEventArgsToCommand="True" />
-                        </i:EventTrigger>
-                    </i:Interaction.Triggers>
-                </TabControl>
-                <ScrollViewer.Resources>
-                    <Style TargetType="ScrollBar">
-                        <Setter Property="VerticalAlignment" Value="Center"/>
-                        <Setter Property="Template">
-                            <Setter.Value>
-                                <ControlTemplate TargetType="ScrollBar">
-                                    <Grid >
-                                        <Grid.ColumnDefinitions>
-                                            <ColumnDefinition Width="Auto" />
-                                            <ColumnDefinition Width="{Binding ElementName=ToolTabControl}" />
-                                            <ColumnDefinition Width="Auto" />
-                                        </Grid.ColumnDefinitions>
-
-                                        <Button
-                                            Grid.Column="0"
-                                            Width="15"
-                                            Command="{x:Static ScrollBar.LineLeftCommand}"
-                                            CommandTarget="{Binding ElementName=scrollViewer}"
-                                            Content="&lt;" />
-                                       
-                                        <Button
-                                            Grid.Column="2"
-                                            Width="15"
-                                            Command="{x:Static ScrollBar.LineRightCommand}"
-                                            CommandTarget="{Binding ElementName=scrollViewer}"
-                                            Content="&gt;" />
-                                    </Grid>
-                                </ControlTemplate>
-                            </Setter.Value>
-                        </Setter>
-                    </Style>
-                </ScrollViewer.Resources>
-
-            
-
+            <TabControl
+            x:Name="ToolTabControl"
+            Grid.Row="0"
+            Grid.RowSpan="2"
+            HorizontalAlignment="Center"
+            VerticalAlignment="Top"
+            BorderThickness="0"
+            PreviewMouseLeftButtonDown="ToolTabControl_PreviewMouseLeftButtonDown"
+            SelectedIndex="{Binding TabSelectedIndex, Mode=TwoWay}"
+            Style="{StaticResource TabControlWithUnderLineStyle}"
+            Visibility="{Binding IsReadMode}">
+
+            <cus:IconAndTextTabItem
+            x:Name="TabItemAnnotation"
+            Header="{Binding T_Annotation}"
+            Style="{StaticResource ToolbarTabs}">
+            <Grid Grid.Row="1" Height="40" />
+            </cus:IconAndTextTabItem>
+            <cus:IconAndTextTabItem
+            x:Name="TabItemPageEdit"
+            Header="{Binding T_PageEdit}"
+            Style="{StaticResource ToolbarTabs}" />
+            <cus:IconAndTextTabItem
+            x:Name="TabItemConvert"
+            Header="{Binding T_Converter}"
+            Style="{StaticResource ToolbarTabs}" />
+            <cus:IconAndTextTabItem
+            x:Name="TabItemScan"
+            Header="扫描和OCR"
+            Style="{StaticResource ToolbarTabs}"
+            Visibility="Collapsed">
+            <Grid Grid.Row="1" Height="40" />
+            </cus:IconAndTextTabItem>
+            <cus:IconAndTextTabItem
+            x:Name="TabItemEdit"
+            Height="40"
+            Header="编辑"
+            Style="{StaticResource ToolbarTabs}"
+            Visibility="Collapsed">
+            <Grid Grid.Row="1" Height="40" />
+            </cus:IconAndTextTabItem>
+            <cus:IconAndTextTabItem
+            x:Name="TabItemForm"
+            Height="40"
+            Header="表单"
+            Style="{StaticResource ToolbarTabs}"
+            Visibility="Collapsed">
+            <Grid Grid.Row="1" Height="40" />
+            </cus:IconAndTextTabItem>
+            <cus:IconAndTextTabItem
+            x:Name="TabItemFill"
+            Height="40"
+            Header="{Binding T_FillSign}"
+            Style="{StaticResource ToolbarTabs}">
+            <Grid Grid.Row="1" Height="40" />
+            </cus:IconAndTextTabItem>
+            <cus:IconAndTextTabItem
+            x:Name="TabItemTool"
+            Height="40"
+            Header="{Binding T_Tools}"
+            Style="{StaticResource ToolbarTabs}">
+            <Grid Grid.Row="1" Height="40" />
+            </cus:IconAndTextTabItem>
+            <i:Interaction.Triggers>
+            <i:EventTrigger EventName="SelectionChanged">
+            <i:InvokeCommandAction Command="{Binding TabControlSelectionChangedCommand}" PassEventArgsToCommand="True" />
+            </i:EventTrigger>
+            </i:Interaction.Triggers>
+            </TabControl>
+            <ScrollViewer.Resources>
+            <Style TargetType="ScrollBar">
+            <Setter Property="VerticalAlignment" Value="Center" />
+            <Setter Property="Template">
+            <Setter.Value>
+            <ControlTemplate TargetType="ScrollBar">
+            <Grid>
+            <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="Auto" />
+            <ColumnDefinition Width="{Binding ElementName=ToolTabControl}" />
+            <ColumnDefinition Width="Auto" />
+            </Grid.ColumnDefinitions>
+
+            <Button
+            Grid.Column="0"
+            Width="15"
+            Command="{x:Static ScrollBar.LineLeftCommand}"
+            CommandTarget="{Binding ElementName=scrollViewer}"
+            Content="&lt;" />
+
+            <Button
+            Grid.Column="2"
+            Width="15"
+            Command="{x:Static ScrollBar.LineRightCommand}"
+            CommandTarget="{Binding ElementName=scrollViewer}"
+            Content="&gt;" />
+            </Grid>
+            </ControlTemplate>
+            </Setter.Value>
+            </Setter>
+            </Style>
+            </ScrollViewer.Resources>
             </ScrollViewer>-->
-
-
-
-
-
         </Grid>
 
         <!--  底部工具栏  -->

+ 6 - 3
PDF Office/Views/ViewContent.xaml.cs

@@ -1,4 +1,5 @@
 using ComPDFKitViewer;
+using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
 using PDF_Master.EventAggregators;
 using PDF_Master.Helper;
@@ -95,7 +96,8 @@ namespace PDF_Master.Views
                 Grid.SetRow(DocumentView, 0);
                 Grid.SetColumnSpan(GridViewer, 4);
                 Grid.SetColumn(GridViewer, 0);
-
+                //var annotArgs = new SelectToolArgs();
+                //viewModel.PDFViewer.SetToolParam(annotArgs);
                 #region to do
 
                 //Grid.SetRowSpan(RectangleBota, 4);
@@ -113,8 +115,9 @@ namespace PDF_Master.Views
                 Grid.SetRowSpan(DocumentView, 1);
                 Grid.SetRow(DocumentView, 2);
                 Grid.SetColumn(GridViewer, 2);
-                Grid.SetColumnSpan(GridViewer, 1);
-
+                Grid.SetColumnSpan(GridViewer, 1);
+                //var annotArgs = new SelectToolArgs();
+                //viewModel.PDFViewer.SetToolParam(annotArgs);
                 #region to do
 
                 //Grid.SetRowSpan(RectangleBota, 1);