|
@@ -27,6 +27,7 @@ using PDF_Office.Model.Dialog.ConverterDialogs;
|
|
|
using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySettintgsModel;
|
|
|
using PDF_Office.Views.PropertyPanel.AnnotPanel;
|
|
|
using System.Linq;
|
|
|
+using System.Text;
|
|
|
|
|
|
namespace PDF_Office.ViewModels
|
|
|
{
|
|
@@ -529,6 +530,10 @@ namespace PDF_Office.ViewModels
|
|
|
|
|
|
public DelegateCommand OpenFileCommand { get; set; }
|
|
|
|
|
|
+ public DelegateCommand<string> HelpCommand { get; set; }
|
|
|
+
|
|
|
+
|
|
|
+ public DelegateCommand CreateBlankFileCommand { get; set; }
|
|
|
#endregion 命令
|
|
|
|
|
|
public ViewContentViewModel(IRegionManager regionManager, IDialogService dialogService, IEventAggregator eventAggregator)
|
|
@@ -555,6 +560,8 @@ namespace PDF_Office.ViewModels
|
|
|
ConvertCommand = new DelegateCommand<string>(convert);
|
|
|
CloseWindowCommand = new DelegateCommand(closeWindow);
|
|
|
OpenFileCommand = new DelegateCommand(openfile);
|
|
|
+ HelpCommand = new DelegateCommand<string>(help);
|
|
|
+ CreateBlankFileCommand = new DelegateCommand(createBlankFile);
|
|
|
|
|
|
ViwerRegionName = RegionNames.ViwerRegionName;
|
|
|
SplitViewerRegionName = RegionNames.Viewer_SplitRegionName;
|
|
@@ -599,6 +606,60 @@ namespace PDF_Office.ViewModels
|
|
|
EnterSelectedBar("TabItemAnnotation");
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ ///创建空白文档
|
|
|
+ /// </summary>
|
|
|
+ private async void createBlankFile()
|
|
|
+ {
|
|
|
+ App.mainWindowViewModel.AddTab.Execute();
|
|
|
+ await Task.Delay(30);
|
|
|
+ (App.mainWindowViewModel.SelectedItem.DataContext as MainContentViewModel).CreateFile();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void help(string args)
|
|
|
+ {
|
|
|
+ string url = "";
|
|
|
+ switch (args)
|
|
|
+ {
|
|
|
+ case "Guid":
|
|
|
+ //TODO 打开内嵌文档
|
|
|
+ break;
|
|
|
+ case "Online":
|
|
|
+ url = @"https://www.pdfreaderpro.com/windows/help";
|
|
|
+ break;
|
|
|
+ case "More":
|
|
|
+ url = @"https://www.pdfreaderpro.com/product?utm_source=MacApp&utm_campaign=ProductLink&utm_medium=PdfProduct";
|
|
|
+ break;
|
|
|
+ case "Template":
|
|
|
+ url = @"https://www.pdfreaderpro.com/templates?utm_source=MacApp&utm_campaign=TemplatesLink&utm_medium=PdfTemplates";
|
|
|
+ break;
|
|
|
+ case "Blog":
|
|
|
+ //TODO:显示订阅电子报弹窗
|
|
|
+ break;
|
|
|
+ case "ComPDF":
|
|
|
+ url = @"https://www.compdf.com/?utm_source=macapp&utm_medium=pdfmac&utm_campaign=compdfkit-promp";
|
|
|
+ break;
|
|
|
+ case "FeedBack":
|
|
|
+ //调用邮箱 发送邮件
|
|
|
+ StringBuilder sr = new StringBuilder();
|
|
|
+ sr.AppendFormat("{0} - {1};{2};{3} - {4}", App.Name, App.Version, "Propose a New Feature", ServiceHelper.ComputerInfo, ServiceHelper.SystemInfo);
|
|
|
+
|
|
|
+ System.Diagnostics.Process.Start(string.Format("mailto:support@pdfreaderpro.com?subject={0}", sr));
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!string.IsNullOrEmpty(url))
|
|
|
+ {
|
|
|
+ //需要跳转网页的情况
|
|
|
+ System.Diagnostics.Process.Start(url);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 打开文件,跟首页的打开文件有区别,需要新开一个页签
|
|
|
+ /// </summary>
|
|
|
private void openfile()
|
|
|
{
|
|
|
OpenFileDialog openFileDialog = new OpenFileDialog();
|