using Prism.Services.Dialogs; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace PDF_Master.Views.Dialog { /// /// AboutDialog.xaml 的交互逻辑 /// 因为本窗体仅用于纯展示功能,逻辑较少,因此没有额外写VM文件 /// 采用简单的形式处理 /// public partial class AboutDialog : UserControl, IDialogAware { public AboutDialog() { InitializeComponent(); this.DataContext = this; // 补充编译时间,方便测试区分版本 var buildDate = System.IO.File.GetLastWriteTime(this.GetType().Assembly.Location).ToString("yyyy-MM-dd HH:mm"); //正式版本不显示后缀 string test = ""; #if DEBUG test = "_Test"; #endif TbVersion.Text = App.MainPageLoader.GetString("About_Version") + " " + App.Version + test+"-"+buildDate; TbTitle.Text = App.Name; //初始化多语文案 SetLangText(); } public string Title => ""; public event Action RequestClose; #region 框架行为 public bool CanCloseDialog() { return true; } public void OnDialogClosed() { RequestClose?.Invoke(new DialogResult()); } public void OnDialogOpened(IDialogParameters parameters) { } #endregion 框架行为 private void SetLangText() { TbPrivacy.Text = App.MainPageLoader.GetString("About_PrivacyAgreement"); TbService.Text = App.MainPageLoader.GetString("About_TermsOfService"); TbComPDFKit.Text = App.MainPageLoader.GetString("Powered_by_ComPDFKit"); TbCopyRight.Text = string.Format(App.MainPageLoader.GetString("About_Copyright"), 2014, 2023); } private void TbPrivacy_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { //单击文案跳转不同链接 var text = sender as TextBlock; if (text != null) { switch (text.Tag.ToString()) { case "1": //Privacy Agreement System.Diagnostics.Process.Start(@"https://www.pdfreaderpro.com/privacy-policy"); break; case "2": //Privacy Agreement System.Diagnostics.Process.Start(@"https://www.pdfreaderpro.com/terms_of_service"); break; case "3": //Powered by ComPDFKit System.Diagnostics.Process.Start(@"https://www.compdf.com?utm_source=winapp&utm_medium=pdfwin&utm_campaign=compdfkit"); break; default: break; } } } } }