|
@@ -1,6 +1,7 @@
|
|
using ComPDFKit.PDFDocument;
|
|
using ComPDFKit.PDFDocument;
|
|
using ComPDFKitViewer;
|
|
using ComPDFKitViewer;
|
|
using ComPDFKitViewer.AnnotEvent;
|
|
using ComPDFKitViewer.AnnotEvent;
|
|
|
|
+using PDF_Office.CustomControl.CompositeControl;
|
|
using PDF_Office.Helper;
|
|
using PDF_Office.Helper;
|
|
using Prism.Mvvm;
|
|
using Prism.Mvvm;
|
|
using Prism.Regions;
|
|
using Prism.Regions;
|
|
@@ -341,18 +342,40 @@ namespace PDF_Office.ViewModels.Tools
|
|
var popMenu = App.Current.FindResource("HightAnnotContextMenu") as ContextMenu;
|
|
var popMenu = App.Current.FindResource("HightAnnotContextMenu") as ContextMenu;
|
|
CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
|
|
CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
|
|
//颜色列表
|
|
//颜色列表
|
|
- customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
|
|
|
|
+ ColorContent colorContent = new ColorContent();
|
|
|
|
+ colorContent.DataContext = sender;
|
|
|
|
+ colorContent.SelectedColorHandler -= colorContent_SelectedColorHandler;
|
|
|
|
+ colorContent.SelectedColorHandler += colorContent_SelectedColorHandler;
|
|
|
|
+ customMenu.SetMenuUI(0,colorContent);
|
|
//复制文本
|
|
//复制文本
|
|
- customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(1, HightAnnotCopyText_MenuCommand);
|
|
//删除
|
|
//删除
|
|
- customMenu.SetMenuBinding(2, ApplicationCommands.Cut);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(2, ApplicationCommands.Delete);
|
|
//添加笔记
|
|
//添加笔记
|
|
- customMenu.SetMenuBinding(3, ApplicationCommands.Paste);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(3, AnnotAddNoteText_MenuCommand);
|
|
//设置当前属性为默认值
|
|
//设置当前属性为默认值
|
|
- customMenu.SetMenuBinding(4, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(4, AnnotDefaultValue_MenuCommand);
|
|
return popMenu;
|
|
return popMenu;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void colorContent_SelectedColorHandler(object sender, Color e)
|
|
|
|
+ {
|
|
|
|
+ if (e == null) return;
|
|
|
|
+
|
|
|
|
+ var annot =(sender as FrameworkElement).DataContext as AnnotHandlerEventArgs;
|
|
|
|
+ if(annot != null)
|
|
|
|
+ {
|
|
|
|
+ var test = annot as TextHighlightAnnotArgs;
|
|
|
|
+ if(test != null)
|
|
|
|
+ {
|
|
|
|
+ var anvent = AnnotAttribEvent.GetAnnotAttribEvent(test, test.GetAnnotAttrib());
|
|
|
|
+ anvent.UpdateAttrib(AnnotAttrib.Color, e);
|
|
|
|
+ anvent.UpdateAnnot();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
//手绘
|
|
//手绘
|
|
private ContextMenu SelectFreeHandAnnotMenu(object sender)
|
|
private ContextMenu SelectFreeHandAnnotMenu(object sender)
|
|
{
|
|
{
|
|
@@ -361,20 +384,20 @@ namespace PDF_Office.ViewModels.Tools
|
|
//复制
|
|
//复制
|
|
customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
//剪切
|
|
//剪切
|
|
- customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
|
|
//粘贴
|
|
//粘贴
|
|
- customMenu.SetMenuBinding(2, ApplicationCommands.Cut);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
|
|
//删除
|
|
//删除
|
|
- customMenu.SetMenuBinding(3, ApplicationCommands.Paste);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(3, ApplicationCommands.Delete);
|
|
//颜色
|
|
//颜色
|
|
- customMenu.SetMenuBinding(4, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(4, AnnotColorPalette_MenuCommand);
|
|
//线段样式
|
|
//线段样式
|
|
- customMenu.SetSubMenuBinding(5, 0, ApplicationCommands.Delete);
|
|
|
|
- customMenu.SetSubMenuBinding(5, 1, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetSubMenuBinding(5, 0, ApplicationCommands.Delete);//
|
|
|
|
+ customMenu.SetSubMenuBinding(5, 1, ApplicationCommands.Delete);//
|
|
//添加笔记
|
|
//添加笔记
|
|
- customMenu.SetMenuBinding(6, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(6, AnnotAddNoteText_MenuCommand);
|
|
//设置当前属性为默认值
|
|
//设置当前属性为默认值
|
|
- customMenu.SetMenuBinding(7, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(7, AnnotDefaultValue_MenuCommand);
|
|
return popMenu;
|
|
return popMenu;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -386,23 +409,23 @@ namespace PDF_Office.ViewModels.Tools
|
|
//复制
|
|
//复制
|
|
customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
//剪切
|
|
//剪切
|
|
- customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
|
|
//粘贴
|
|
//粘贴
|
|
- customMenu.SetMenuBinding(2, ApplicationCommands.Cut);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
|
|
//删除
|
|
//删除
|
|
- customMenu.SetMenuBinding(3, ApplicationCommands.Paste);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(3, ApplicationCommands.Delete);
|
|
//文本颜色
|
|
//文本颜色
|
|
- customMenu.SetMenuBinding(4, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(4, AnnotColorPalette_MenuCommand);
|
|
//字体
|
|
//字体
|
|
- customMenu.SetSubMenuBinding(5, 0, ApplicationCommands.Delete);
|
|
|
|
- customMenu.SetSubMenuBinding(5, 1, ApplicationCommands.Delete);
|
|
|
|
- customMenu.SetSubMenuBinding(5, 2, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetSubMenuBinding(5, 0, ApplicationCommands.Delete);//
|
|
|
|
+ customMenu.SetSubMenuBinding(5, 1, ApplicationCommands.Delete);//
|
|
|
|
+ customMenu.SetSubMenuBinding(5, 2, ApplicationCommands.Delete);//
|
|
//文本对齐
|
|
//文本对齐
|
|
- customMenu.SetSubMenuBinding(6, 0, ApplicationCommands.Delete);
|
|
|
|
- customMenu.SetSubMenuBinding(6, 1, ApplicationCommands.Delete);
|
|
|
|
- customMenu.SetSubMenuBinding(6, 2, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetSubMenuBinding(6, 0, ApplicationCommands.Delete);//
|
|
|
|
+ customMenu.SetSubMenuBinding(6, 1, ApplicationCommands.Delete);//
|
|
|
|
+ customMenu.SetSubMenuBinding(6, 2, ApplicationCommands.Delete);//
|
|
//设置当前属性为默认值
|
|
//设置当前属性为默认值
|
|
- customMenu.SetMenuBinding(7, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(7, AnnotDefaultValue_MenuCommand);
|
|
return popMenu;
|
|
return popMenu;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -414,17 +437,17 @@ namespace PDF_Office.ViewModels.Tools
|
|
//复制
|
|
//复制
|
|
customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
//剪切
|
|
//剪切
|
|
- customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
|
|
//粘贴
|
|
//粘贴
|
|
- customMenu.SetMenuBinding(2, ApplicationCommands.Cut);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
|
|
//删除
|
|
//删除
|
|
- customMenu.SetMenuBinding(3, ApplicationCommands.Paste);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(3, ApplicationCommands.Delete);
|
|
//颜色
|
|
//颜色
|
|
- customMenu.SetMenuBinding(4, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(4, AnnotColorPalette_MenuCommand);
|
|
//编辑便签
|
|
//编辑便签
|
|
- customMenu.SetMenuBinding(5, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(5, ApplicationCommands.Delete);//
|
|
//设置当前属性为默认值
|
|
//设置当前属性为默认值
|
|
- customMenu.SetMenuBinding(7, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(7, AnnotDefaultValue_MenuCommand);
|
|
return popMenu;
|
|
return popMenu;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -436,23 +459,23 @@ namespace PDF_Office.ViewModels.Tools
|
|
//复制
|
|
//复制
|
|
customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
//剪切
|
|
//剪切
|
|
- customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
|
|
//粘贴
|
|
//粘贴
|
|
- customMenu.SetMenuBinding(2, ApplicationCommands.Cut);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
|
|
//删除
|
|
//删除
|
|
- customMenu.SetMenuBinding(3, ApplicationCommands.Paste);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(3, ApplicationCommands.Delete);
|
|
//颜色
|
|
//颜色
|
|
- customMenu.SetMenuBinding(4, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(4, AnnotColorPalette_MenuCommand);
|
|
//线段样式
|
|
//线段样式
|
|
- customMenu.SetSubMenuBinding(6, 0, ApplicationCommands.Delete);
|
|
|
|
- customMenu.SetSubMenuBinding(6, 1, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetSubMenuBinding(6, 0, ApplicationCommands.Delete);//
|
|
|
|
+ customMenu.SetSubMenuBinding(6, 1, ApplicationCommands.Delete);//
|
|
//线段方向
|
|
//线段方向
|
|
- customMenu.SetSubMenuBinding(7, 0, ApplicationCommands.Delete);
|
|
|
|
- customMenu.SetSubMenuBinding(7, 1, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetSubMenuBinding(7, 0, ApplicationCommands.Delete);//
|
|
|
|
+ customMenu.SetSubMenuBinding(7, 1, ApplicationCommands.Delete);//
|
|
//添加笔记
|
|
//添加笔记
|
|
- customMenu.SetMenuBinding(8, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(8, AnnotAddNoteText_MenuCommand);
|
|
//设置当前属性为默认值
|
|
//设置当前属性为默认值
|
|
- customMenu.SetMenuBinding(8, ApplicationCommands.Delete);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(8, AnnotDefaultValue_MenuCommand);
|
|
return popMenu;
|
|
return popMenu;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -464,11 +487,11 @@ namespace PDF_Office.ViewModels.Tools
|
|
//复制
|
|
//复制
|
|
customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
//剪切
|
|
//剪切
|
|
- customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
|
|
//粘贴
|
|
//粘贴
|
|
- customMenu.SetMenuBinding(2, ApplicationCommands.Cut);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
|
|
//删除
|
|
//删除
|
|
- customMenu.SetMenuBinding(3, ApplicationCommands.Paste);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(3, ApplicationCommands.Delete);
|
|
return popMenu;
|
|
return popMenu;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -480,17 +503,17 @@ namespace PDF_Office.ViewModels.Tools
|
|
//复制
|
|
//复制
|
|
customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
//剪切
|
|
//剪切
|
|
- customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
|
|
//粘贴
|
|
//粘贴
|
|
- customMenu.SetMenuBinding(2, ApplicationCommands.Cut);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
|
|
//删除
|
|
//删除
|
|
- customMenu.SetMenuBinding(3, ApplicationCommands.Paste);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(3, ApplicationCommands.Delete);
|
|
//导出
|
|
//导出
|
|
- customMenu.SetSubMenuBinding(4, 0, ApplicationCommands.Paste);
|
|
|
|
- customMenu.SetSubMenuBinding(4, 1, ApplicationCommands.Paste);
|
|
|
|
- customMenu.SetSubMenuBinding(4, 2, ApplicationCommands.Paste);
|
|
|
|
|
|
+ customMenu.SetSubMenuBinding(4, 0, ApplicationCommands.Paste);//
|
|
|
|
+ customMenu.SetSubMenuBinding(4, 1, ApplicationCommands.Paste);//
|
|
|
|
+ customMenu.SetSubMenuBinding(4, 2, ApplicationCommands.Paste);//
|
|
//添加笔记
|
|
//添加笔记
|
|
- customMenu.SetMenuBinding(5, ApplicationCommands.Paste);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(5, ApplicationCommands.Paste);//
|
|
return popMenu;
|
|
return popMenu;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -502,17 +525,17 @@ namespace PDF_Office.ViewModels.Tools
|
|
if (isHightAnnot)
|
|
if (isHightAnnot)
|
|
{
|
|
{
|
|
customMenu.SetVisibilityProperty(0, false);
|
|
customMenu.SetVisibilityProperty(0, false);
|
|
- customMenu.SetVisibilityProperty(2, false);
|
|
|
|
|
|
+ customMenu.SetVisibilityProperty(1, false);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
//复制
|
|
//复制
|
|
customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
//剪切
|
|
//剪切
|
|
- customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
|
|
}
|
|
}
|
|
//删除
|
|
//删除
|
|
- customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
|
|
|
|
|
|
+ customMenu.SetMenuBinding(2, ApplicationCommands.Delete);
|
|
return popMenu;
|
|
return popMenu;
|
|
}
|
|
}
|
|
|
|
|