|
@@ -336,8 +336,10 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
|
|
|
#region 注释-右键菜单
|
|
|
|
|
|
- //高亮注释,右键菜单
|
|
|
- private ContextMenu SelectHightAnnotMenu(object sender)
|
|
|
+ /// <summary>
|
|
|
+ /// 高亮注释,右键菜单
|
|
|
+ /// </summary>
|
|
|
+ private void InitSelectHightAnnotMenu()
|
|
|
{
|
|
|
var popMenu = new ContextMenu();
|
|
|
PopMenu pop = new PopMenu(popMenu);
|
|
@@ -345,45 +347,51 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
colorContent.Name = "hightcolor";
|
|
|
colorContent.SelectedColorHandler -= colorContent_SelectedColorHandler;
|
|
|
colorContent.SelectedColorHandler += colorContent_SelectedColorHandler;
|
|
|
- pop.AddItem(colorContent);
|
|
|
+ colorContent.VerticalAlignment = VerticalAlignment.Top;
|
|
|
+ colorContent.Height = 60;
|
|
|
+ var menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "hightColor";
|
|
|
+ menuItem.Height = colorContent.Height;
|
|
|
+ menuItem.Header = colorContent;
|
|
|
+ var hightColorStyle = App.Current.FindResource("UIElementMenuItem") as Style;
|
|
|
+ if (hightColorStyle != null)
|
|
|
+ menuItem.Style = hightColorStyle;
|
|
|
|
|
|
- var menuItem = new MenuItem();
|
|
|
+ pop.AddItem(menuItem);
|
|
|
+
|
|
|
+ pop.AddItem(GetSeparator());
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
menuItem.Name = "hightCopyText";
|
|
|
menuItem.Header = "复制文本";
|
|
|
- pop.BindingEvent(pop.AddItem(menuItem), HightAnnotCopyText_MenuCommand, sender);
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), HightAnnotCopyText_MenuCommand);
|
|
|
|
|
|
menuItem = new MenuItem();
|
|
|
menuItem.Name = "hightdelete";
|
|
|
menuItem.Header = "删除";
|
|
|
- pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete, sender);
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
|
|
|
+
|
|
|
+ pop.AddItem(GetSeparator());
|
|
|
|
|
|
menuItem = new MenuItem();
|
|
|
menuItem.Name = "hightAddNote";
|
|
|
menuItem.Header = "添加笔记";
|
|
|
- pop.BindingEvent(pop.AddItem(menuItem), AnnotAddNoteText_MenuCommand, sender);
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), AnnotAddNoteText_MenuCommand);
|
|
|
|
|
|
menuItem = new MenuItem();
|
|
|
menuItem.Name = "hightdefault";
|
|
|
menuItem.Header = "设置当前属性为默认值";
|
|
|
- pop.BindingEvent(pop.AddItem(menuItem), AnnotDefaultValue_MenuCommand, sender);
|
|
|
-
|
|
|
- //var popMenu = App.Current.FindResource("HightAnnotContextMenu") as ContextMenu;
|
|
|
- //CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
|
|
|
- ////颜色列表
|
|
|
- //ColorContent colorContent = new ColorContent();
|
|
|
- //colorContent.DataContext = sender;
|
|
|
- //colorContent.SelectedColorHandler -= colorContent_SelectedColorHandler;
|
|
|
- //colorContent.SelectedColorHandler += colorContent_SelectedColorHandler;
|
|
|
- //customMenu.SetMenuUI(0,colorContent);
|
|
|
- ////复制文本
|
|
|
- //customMenu.SetMenuBinding(1, HightAnnotCopyText_MenuCommand);
|
|
|
- ////删除
|
|
|
- //customMenu.SetMenuBinding(2, ApplicationCommands.Delete);
|
|
|
- ////添加笔记
|
|
|
- //customMenu.SetMenuBinding(3, AnnotAddNoteText_MenuCommand);
|
|
|
- ////设置当前属性为默认值
|
|
|
- //customMenu.SetMenuBinding(4, AnnotDefaultValue_MenuCommand);
|
|
|
- return popMenu;
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), AnnotDefaultValue_MenuCommand);
|
|
|
+ HightAnnotPopMenu = pop;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Separator GetSeparator()
|
|
|
+ {
|
|
|
+ Separator separator = new Separator();
|
|
|
+ separator.Height = 1;
|
|
|
+ separator.BorderBrush = new SolidColorBrush(Color.FromArgb(0x33, 0x00, 0x00, 0x00));
|
|
|
+ separator.BorderThickness = new Thickness(1);
|
|
|
+ return separator;
|
|
|
}
|
|
|
|
|
|
private void colorContent_SelectedColorHandler(object sender, Color e)
|
|
@@ -404,205 +412,401 @@ namespace PDF_Office.ViewModels.Tools
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //手绘
|
|
|
- private ContextMenu SelectFreeHandAnnotMenu(object sender)
|
|
|
+ /// <summary>
|
|
|
+ /// 手绘
|
|
|
+ /// </summary>
|
|
|
+ private void InitSelectFreeHandAnnotMenu()
|
|
|
{
|
|
|
- var popMenu = App.Current.FindResource("FreeHandAnnotContextMenu") as ContextMenu;
|
|
|
- CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
|
|
|
- //复制
|
|
|
- customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
|
- //剪切
|
|
|
- customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
|
|
|
- //粘贴
|
|
|
- customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
|
|
|
- //删除
|
|
|
- customMenu.SetMenuBinding(3, ApplicationCommands.Delete);
|
|
|
- //颜色
|
|
|
- customMenu.SetMenuBinding(4, AnnotColorPalette_MenuCommand);
|
|
|
- //线段样式
|
|
|
- var freeHand = sender as FreehandAnnotArgs;
|
|
|
- bool IsSolid = true;
|
|
|
- if (freeHand != null)
|
|
|
- {
|
|
|
- IsSolid = AnnotPropertyPanel.IsSolidStyle(freeHand.LineDash);
|
|
|
-
|
|
|
- }
|
|
|
- customMenu.SetSubMenuBinding(5, 0, FreeHandLineStyle_MenuCommand,null, IsSolid);
|
|
|
- customMenu.SetSubMenuBinding(5, 1, FreeHandLineStyle_MenuCommand, null, !IsSolid);
|
|
|
- //添加笔记
|
|
|
- customMenu.SetMenuBinding(6, AnnotAddNoteText_MenuCommand);
|
|
|
- //设置当前属性为默认值
|
|
|
- customMenu.SetMenuBinding(7, AnnotDefaultValue_MenuCommand);
|
|
|
- return popMenu;
|
|
|
- }
|
|
|
+ var popMenu = new ContextMenu();
|
|
|
+ PopMenu pop = new PopMenu(popMenu);
|
|
|
+ var menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeHandCopy";
|
|
|
+ menuItem.Header = "复制";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Copy);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeHandCut";
|
|
|
+ menuItem.Header = "剪切";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Cut);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeHandPaste";
|
|
|
+ menuItem.Header = "粘贴";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Paste);
|
|
|
|
|
|
- //文本
|
|
|
- private ContextMenu SelectFreeTextAnnotMenu(object sender)
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeHandDelete";
|
|
|
+ menuItem.Header = "删除";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
|
|
|
+
|
|
|
+ pop.AddItem(GetSeparator());
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeHandColor";
|
|
|
+ menuItem.Header = "颜色...";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeHandLineStyle";
|
|
|
+ menuItem.Header = "线段样式";
|
|
|
+ pop.AddItem(menuItem);
|
|
|
+
|
|
|
+ RadioButton radioButton = new RadioButton();
|
|
|
+ radioButton.Name = "FreeHandSolid";
|
|
|
+ radioButton.Content = "实线";
|
|
|
+ radioButton.GroupName = "LineStyle";
|
|
|
+ radioButton.Tag = "Solid";
|
|
|
+ pop.BindingEvent(pop.AddChild("FreeHandLineStyle",radioButton), FreeHandLineStyle_MenuCommand);
|
|
|
+
|
|
|
+ radioButton = new RadioButton();
|
|
|
+ radioButton.Name = "FreeHandDash";
|
|
|
+ radioButton.Content = "虚线";
|
|
|
+ radioButton.GroupName = "LineStyle";
|
|
|
+ radioButton.Tag = "Dash";
|
|
|
+ pop.BindingEvent(pop.AddChild("FreeHandLineStyle", radioButton), FreeHandLineStyle_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeHandAddNote";
|
|
|
+ menuItem.Header = "添加笔记";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), AnnotAddNoteText_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeHandDefault";
|
|
|
+ menuItem.Header = "设置当前属性为默认值";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), AnnotDefaultValue_MenuCommand);
|
|
|
+ FreeHandAnnotPopMenu = pop;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 文本
|
|
|
+ /// </summary>
|
|
|
+ private void InitSelectFreeTextAnnotMenu()
|
|
|
{
|
|
|
- var popMenu = App.Current.FindResource("FreeTextAnnotContextMenu") as ContextMenu;
|
|
|
- CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
|
|
|
- //复制
|
|
|
- customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
|
- //剪切
|
|
|
- customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
|
|
|
- //粘贴
|
|
|
- customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
|
|
|
- //删除
|
|
|
- customMenu.SetMenuBinding(3, ApplicationCommands.Delete);
|
|
|
- //文本颜色
|
|
|
- customMenu.SetMenuBinding(4, AnnotColorPalette_MenuCommand);
|
|
|
- //字体
|
|
|
- var annot = sender as FreeTextAnnotArgs;
|
|
|
-
|
|
|
- customMenu.SetSubMenuBinding(5, 0, FreeTextFontFamily_MenuCommand, null, (annot != null && annot.FontFamily.ToString() == "Arial") ?true:false);
|
|
|
- customMenu.SetSubMenuBinding(5, 1, FreeTextFontFamily_MenuCommand, null,(annot != null && annot.FontFamily.ToString() == "Courier") ? true : false);
|
|
|
- customMenu.SetSubMenuBinding(5, 2, FreeTextFontFamily_MenuCommand, null, (annot != null && annot.FontFamily.ToString() == "Times New Roman") ? true : false);
|
|
|
-
|
|
|
- //文本对齐
|
|
|
- customMenu.SetSubMenuBinding(6, 0, FreeTextAglin_MenuCommand, null, (annot != null && annot.Align == TextAlignment.Left) ? true : false);
|
|
|
- customMenu.SetSubMenuBinding(6, 1, FreeTextAglin_MenuCommand, null, (annot != null && annot.Align == TextAlignment.Center) ? true : false);
|
|
|
- customMenu.SetSubMenuBinding(6, 2, FreeTextAglin_MenuCommand, null, (annot != null && annot.Align == TextAlignment.Right) ? true : false);
|
|
|
- //设置当前属性为默认值
|
|
|
- customMenu.SetMenuBinding(7, AnnotDefaultValue_MenuCommand);
|
|
|
- return popMenu;
|
|
|
+ var popMenu = new ContextMenu();
|
|
|
+ PopMenu pop = new PopMenu(popMenu);
|
|
|
+ var menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeTextCopy";
|
|
|
+ menuItem.Header = "复制";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Copy);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeTextCut";
|
|
|
+ menuItem.Header = "剪切";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Cut);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeTextPaste";
|
|
|
+ menuItem.Header = "粘贴";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Paste);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeTextDelete";
|
|
|
+ menuItem.Header = "删除";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
|
|
|
+
|
|
|
+ pop.AddItem(GetSeparator());
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeTextColor";
|
|
|
+ menuItem.Header = "颜色...";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeTextFontFamily";
|
|
|
+ menuItem.Header = "字体";
|
|
|
+ pop.AddItem(menuItem);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeTextArial";
|
|
|
+ menuItem.Header = "楷体";
|
|
|
+ menuItem.Tag = "Arial";
|
|
|
+ pop.BindingEvent(pop.AddChild("FreeTextFontFamily", menuItem), FreeTextFontFamily_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeTextCourier";
|
|
|
+ menuItem.Header = "Courier";
|
|
|
+ menuItem.Tag = "Courier";
|
|
|
+ pop.BindingEvent(pop.AddChild("FreeTextFontFamily", menuItem), FreeTextFontFamily_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeTextTimesRoman";
|
|
|
+ menuItem.Header = "Times New Roman";
|
|
|
+ menuItem.Tag = "Times New Roman";
|
|
|
+ pop.BindingEvent(pop.AddChild("FreeTextFontFamily", menuItem), FreeTextFontFamily_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeTextAglin";
|
|
|
+ menuItem.Header = "文本对齐";
|
|
|
+ pop.AddItem(menuItem);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeTextAglinLeft";
|
|
|
+ menuItem.Header = "左对齐";
|
|
|
+ menuItem.Tag = "Left";
|
|
|
+ pop.BindingEvent(pop.AddChild("FreeTextAglin", menuItem), FreeTextAglin_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeTextAglinCenter";
|
|
|
+ menuItem.Header = "居中对齐";
|
|
|
+ menuItem.Tag = "Center";
|
|
|
+ pop.BindingEvent(pop.AddChild("FreeTextAglin", menuItem), FreeTextAglin_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeTextAglinRight";
|
|
|
+ menuItem.Header = "右对齐";
|
|
|
+ menuItem.Tag = "Right";
|
|
|
+ pop.BindingEvent(pop.AddChild("FreeTextAglin", menuItem), FreeTextAglin_MenuCommand);
|
|
|
+
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "FreeHandDefault";
|
|
|
+ menuItem.Header = "设置当前属性为默认值";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), AnnotDefaultValue_MenuCommand);
|
|
|
+ FreeTextAnnotPopMenu = pop;
|
|
|
}
|
|
|
|
|
|
- //便签
|
|
|
- private ContextMenu SelectStrickNoteAnnotMenu(object sender)
|
|
|
+ /// <summary>
|
|
|
+ /// 便签
|
|
|
+ /// </summary>
|
|
|
+ private void InitSelectStrickNoteAnnotMenu()
|
|
|
{
|
|
|
- var popMenu = App.Current.FindResource("StrickNoteAnnotContextMenu") as ContextMenu;
|
|
|
- CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
|
|
|
- //复制
|
|
|
- customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
|
- //剪切
|
|
|
- customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
|
|
|
- //粘贴
|
|
|
- customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
|
|
|
- //删除
|
|
|
- customMenu.SetMenuBinding(3, ApplicationCommands.Delete);
|
|
|
- //颜色
|
|
|
- customMenu.SetMenuBinding(4, AnnotColorPalette_MenuCommand);
|
|
|
- if(sender as StickyAnnotArgs != null)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- //编辑便签
|
|
|
- customMenu.SetMenuBinding(5, ApplicationCommands.Delete);//
|
|
|
- //设置当前属性为默认值
|
|
|
- customMenu.SetMenuBinding(7, AnnotDefaultValue_MenuCommand);
|
|
|
- return popMenu;
|
|
|
+ var popMenu = new ContextMenu();
|
|
|
+ PopMenu pop = new PopMenu(popMenu);
|
|
|
+ var menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StrickNoteCopy";
|
|
|
+ menuItem.Header = "复制";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Copy);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StrickNoteCut";
|
|
|
+ menuItem.Header = "剪切";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Cut);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StrickNotePaste";
|
|
|
+ menuItem.Header = "粘贴";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Paste);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StrickNoteDelete";
|
|
|
+ menuItem.Header = "删除";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
|
|
|
+
|
|
|
+ pop.AddItem(GetSeparator());
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StrickNoteColor";
|
|
|
+ menuItem.Header = "颜色...";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StrickNoteEdit";
|
|
|
+ menuItem.Header = "编辑便签";
|
|
|
+ pop.AddItem(menuItem);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StrickNoteDefault";
|
|
|
+ menuItem.Header = "设置当前属性为默认值";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), AnnotDefaultValue_MenuCommand);
|
|
|
+ StrickNoteAnnotPopMenu = pop;
|
|
|
}
|
|
|
|
|
|
- //形状
|
|
|
- private ContextMenu SelectShapeAnnotMenu(object sender)
|
|
|
+ /// <summary>
|
|
|
+ /// 形状
|
|
|
+ /// </summary>
|
|
|
+ private void InitSelectShapeAnnotMenu()
|
|
|
{
|
|
|
- var popMenu = App.Current.FindResource("ShapeAnnotContextMenu") as ContextMenu;
|
|
|
- CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
|
|
|
- //复制
|
|
|
- customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
|
- //剪切
|
|
|
- customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
|
|
|
- //粘贴
|
|
|
- customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
|
|
|
- //删除
|
|
|
- customMenu.SetMenuBinding(3, ApplicationCommands.Delete);
|
|
|
- //颜色
|
|
|
- customMenu.SetMenuBinding(4, AnnotColorPalette_MenuCommand);
|
|
|
- //线段样式
|
|
|
- bool IsSolid = true;
|
|
|
- if (sender as SquareAnnotArgs != null)
|
|
|
- {
|
|
|
- IsSolid = AnnotPropertyPanel.IsSolidStyle((sender as SquareAnnotArgs).LineDash);
|
|
|
- }
|
|
|
- else if(sender as CircleAnnotArgs != null)
|
|
|
- {
|
|
|
- IsSolid = AnnotPropertyPanel.IsSolidStyle((sender as CircleAnnotArgs).LineDash);
|
|
|
- }
|
|
|
- else if(sender as LineAnnotArgs != null)
|
|
|
- {
|
|
|
- IsSolid = AnnotPropertyPanel.IsSolidStyle((sender as LineAnnotArgs).LineDash);
|
|
|
- }
|
|
|
+ var popMenu = new ContextMenu();
|
|
|
+ PopMenu pop = new PopMenu(popMenu);
|
|
|
+ var menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "ShapeCopy";
|
|
|
+ menuItem.Header = "复制";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Copy);
|
|
|
|
|
|
- customMenu.SetSubMenuBinding(5, 0, ShapeLineStyle_MenuCommand, null, IsSolid);
|
|
|
- customMenu.SetSubMenuBinding(5, 1, ShapeLineStyle_MenuCommand, null, !IsSolid);
|
|
|
- //线段方向
|
|
|
- if(sender as LineAnnotArgs != null)
|
|
|
- {
|
|
|
- customMenu.SetSubMenuBinding(6, 0, ShapeLineDirect_MenuCommand ,null, true);//暂无,待确认
|
|
|
- customMenu.SetSubMenuBinding(6, 1, ShapeLineDirect_MenuCommand ,null, true);//
|
|
|
- customMenu.SetVisibilityProperty(6, true);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- customMenu.SetVisibilityProperty(6,false);
|
|
|
- }
|
|
|
- //添加笔记
|
|
|
- customMenu.SetMenuBinding(7, AnnotAddNoteText_MenuCommand);
|
|
|
- //设置当前属性为默认值
|
|
|
- customMenu.SetMenuBinding(8, AnnotDefaultValue_MenuCommand);
|
|
|
- return popMenu;
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "ShapeCut";
|
|
|
+ menuItem.Header = "剪切";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Cut);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "ShapePaste";
|
|
|
+ menuItem.Header = "粘贴";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Paste);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "ShapeDelete";
|
|
|
+ menuItem.Header = "删除";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
|
|
|
+
|
|
|
+ pop.AddItem(GetSeparator());
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "ShapeColor";
|
|
|
+ menuItem.Header = "颜色...";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "ShapeLineStyle";
|
|
|
+ menuItem.Header = "线段样式";
|
|
|
+ pop.AddItem(menuItem);
|
|
|
+
|
|
|
+ RadioButton radioButton = new RadioButton();
|
|
|
+ radioButton.Name = "ShapeSolid";
|
|
|
+ radioButton.Content = "实线";
|
|
|
+ radioButton.GroupName = "LineStyle";
|
|
|
+ radioButton.Tag = "Solid";
|
|
|
+ pop.BindingEvent(pop.AddChild("ShapeLineStyle", radioButton), ShapeLineStyle_MenuCommand);
|
|
|
+
|
|
|
+ radioButton = new RadioButton();
|
|
|
+ radioButton.Name = "ShapeDash";
|
|
|
+ radioButton.Content = "虚线";
|
|
|
+ radioButton.GroupName = "LineStyle";
|
|
|
+ radioButton.Tag = "Dash";
|
|
|
+ pop.BindingEvent(pop.AddChild("ShapeLineStyle", radioButton), ShapeLineStyle_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "ShapeDirect";
|
|
|
+ menuItem.Header = "线段方向";
|
|
|
+ pop.AddItem(menuItem);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "ShapeVer";
|
|
|
+ menuItem.Header = "垂直";
|
|
|
+ menuItem.Tag = "Ver";
|
|
|
+ pop.BindingEvent(pop.AddChild("ShapeDirect", menuItem), ShapeLineDirect_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "ShapeHor";
|
|
|
+ menuItem.Header = "横向";
|
|
|
+ menuItem.Tag = "Hor";
|
|
|
+ pop.BindingEvent(pop.AddChild("ShapeDirect", menuItem), ShapeLineDirect_MenuCommand);
|
|
|
+
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "ShapeNoteText";
|
|
|
+ menuItem.Header = "添加笔记";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), AnnotAddNoteText_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "ShapeDefault";
|
|
|
+ menuItem.Header = "设置当前属性为默认值";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), AnnotDefaultValue_MenuCommand);
|
|
|
+ ShapeAnnotPopMenu = pop;
|
|
|
}
|
|
|
|
|
|
- //链接
|
|
|
- private ContextMenu SelectLinkAnnotMenu(object sender)
|
|
|
+ /// <summary>
|
|
|
+ /// 链接
|
|
|
+ /// </summary>
|
|
|
+ private void InitSelectLinkAnnotMenu()
|
|
|
{
|
|
|
- var popMenu = App.Current.FindResource("LinkAnnotContextMenu") as ContextMenu;
|
|
|
- CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
|
|
|
- //复制
|
|
|
- customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
|
- //剪切
|
|
|
- customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
|
|
|
- //粘贴
|
|
|
- customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
|
|
|
- //删除
|
|
|
- customMenu.SetMenuBinding(3, ApplicationCommands.Delete);
|
|
|
- return popMenu;
|
|
|
+ var popMenu = new ContextMenu();
|
|
|
+ PopMenu pop = new PopMenu(popMenu);
|
|
|
+ var menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "LinkCopy";
|
|
|
+ menuItem.Header = "复制";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Copy);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "LinkCut";
|
|
|
+ menuItem.Header = "剪切";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Cut);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "LinkPaste";
|
|
|
+ menuItem.Header = "粘贴";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Paste);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "LinkDelete";
|
|
|
+ menuItem.Header = "删除";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
|
|
|
+ LinkAnnotPopMenu = pop;
|
|
|
}
|
|
|
|
|
|
- //图章、签名
|
|
|
- private ContextMenu SelectStampAnnotMenu(object sender)
|
|
|
+ /// <summary>
|
|
|
+ /// 图章、签名
|
|
|
+ /// </summary>
|
|
|
+ private void InitSelectStampAnnotMenu()
|
|
|
{
|
|
|
- var popMenu = App.Current.FindResource("StampAnnotContextMenu") as ContextMenu;
|
|
|
- CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
|
|
|
- //复制
|
|
|
- customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
|
- //剪切
|
|
|
- customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
|
|
|
- //粘贴
|
|
|
- customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
|
|
|
- //删除
|
|
|
- customMenu.SetMenuBinding(3, ApplicationCommands.Delete);
|
|
|
- //导出
|
|
|
- customMenu.SetSubMenuBinding(4, 0, StampExportPicture_MenuCommand);//
|
|
|
- customMenu.SetSubMenuBinding(4, 1, StampExportPicture_MenuCommand);//
|
|
|
- customMenu.SetSubMenuBinding(4, 2, StampExportPicture_MenuCommand);//
|
|
|
- //添加笔记
|
|
|
- customMenu.SetMenuBinding(5, AnnotAddNoteText_MenuCommand);
|
|
|
- return popMenu;
|
|
|
+ var popMenu = new ContextMenu();
|
|
|
+ PopMenu pop = new PopMenu(popMenu);
|
|
|
+ var menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StampCopy";
|
|
|
+ menuItem.Header = "复制";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Copy);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StampCut";
|
|
|
+ menuItem.Header = "剪切";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Cut);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StampPaste";
|
|
|
+ menuItem.Header = "粘贴";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Paste);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StampDelete";
|
|
|
+ menuItem.Header = "删除";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
|
|
|
+
|
|
|
+ pop.AddItem(GetSeparator());
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StampExportPicture";
|
|
|
+ menuItem.Header = "导出";
|
|
|
+ pop.AddItem(menuItem);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StampExportPNG";
|
|
|
+ menuItem.Header = "PNG";
|
|
|
+ menuItem.Tag = "PNG";
|
|
|
+ pop.BindingEvent(pop.AddChild("StampExportPicture",menuItem), StampExportPicture_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StampExportPNG";
|
|
|
+ menuItem.Header = "JPG";
|
|
|
+ menuItem.Tag = "JPG";
|
|
|
+ pop.BindingEvent(pop.AddChild("StampExportPicture", menuItem), StampExportPicture_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StampExportPNG";
|
|
|
+ menuItem.Header = "PDF";
|
|
|
+ menuItem.Tag = "PDF";
|
|
|
+ pop.BindingEvent(pop.AddChild("StampExportPicture", menuItem), StampExportPicture_MenuCommand);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "StampAddNote";
|
|
|
+ menuItem.Header = "添加笔记";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), AnnotAddNoteText_MenuCommand);
|
|
|
+
|
|
|
+ StampAnnotPopMenu = pop;
|
|
|
}
|
|
|
|
|
|
- //多选注释
|
|
|
- private ContextMenu SelectMultiAnnotMenu(object sender, bool isHightAnnot)
|
|
|
+ /// <summary>
|
|
|
+ /// 多选注释
|
|
|
+ /// </summary>
|
|
|
+ private void InitSelectMultiAnnotMenu()
|
|
|
{
|
|
|
- var popMenu = App.Current.FindResource("MultiSelectAnnotContextMenu") as ContextMenu;
|
|
|
- CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
|
|
|
- if (isHightAnnot)
|
|
|
- {
|
|
|
- customMenu.SetVisibilityProperty(0, false);
|
|
|
- customMenu.SetVisibilityProperty(1, false);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- //复制
|
|
|
- customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
|
|
|
- //剪切
|
|
|
- customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
|
|
|
- }
|
|
|
- //删除
|
|
|
- customMenu.SetMenuBinding(2, ApplicationCommands.Delete);
|
|
|
- return popMenu;
|
|
|
+ var popMenu = new ContextMenu();
|
|
|
+ PopMenu pop = new PopMenu(popMenu);
|
|
|
+ var menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "MultiCopy";
|
|
|
+ menuItem.Header = "复制";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Copy);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "MultiCut";
|
|
|
+ menuItem.Header = "剪切";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Cut);
|
|
|
+
|
|
|
+ menuItem = new MenuItem();
|
|
|
+ menuItem.Name = "MultiDelete";
|
|
|
+ menuItem.Header = "删除";
|
|
|
+ pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
|
|
|
+ MultiAnnotPopMenu = pop;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
#endregion 注释-右键菜单
|
|
|
}
|
|
|
}
|