Browse Source

About弹窗-补充关于弹窗逻辑及文案

ZhouJieSheng 1 year ago
parent
commit
3b448322e8

+ 2 - 0
PDF Office/App.xaml.cs

@@ -587,6 +587,8 @@ namespace PDF_Master
             //新手引导弹窗
             containerRegistry.RegisterDialog<NoviceGuidDialog>(DialogNames.GuidDialog);
             containerRegistry.RegisterDialog<IAPCompareDialog>(DialogNames.IAPCompareDialog);
+            //关于弹窗
+            containerRegistry.RegisterDialog<AboutDialog>(DialogNames.AboutDialog);
 
             containerRegistry.Register<IDialogWindow, CustomControl.DialogWindow>();
 

+ 5 - 0
PDF Office/Model/DialogNames.cs

@@ -11,6 +11,11 @@ namespace PDF_Master.Model
     /// </summary>
     public static class DialogNames
     {
+        /// <summary>
+        /// 关于弹窗
+        /// </summary>
+        public static string AboutDialog = "AboutDialog";
+
         /// <summary>
         /// 付费比较表
         /// </summary>

+ 21 - 0
PDF Office/MultilingualResources/PDF Office.en.xlf

@@ -2624,6 +2624,27 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
           <source>H3 Title</source>
           <target state="new">H3 Title</target>
         </trans-unit>
+        <trans-unit id="About_Copyright" translate="yes" xml:space="preserve">
+          <source>Copyright © {0}-{1} PDF Technologies,Inc. All Rights Reserved.</source>
+          <target state="new">Copyright © {0}-{1} PDF Technologies,Inc. All Rights Reserved.</target>
+        </trans-unit>
+        <trans-unit id="About_PrivacyAgreement" translate="yes" xml:space="preserve">
+          <source>Privacy Policy</source>
+          <target state="new">Privacy Policy</target>
+        </trans-unit>
+        <trans-unit id="About_TermsOfService" translate="yes" xml:space="preserve">
+          <source>Terms of Service</source>
+          <target state="new">Terms of Service</target>
+        </trans-unit>
+        <trans-unit id="About_Version" translate="yes" xml:space="preserve">
+          <source>Version</source>
+          <target state="new">Version</target>
+        </trans-unit>
+        <trans-unit id="Powered_by_ComPDFKit" translate="yes" xml:space="preserve">
+          <source>Powered by ComPDFKit</source>
+          <target state="new">Powered by ComPDFKit</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">Powered by ComPDFKit</note>
+        </trans-unit>
       </group>
     </body>
   </file>

+ 21 - 0
PDF Office/MultilingualResources/PDF Office.zh-Hans.xlf

@@ -2624,6 +2624,27 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
           <source>H3 Title</source>
           <target state="new">H3 Title</target>
         </trans-unit>
+        <trans-unit id="About_Copyright" translate="yes" xml:space="preserve">
+          <source>Copyright © {0}-{1} PDF Technologies,Inc. All Rights Reserved.</source>
+          <target state="new">Copyright © {0}-{1} PDF Technologies,Inc. All Rights Reserved.</target>
+        </trans-unit>
+        <trans-unit id="About_PrivacyAgreement" translate="yes" xml:space="preserve">
+          <source>Privacy Policy</source>
+          <target state="new">Privacy Policy</target>
+        </trans-unit>
+        <trans-unit id="About_TermsOfService" translate="yes" xml:space="preserve">
+          <source>Terms of Service</source>
+          <target state="new">Terms of Service</target>
+        </trans-unit>
+        <trans-unit id="About_Version" translate="yes" xml:space="preserve">
+          <source>Version</source>
+          <target state="new">Version</target>
+        </trans-unit>
+        <trans-unit id="Powered_by_ComPDFKit" translate="yes" xml:space="preserve">
+          <source>Powered by ComPDFKit</source>
+          <target state="new">Powered by ComPDFKit</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">Powered by ComPDFKit</note>
+        </trans-unit>
       </group>
     </body>
   </file>

+ 21 - 0
PDF Office/MultilingualResources/PDF Office.zh-Hant.xlf

@@ -2624,6 +2624,27 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
           <source>H3 Title</source>
           <target state="new">H3 Title</target>
         </trans-unit>
+        <trans-unit id="About_Copyright" translate="yes" xml:space="preserve">
+          <source>Copyright © {0}-{1} PDF Technologies,Inc. All Rights Reserved.</source>
+          <target state="new">Copyright © {0}-{1} PDF Technologies,Inc. All Rights Reserved.</target>
+        </trans-unit>
+        <trans-unit id="About_PrivacyAgreement" translate="yes" xml:space="preserve">
+          <source>Privacy Policy</source>
+          <target state="new">Privacy Policy</target>
+        </trans-unit>
+        <trans-unit id="About_TermsOfService" translate="yes" xml:space="preserve">
+          <source>Terms of Service</source>
+          <target state="new">Terms of Service</target>
+        </trans-unit>
+        <trans-unit id="About_Version" translate="yes" xml:space="preserve">
+          <source>Version</source>
+          <target state="new">Version</target>
+        </trans-unit>
+        <trans-unit id="Powered_by_ComPDFKit" translate="yes" xml:space="preserve">
+          <source>Powered by ComPDFKit</source>
+          <target state="new">Powered by ComPDFKit</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">Powered by ComPDFKit</note>
+        </trans-unit>
       </group>
     </body>
   </file>

+ 7 - 0
PDF Office/PDF Master.csproj

@@ -726,6 +726,9 @@
     <Compile Include="Views\BottomToolContent.xaml.cs">
       <DependentUpon>BottomToolContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\AboutDialog.xaml.cs">
+      <DependentUpon>AboutDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\BOTA\AddAnnotationDialog.xaml.cs">
       <DependentUpon>AddAnnotationDialog.xaml</DependentUpon>
     </Compile>
@@ -1486,6 +1489,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\AboutDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\BOTA\AddAnnotationDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 46 - 1
PDF Office/Strings/MainPage/MainPage.Designer.cs

@@ -19,7 +19,7 @@ namespace PDF_Master.Strings.MainPage {
     // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
     // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
     // (以 /str 作为命令选项),或重新生成 VS 项目。
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
     public class MainPage {
@@ -60,6 +60,42 @@ namespace PDF_Master.Strings.MainPage {
             }
         }
         
+        /// <summary>
+        ///   查找类似 Copyright © {0}-{1} PDF Technologies,Inc. All Rights Reserved. 的本地化字符串。
+        /// </summary>
+        public static string About_Copyright {
+            get {
+                return ResourceManager.GetString("About_Copyright", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Privacy Policy 的本地化字符串。
+        /// </summary>
+        public static string About_PrivacyAgreement {
+            get {
+                return ResourceManager.GetString("About_PrivacyAgreement", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Terms of Service 的本地化字符串。
+        /// </summary>
+        public static string About_TermsOfService {
+            get {
+                return ResourceManager.GetString("About_TermsOfService", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 Version 的本地化字符串。
+        /// </summary>
+        public static string About_Version {
+            get {
+                return ResourceManager.GetString("About_Version", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   查找类似 Failed to import annotations 的本地化字符串。
         /// </summary>
@@ -1678,6 +1714,15 @@ namespace PDF_Master.Strings.MainPage {
             }
         }
         
+        /// <summary>
+        ///   查找类似 Powered by ComPDFKit 的本地化字符串。
+        /// </summary>
+        public static string Powered_by_ComPDFKit {
+            get {
+                return ResourceManager.GetString("Powered_by_ComPDFKit", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   查找类似 B1 Normal Text (Standard) 的本地化字符串。
         /// </summary>

+ 16 - 0
PDF Office/Strings/MainPage/MainPage.resx

@@ -117,6 +117,18 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <data name="About_Copyright" xml:space="preserve">
+    <value>Copyright © {0}-{1} PDF Technologies,Inc. All Rights Reserved.</value>
+  </data>
+  <data name="About_PrivacyAgreement" xml:space="preserve">
+    <value>Privacy Policy</value>
+  </data>
+  <data name="About_TermsOfService" xml:space="preserve">
+    <value>Terms of Service</value>
+  </data>
+  <data name="About_Version" xml:space="preserve">
+    <value>Version</value>
+  </data>
   <data name="Annotation-Circle" xml:space="preserve">
     <value>Circle</value>
   </data>
@@ -708,6 +720,10 @@ Drag files to reorder as you need.</value>
     <value>Recently Used</value>
     <comment>调色板-最近使用的颜色</comment>
   </data>
+  <data name="Powered_by_ComPDFKit" xml:space="preserve">
+    <value>Powered by ComPDFKit</value>
+    <comment>Powered by ComPDFKit</comment>
+  </data>
   <data name="PresetTextStyle_B1NormalTextStandard" xml:space="preserve">
     <value>B1 Normal Text (Standard)</value>
   </data>

+ 8 - 0
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -747,6 +747,8 @@ namespace PDF_Master.ViewModels
 
         public DelegateCommand SettingsCommand { get; set; }
 
+        public DelegateCommand AboutDialogCommmand { get; set; }
+
         public DelegateCommand ShareCommand { get; set; }
 
         public DelegateCommand<object> CreateLinkCommand { get; set; }
@@ -845,6 +847,7 @@ namespace PDF_Master.ViewModels
             CreateBlankFileCommand = new DelegateCommand(createBlankFile);
             CreateFromFile = new DelegateCommand(createfromFile);
             OpenPropertyCommand = new DelegateCommand<object>(openProperty);
+            AboutDialogCommmand = new DelegateCommand(about);
 
             ViwerRegionName = RegionNames.ViwerRegionName;
             SplitViewerRegionName = RegionNames.Viewer_SplitRegionName;
@@ -912,6 +915,11 @@ namespace PDF_Master.ViewModels
             StartAutoSave();
         }
 
+        private void about()
+        {
+            dialogs.ShowDialog(DialogNames.AboutDialog);
+        }
+
         private void doublepage()
         {
             bottom?.DoublePageCommand.Execute();

File diff suppressed because it is too large
+ 112 - 0
PDF Office/Views/Dialog/AboutDialog.xaml


+ 99 - 0
PDF Office/Views/Dialog/AboutDialog.xaml.cs

@@ -0,0 +1,99 @@
+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
+{
+    /// <summary>
+    /// AboutDialog.xaml 的交互逻辑
+    /// 因为本窗体仅用于纯展示功能,逻辑较少,因此没有额外写VM文件
+    /// 采用简单的形式处理
+    /// </summary>
+    public partial class AboutDialog : UserControl, IDialogAware
+    {
+        public AboutDialog()
+        {
+            InitializeComponent();
+            this.DataContext = this;
+
+            //正式版本不显示后缀
+            string test = "";
+#if DEBUG 
+            test = "_Test";
+#endif
+            TbVersion.Text = App.MainPageLoader.GetString("About_Version") + " " + App.Version + test;
+
+            TbTitle.Text = App.Name;
+            //初始化多语文案
+            SetLangText();
+        }
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 框架行为
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+            
+        }
+
+        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;
+                }
+            }
+        }
+    }
+}

+ 4 - 2
PDF Office/Views/ViewContent.xaml

@@ -299,7 +299,7 @@
                                 InputGestureText="Ctrl+P" />
                             <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
                             <MenuItem Command="{Binding SettingsCommand}" Header="Settings" />
-                            <MenuItem Header="Check Update" Click="MenuItem_Click"/>
+
                             <MenuItem Header="Help">
                                 <MenuItem
                                     Command="{Binding HelpCommand}"
@@ -333,6 +333,8 @@
                                     CommandParameter="FeedBack"
                                     Header="Feedback" />
                             </MenuItem>
+                            <MenuItem Click="MenuItem_Click" Header="Check Update" />
+                            <MenuItem Command="{Binding AboutDialogCommmand}" Header="About" />
                         </ContextMenu>
                     </Button.ContextMenu>
                 </Button>
@@ -491,7 +493,7 @@
                         Height="40"
                         Header="编辑"
                         Style="{StaticResource ToolbarTabs}"
-                        Visibility="Collapsed">
+                        Visibility="Visible">
                         <Grid Grid.Row="1" Height="40" />
                     </cus:IconAndTextTabItem>
                     <cus:IconAndTextTabItem