|
@@ -1595,20 +1595,15 @@ namespace PDF_Office.ViewModels
|
|
|
//内容选择 退出
|
|
|
if (PDFViewer.MouseMode != MouseModes.PanTool)
|
|
|
{
|
|
|
- if (region.Regions.ContainsRegionWithName(ToolsBarContentRegionName))
|
|
|
+ AnnotToolContent annotToolContent = GetAnnotToolContent(out AnnotToolContentViewModel toolContentViewModel);
|
|
|
+ if (annotToolContent != null && toolContentViewModel != null)
|
|
|
{
|
|
|
- var views = region.Regions[ToolsBarContentRegionName].Views;
|
|
|
- var model = views.FirstOrDefault(q => q is AnnotToolContent);
|
|
|
- if (model is AnnotToolContent annotToolContent)
|
|
|
+ if (annotToolContent.BtnSelecttool.IsChecked == true)
|
|
|
{
|
|
|
- AnnotToolContentViewModel toolContentViewModel = annotToolContent.DataContext as AnnotToolContentViewModel;
|
|
|
- if (annotToolContent.BtnSelecttool.IsChecked == true)
|
|
|
+ if (toolContentViewModel.SnapshotEditMenuViewModel.SnapToolArgs != null)
|
|
|
{
|
|
|
- if (toolContentViewModel.SnapshotEditMenuViewModel.SnapToolArgs != null)
|
|
|
- {
|
|
|
- toolContentViewModel.SnapshotEditMenuViewModel.SnapToolArgs.ReSnapshot();
|
|
|
- annotToolContent.BtnSelecttool.IsChecked = false;
|
|
|
- }
|
|
|
+ toolContentViewModel.SnapshotEditMenuViewModel.SnapToolArgs.ReSnapshot();
|
|
|
+ annotToolContent.BtnSelecttool.IsChecked = false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1616,20 +1611,44 @@ namespace PDF_Office.ViewModels
|
|
|
}
|
|
|
if (KeyEventsHelper.IsModifierKey(ModifierKeys.Control, Key.C))
|
|
|
{
|
|
|
- if (region.Regions.ContainsRegionWithName(ToolsBarContentRegionName))
|
|
|
+ //内容选择 复制 快捷键
|
|
|
+ AnnotToolContent annotToolContent = GetAnnotToolContent(out AnnotToolContentViewModel toolContentViewModel);
|
|
|
+ if (annotToolContent != null && toolContentViewModel != null)
|
|
|
{
|
|
|
- var views = region.Regions[ToolsBarContentRegionName].Views;
|
|
|
- var model = views.FirstOrDefault(q => q is AnnotToolContent);
|
|
|
- if (model is AnnotToolContent annotToolContent)
|
|
|
+ if (annotToolContent.BtnSelecttool.IsChecked == true)
|
|
|
{
|
|
|
- AnnotToolContentViewModel toolContentViewModel = annotToolContent.DataContext as AnnotToolContentViewModel;
|
|
|
- if (annotToolContent.BtnSelecttool.IsChecked == true)
|
|
|
- {
|
|
|
- toolContentViewModel.SnapshotEditMenuViewModel.SnapCopyCommand.Execute();
|
|
|
- }
|
|
|
+ toolContentViewModel.SnapshotEditMenuViewModel.SnapCopyCommand.Execute();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if (KeyEventsHelper.IsModifierKey(ModifierKeys.Control, Key.P))
|
|
|
+ {
|
|
|
+ AnnotToolContent annotToolContent = GetAnnotToolContent(out AnnotToolContentViewModel toolContentViewModel);
|
|
|
+ if (annotToolContent != null && toolContentViewModel != null)
|
|
|
+ {
|
|
|
+ if (annotToolContent.BtnSelecttool.IsChecked == true)
|
|
|
+ {
|
|
|
+ toolContentViewModel.SnapshotEditMenuViewModel.PrintCommand.Execute();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private AnnotToolContent GetAnnotToolContent(out AnnotToolContentViewModel toolContentViewModel)
|
|
|
+ {
|
|
|
+ AnnotToolContent toolContent = null;
|
|
|
+ toolContentViewModel = null;
|
|
|
+ if (region.Regions.ContainsRegionWithName(ToolsBarContentRegionName))
|
|
|
+ {
|
|
|
+ var views = region.Regions[ToolsBarContentRegionName].Views;
|
|
|
+ var model = views.FirstOrDefault(q => q is AnnotToolContent);
|
|
|
+ if (model is AnnotToolContent annotToolContent)
|
|
|
+ {
|
|
|
+ toolContent = annotToolContent;
|
|
|
+ toolContentViewModel = annotToolContent.DataContext as AnnotToolContentViewModel;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return toolContent;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|