|
@@ -329,20 +329,21 @@ namespace PDF_Master.ViewModels
|
|
|
|
|
|
DownCommand = new DelegateCommand(down);
|
|
|
|
|
|
- //注册成全局命令
|
|
|
- GlobalCommands.FirstPageCommand.RegisterCommand(FirstPageCommand);
|
|
|
- GlobalCommands.LastPageCommand.RegisterCommand(LastPageCommand);
|
|
|
- GlobalCommands.NextPageCommand.RegisterCommand(NextPageCommand);
|
|
|
- GlobalCommands.PrePageCommand.RegisterCommand(PrePageCommand);
|
|
|
- GlobalCommands.PreViewCommand.RegisterCommand(PreViewCommand);
|
|
|
- GlobalCommands.NextViewCommand.RegisterCommand(NextViewCommnad);
|
|
|
- GlobalCommands.UpCommand.RegisterCommand(UpCommand);
|
|
|
- GlobalCommands.DownCommand.RegisterCommand(DownCommand);
|
|
|
-
|
|
|
-
|
|
|
InitString();
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 缩放至实际大小
|
|
|
+ /// </summary>
|
|
|
+ private void ZoomToRealSize()
|
|
|
+ {
|
|
|
+ PDFViewer?.ChangeFitMode(FitMode.FitSize);
|
|
|
+ if (OpenFileInfo != null)
|
|
|
+ {
|
|
|
+ OpenFileInfo.LastFitMode = FitMode.FitSize;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void previewkeydown(object e)
|
|
|
{
|
|
|
var args = e as KeyEventArgs;
|
|
@@ -938,8 +939,24 @@ namespace PDF_Master.ViewModels
|
|
|
CurrentPage = PDFViewer.CurrentIndex + 1;
|
|
|
}
|
|
|
CurrentZoom = PDFViewer.ZoomFactor * 100;
|
|
|
- PDFViewer.InfoChanged += PDFViewer_InfoChanged;
|
|
|
+ PDFViewer.InfoChanged += PDFViewer_InfoChanged;
|
|
|
+
|
|
|
+ //注册成全局命令
|
|
|
+ GlobalCommands.FirstPageCommand.RegisterCommand(FirstPageCommand);
|
|
|
+ GlobalCommands.LastPageCommand.RegisterCommand(LastPageCommand);
|
|
|
+ GlobalCommands.NextPageCommand.RegisterCommand(NextPageCommand);
|
|
|
+ GlobalCommands.PrePageCommand.RegisterCommand(PrePageCommand);
|
|
|
+ GlobalCommands.PreViewCommand.RegisterCommand(PreViewCommand);
|
|
|
+ GlobalCommands.NextViewCommand.RegisterCommand(NextViewCommnad);
|
|
|
+ GlobalCommands.UpCommand.RegisterCommand(UpCommand);
|
|
|
+ GlobalCommands.DownCommand.RegisterCommand(DownCommand);
|
|
|
+ GlobalCommands.SinglePageCommand.RegisterCommand(new DelegateCommand(() => { IsSingleView = true; }));
|
|
|
+ GlobalCommands.DoublePageCommand.RegisterCommand(new DelegateCommand(() => { IsDoubleView = true; }));
|
|
|
+ GlobalCommands.ZoomInCommand.RegisterCommand(ZoomInCommand);
|
|
|
+ GlobalCommands.ZoomOutPageCommand.RegisterCommand(ZoomOutCommand);
|
|
|
+ GlobalCommands.RealSizeCommand.RegisterCommand(new DelegateCommand(() => { ZoomToRealSize(); }));
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public bool IsNavigationTarget(NavigationContext navigationContext)
|