|
@@ -1,5 +1,6 @@
|
|
|
using ComPDFKitViewer;
|
|
|
using ComPDFKitViewer.AnnotEvent;
|
|
|
+using PDF_Office.Helper;
|
|
|
using PDF_Office.Model;
|
|
|
using PDF_Office.ViewModels.Tools;
|
|
|
using PDFSettings;
|
|
@@ -231,25 +232,37 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
var colorValue = (Color)color;
|
|
|
if (colorValue != null)
|
|
|
{
|
|
|
-
|
|
|
- switch (AnnotType)
|
|
|
+ if(IsMultiSelected)
|
|
|
{
|
|
|
- case AnnotArgsType.AnnotHighlight:
|
|
|
- SampleTextBg = new SolidColorBrush(colorValue);
|
|
|
- SampleTextBg.Opacity = AnnotOpacity;
|
|
|
- break;
|
|
|
- case AnnotArgsType.AnnotUnderline:
|
|
|
- case AnnotArgsType.AnnotStrikeout:
|
|
|
- case AnnotArgsType.AnnotSquiggly:
|
|
|
- case AnnotArgsType.AnnotSticky:
|
|
|
- SelectColor = new SolidColorBrush(colorValue);
|
|
|
- SelectColor.Opacity = AnnotOpacity;
|
|
|
- break;
|
|
|
+ foreach (var item in PropertyPanel.AnnotEvents)
|
|
|
+ {
|
|
|
+ item?.UpdateAttrib(AnnotAttrib.Color, colorValue);
|
|
|
+ item?.UpdateAnnot();
|
|
|
+ }
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ switch (AnnotType)
|
|
|
+ {
|
|
|
+ case AnnotArgsType.AnnotHighlight:
|
|
|
+ SampleTextBg = new SolidColorBrush(colorValue);
|
|
|
+ SampleTextBg.Opacity = AnnotOpacity;
|
|
|
+ break;
|
|
|
+ case AnnotArgsType.AnnotUnderline:
|
|
|
+ case AnnotArgsType.AnnotStrikeout:
|
|
|
+ case AnnotArgsType.AnnotSquiggly:
|
|
|
+ case AnnotArgsType.AnnotSticky:
|
|
|
+ SelectColor = new SolidColorBrush(colorValue);
|
|
|
+ SelectColor.Opacity = AnnotOpacity;
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
- Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
|
|
|
- changeData[AnnotType] = color;
|
|
|
- PropertyPanel.DataChangedInvoke(this, changeData);
|
|
|
+ Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
|
|
|
+ changeData[AnnotType] = color;
|
|
|
+ PropertyPanel.DataChangedInvoke(this, changeData);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -296,14 +309,30 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
|
|
|
{
|
|
|
AnnotEvent = PropertyPanel.AnnotEvent;
|
|
|
Annot = PropertyPanel.annot;
|
|
|
- AnnotType = Annot.EventType;
|
|
|
- if(PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count > 1)
|
|
|
+ AnnotType = Annot.EventType;
|
|
|
+
|
|
|
+ if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count > 1)
|
|
|
{
|
|
|
IsMultiSelected = true;
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ IsMultiSelected = false;
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- GetAnnotProperty();
|
|
|
+ if(IsMultiSelected)
|
|
|
+ {
|
|
|
+ DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotHighlight);
|
|
|
+ if (annotProperty != null)
|
|
|
+ {
|
|
|
+ SelectColor = new SolidColorBrush(annotProperty.ForgoundColor);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ GetAnnotProperty();
|
|
|
+ }
|
|
|
+
|
|
|
LoadPropertyHandler?.Invoke(null, Annot);
|
|
|
}
|
|
|
|