Procházet zdrojové kódy

Merge branch 'dev' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into dev

# Conflicts:
#	PDF Office/PDF Master.csproj
lvle před 1 rokem
rodič
revize
ceeb322dd0
48 změnil soubory, kde provedl 1197 přidání a 110 odebrání
  1. 1 1
      PDF Office/App.xaml
  2. 15 2
      PDF Office/App.xaml.cs
  3. 6 1
      PDF Office/Model/DialogNames.cs
  4. 2 0
      PDF Office/Model/ParameterNames.cs
  5. 2 2
      PDF Office/MultilingualResources/PDF Office.en.xlf
  6. 2 2
      PDF Office/MultilingualResources/PDF Office.zh-Hans.xlf
  7. 2 2
      PDF Office/MultilingualResources/PDF Office.zh-Hant.xlf
  8. 59 0
      PDF Office/PDF Master.csproj
  9. binární
      PDF Office/Resources/HomeTools/ChatGPTTranslation.png
  10. binární
      PDF Office/Resources/HomeTools/Translation.png
  11. binární
      PDF Office/Resources/HomeTools/add_files.png
  12. 1 1
      PDF Office/Strings/MainPage/MainPage.Designer.cs
  13. 1 1
      PDF Office/Strings/MainPage/MainPage.resx
  14. 1 0
      PDF Office/Styles/ButtonStyle.xaml
  15. 40 0
      PDF Office/ViewModels/Dialog/ChatGPTAIDialogs/DocumentaryTranslationDialogViewModel.cs
  16. 34 0
      PDF Office/ViewModels/Dialog/ChatGPTAIDialogs/SelectedTranslationDialogViewModel.cs
  17. 16 6
      PDF Office/ViewModels/HomeContentViewModel.cs
  18. 16 0
      PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAIErrorCorrectionContentViewModel.cs
  19. 16 0
      PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAIRewritingContentViewModel.cs
  20. 16 0
      PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAITranslationContentViewModel.cs
  21. 49 0
      PDF Office/ViewModels/HomePanel/HomeChatGPTAIContentViewModel.cs
  22. 38 21
      PDF Office/ViewModels/HomePanel/HomeGuidContentViewModel.cs
  23. 92 0
      PDF Office/ViewModels/HomePanel/PDFTools/HomeFilesContentViewModel.cs
  24. 49 30
      PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs
  25. 20 1
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Layout.cs
  26. 19 2
      PDF Office/ViewModels/ViewContentViewModel.cs
  27. 97 0
      PDF Office/Views/Dialog/ChatGPTAIDialogs/DocumentaryTranslationDialog.xaml
  28. 15 0
      PDF Office/Views/Dialog/ChatGPTAIDialogs/DocumentaryTranslationDialog.xaml.cs
  29. 81 0
      PDF Office/Views/Dialog/ChatGPTAIDialogs/SelectedTranslationDialog.xaml
  30. 15 0
      PDF Office/Views/Dialog/ChatGPTAIDialogs/SelectedTranslationDialog.xaml.cs
  31. 4 4
      PDF Office/Views/Dialog/PageEditDialogs/InsertDialog.xaml
  32. 3 3
      PDF Office/Views/Dialog/PageEditDialogs/SplitDialog.xaml
  33. 63 1
      PDF Office/Views/HomeContent.xaml
  34. 57 0
      PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAIErrorCorrectionContent.xaml
  35. 15 0
      PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAIErrorCorrectionContent.xaml.cs
  36. 57 0
      PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAIRewritingContent.xaml
  37. 15 0
      PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAIRewritingContent.xaml.cs
  38. 81 0
      PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAITranslationContent.xaml
  39. 15 0
      PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAITranslationContent.xaml.cs
  40. 17 0
      PDF Office/Views/HomePanel/HomeChatGPTAIContent.xaml
  41. 15 0
      PDF Office/Views/HomePanel/HomeChatGPTAIContent.xaml.cs
  42. 4 1
      PDF Office/Views/HomePanel/HomeGuidContent.xaml
  43. 2 1
      PDF Office/Views/HomePanel/HomeGuidContent.xaml.cs
  44. 88 0
      PDF Office/Views/HomePanel/PDFTools/HomeFilesContent.xaml
  45. 15 0
      PDF Office/Views/HomePanel/PDFTools/HomeFilesContent.xaml.cs
  46. 12 6
      PDF Office/Views/HomePanel/RecentFiles/RecentFilesContent.xaml
  47. 14 4
      PDF Office/Views/ViewContent.xaml
  48. 15 18
      PDF Office/Views/ViewContent.xaml.cs

+ 1 - 1
PDF Office/App.xaml

@@ -707,7 +707,7 @@
                             Padding="0"
                             VerticalAlignment="Center"
                             IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
-                            PlaceholderText="1,3-5"
+                            PlaceholderText="eg.1,3-5,10"
                             ShowClose="False"
                             Style="{StaticResource InnerTextBox}" />
                     </Border>

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

@@ -72,7 +72,10 @@ using Prism.Services.Dialogs;
 using NetSparkleUpdater;
 using NetSparkleUpdater.SignatureVerifiers;
 using System.Threading;
-
+using PDF_Master.Views.HomePanel.PDFTools;
+using PDF_Master.Views.HomePanel.ChatGPTAI;
+using PDF_Master.Views.Dialog.ChatGPTAIDialogs;
+
 namespace PDF_Master
 {
     /// <summary>
@@ -470,6 +473,11 @@ namespace PDF_Master
             containerRegistry.RegisterForNavigation<HomeCloudContent>("Cloud");
             containerRegistry.RegisterForNavigation<HomeToolsContent>("Tools");
             containerRegistry.RegisterForNavigation<HomeGuidContent>("Guid");
+            containerRegistry.RegisterForNavigation<HomeFilesContent>();
+            containerRegistry.RegisterForNavigation<HomeChatGPTAIContent>();
+            containerRegistry.RegisterForNavigation<ChatGPTAITranslationContent>();
+            containerRegistry.RegisterForNavigation<ChatGPTAIRewritingContent>();
+            containerRegistry.RegisterForNavigation<ChatGPTAIErrorCorrectionContent>();
             containerRegistry.RegisterForNavigation<BOTAContent>();
             containerRegistry.RegisterForNavigation<PropertyPanelContent>();
             containerRegistry.RegisterForNavigation<PageEditContent>();
@@ -663,7 +671,12 @@ namespace PDF_Master
             //关于弹窗
             containerRegistry.RegisterDialog<AboutDialog>(DialogNames.AboutDialog);
 
-            containerRegistry.Register<IDialogWindow, CustomControl.DialogWindow>();
+            containerRegistry.Register<IDialogWindow, CustomControl.DialogWindow>();
+
+            //chatgtp
+            containerRegistry.RegisterDialog<DocumentaryTranslationDialog>(DialogNames.DocumentaryTranslation);
+            containerRegistry.RegisterDialog<SelectedTranslationDialog>(DialogNames.SelectedTranslation);
+            
 
             #endregion 注册弹窗
         }

+ 6 - 1
PDF Office/Model/DialogNames.cs

@@ -1,4 +1,5 @@
-using System;
+using PDF_Master.Views.Dialog.ChatGPTAIDialogs;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -236,5 +237,9 @@ namespace PDF_Master.Model
         public static string PageMarkDialog = "PageMarkDialog";
 
         public static string RepeatMarkDialog = "RepeatMarkDialog";
+
+        public static string DocumentaryTranslation = "DocumentaryTranslationDialog";
+
+        public static string SelectedTranslation = "SelectedTranslationDialog";
     }
 }

+ 2 - 0
PDF Office/Model/ParameterNames.cs

@@ -24,6 +24,8 @@ namespace PDF_Master.Model
         public static string ViewModularContentViewModel = "ViewModularContentViewModel";
         public static string PDFViewer = "PDFViewer";
 
+        public static string HomeContentViewModel = "HomeContentViewModel";
+
         public static string FilePath = "FilePath";
 
         public static string PassWord = "PassWord";

+ 2 - 2
PDF Office/MultilingualResources/PDF Office.en.xlf

@@ -2109,8 +2109,8 @@ table</target>
           <target state="new">Reset All</target>
         </trans-unit>
         <trans-unit id="WritableComboBox_CustomRangeEge" translate="yes" xml:space="preserve">
-          <source>ege :  1,3-5,10</source>
-          <target state="new">ege :  1,3-5,10</target>
+          <source>eg.1,3-5,10</source>
+          <target state="new">eg.1,3-5,10</target>
         </trans-unit>
         <trans-unit id="ViewRightMenuAnnot_AddNote" translate="yes" xml:space="preserve">
           <source>Note</source>

+ 2 - 2
PDF Office/MultilingualResources/PDF Office.zh-Hans.xlf

@@ -2109,8 +2109,8 @@ table</target>
           <target state="new">Reset All</target>
         </trans-unit>
         <trans-unit id="WritableComboBox_CustomRangeEge" translate="yes" xml:space="preserve">
-          <source>ege :  1,3-5,10</source>
-          <target state="new">ege :  1,3-5,10</target>
+          <source>eg.1,3-5,10</source>
+          <target state="new">eg.1,3-5,10</target>
         </trans-unit>
         <trans-unit id="ViewRightMenuAnnot_AddNote" translate="yes" xml:space="preserve">
           <source>Note</source>

+ 2 - 2
PDF Office/MultilingualResources/PDF Office.zh-Hant.xlf

@@ -2109,8 +2109,8 @@ table</target>
           <target state="new">Reset All</target>
         </trans-unit>
         <trans-unit id="WritableComboBox_CustomRangeEge" translate="yes" xml:space="preserve">
-          <source>ege :  1,3-5,10</source>
-          <target state="new">ege :  1,3-5,10</target>
+          <source>eg.1,3-5,10</source>
+          <target state="new">eg.1,3-5,10</target>
         </trans-unit>
         <trans-unit id="ViewRightMenuAnnot_AddNote" translate="yes" xml:space="preserve">
           <source>Note</source>

+ 59 - 0
PDF Office/PDF Master.csproj

@@ -516,6 +516,11 @@
       <DesignTime>True</DesignTime>
       <DependentUpon>Service.resx</DependentUpon>
     </Compile>
+    <Compile Include="ViewModels\Dialog\ChatGPTAIDialogs\DocumentaryTranslationDialogViewModel.cs" />
+    <Compile Include="ViewModels\HomePanel\PDFTools\HomeFilesContentViewModel.cs" />
+    <Compile Include="ViewModels\HomePanel\ChatGPTAI\ChatGPTAIErrorCorrectionContentViewModel.cs" />
+    <Compile Include="ViewModels\HomePanel\ChatGPTAI\ChatGPTAIRewritingContentViewModel.cs" />
+    <Compile Include="ViewModels\HomePanel\ChatGPTAI\ChatGPTAITranslationContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\CreateFromHtmlDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\CreateFromScannerDialogsViewModel.cs" />
     <Compile Include="ViewModels\Dialog\NoviceGuidDialogViewModel.cs" />
@@ -613,6 +618,7 @@
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkTemplateListBaseContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkTemplateListFileContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkTemplateListTextContentViewModel.cs" />
+    <Compile Include="ViewModels\HomePanel\HomeChatGPTAIContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\PDFTools\PDFToolsContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\PDFTools\QuickToolsContentViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SignatureAnnotPropertyViewModel.cs" />
@@ -631,6 +637,7 @@
     <Compile Include="ViewModels\Dialog\DynamicPropertyDialogViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\ViewModular\PageContentViewModel.cs" />
     <Compile Include="ViewModels\Scan\ScanViwerViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\ChatGPTAIDialogs\SelectedTranslationDialogViewModel.cs" />
     <Compile Include="ViewModels\TipContent\FileRestrictedTipViewModel.cs" />
     <Compile Include="ViewModels\TipContent\LinkAnnotTipViewModel.cs" />
     <Compile Include="ViewModels\TipContent\RemoveSecuritySuccessTipViewModel.cs" />
@@ -734,6 +741,12 @@
     <Compile Include="Views\Dialog\BOTA\ScreenAnnotationDialog.xaml.cs">
       <DependentUpon>ScreenAnnotationDialog.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\ChatGPTAIDialogs\DocumentaryTranslationDialog.xaml.cs">
+      <DependentUpon>DocumentaryTranslationDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\ChatGPTAIDialogs\SelectedTranslationDialog.xaml.cs">
+      <DependentUpon>SelectedTranslationDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\ConverterDialogs\ConverterCSVDialog.xaml.cs">
       <DependentUpon>ConverterCSVDialog.xaml</DependentUpon>
     </Compile>
@@ -1062,6 +1075,15 @@
     <Compile Include="Views\Form\TextFieldProperty.xaml.cs">
       <DependentUpon>TextFieldProperty.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\HomePanel\ChatGPTAI\ChatGPTAIErrorCorrectionContent.xaml.cs">
+      <DependentUpon>ChatGPTAIErrorCorrectionContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\HomePanel\ChatGPTAI\ChatGPTAIRewritingContent.xaml.cs">
+      <DependentUpon>ChatGPTAIRewritingContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\HomePanel\ChatGPTAI\ChatGPTAITranslationContent.xaml.cs">
+      <DependentUpon>ChatGPTAITranslationContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\HomePanel\CloudDrive\CloudDriveContent.xaml.cs">
       <DependentUpon>CloudDriveContent.xaml</DependentUpon>
     </Compile>
@@ -1116,12 +1138,18 @@
     <Compile Include="Views\HomePanel\CloudDrive\CloudFilesContent.xaml.cs">
       <DependentUpon>CloudFilesContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\HomePanel\HomeChatGPTAIContent.xaml.cs">
+      <DependentUpon>HomeChatGPTAIContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\HomePanel\HomeCloudContent.xaml.cs">
       <DependentUpon>HomeCloudContent.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\HomePanel\HomeGuidContent.xaml.cs">
       <DependentUpon>HomeGuidContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\HomePanel\PDFTools\HomeFilesContent.xaml.cs">
+      <DependentUpon>HomeFilesContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\HomePanel\PDFTools\PDFToolExpendItem.xaml.cs">
       <DependentUpon>PDFToolExpendItem.xaml</DependentUpon>
     </Compile>
@@ -1506,6 +1534,14 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\ChatGPTAIDialogs\DocumentaryTranslationDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\ChatGPTAIDialogs\SelectedTranslationDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\ConverterDialogs\ConverterCSVDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1886,6 +1922,18 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\HomePanel\ChatGPTAI\ChatGPTAIErrorCorrectionContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\HomePanel\ChatGPTAI\ChatGPTAIRewritingContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\HomePanel\ChatGPTAI\ChatGPTAITranslationContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\HomePanel\CloudDrive\CloudDriveContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1949,6 +1997,14 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="Views\HomePanel\HomeChatGPTAIContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\HomePanel\PDFTools\HomeFilesContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\HomePanel\PDFTools\PDFToolExpendItem.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -2291,6 +2347,9 @@
     <Resource Include="Resources\Service\Cheer.png" />
     <Resource Include="Resources\Service\NewRegiserok.png" />
     <Resource Include="Resources\Service\NoWatermark.png" />
+    <Resource Include="Resources\HomeTools\add_files.png" />
+    <Resource Include="Resources\HomeTools\Translation.png" />
+    <Resource Include="Resources\HomeTools\ChatGPTTranslation.png" />
     <Content Include="source\models\OCR.model">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>

binární
PDF Office/Resources/HomeTools/ChatGPTTranslation.png


binární
PDF Office/Resources/HomeTools/Translation.png


binární
PDF Office/Resources/HomeTools/add_files.png


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

@@ -4471,7 +4471,7 @@ namespace PDF_Master.Strings.MainPage {
         }
         
         /// <summary>
-        ///   查找类似 ege :  1,3-5,10 的本地化字符串。
+        ///   查找类似 eg.1,3-5,10 的本地化字符串。
         /// </summary>
         public static string WritableComboBox_CustomRangeEge {
             get {

+ 1 - 1
PDF Office/Strings/MainPage/MainPage.resx

@@ -1672,7 +1672,7 @@ Some functions may not work, please restart or re-download PDF Reader Pro from o
     <value>Custom Range</value>
   </data>
   <data name="WritableComboBox_CustomRangeEge" xml:space="preserve">
-    <value>ege :  1,3-5,10</value>
+    <value>eg.1,3-5,10</value>
   </data>
   <data name="WritableComboBox_EvenPage" xml:space="preserve">
     <value>Even Pages</value>

+ 1 - 0
PDF Office/Styles/ButtonStyle.xaml

@@ -169,6 +169,7 @@
                         Background="{TemplateBinding Background}"
                         BorderBrush="{TemplateBinding BorderBrush}"
                         BorderThickness="{TemplateBinding BorderThickness}"
+                        CornerRadius="4"
                         SnapsToDevicePixels="true">
                         <ContentPresenter
                             x:Name="contentPresenter"

+ 40 - 0
PDF Office/ViewModels/Dialog/ChatGPTAIDialogs/DocumentaryTranslationDialogViewModel.cs

@@ -0,0 +1,40 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
+{
+    public class DocumentaryTranslationDialogViewModel : BindableBase, IDialogAware
+    {
+        public DelegateCommand CancelCommand { get; set; }
+        public DocumentaryTranslationDialogViewModel()
+        {
+            CancelCommand = new DelegateCommand(cancel);
+        }
+
+        private void cancel()
+        {
+            RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
+        }
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+        }
+    }
+}

+ 34 - 0
PDF Office/ViewModels/Dialog/ChatGPTAIDialogs/SelectedTranslationDialogViewModel.cs

@@ -0,0 +1,34 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
+{
+    public class SelectedTranslationDialogViewModel : BindableBase, IDialogAware
+    {
+        public SelectedTranslationDialogViewModel()
+        {
+
+        }
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+        }
+    }
+}

+ 16 - 6
PDF Office/ViewModels/HomeContentViewModel.cs

@@ -1,4 +1,5 @@
-using Microsoft.Win32;
+using ComPDFKitViewer.PdfViewer;
+using Microsoft.Win32;
 using PDF_Master.CustomControl;
 using PDF_Master.EventAggregators;
 using PDF_Master.Helper;
@@ -134,7 +135,15 @@ namespace PDF_Master.ViewModels
         /// <param name="view"></param>
         public void ShowToolContent(string view)
         {
-            toolregion.RequestNavigate(ToolRegionName, view);
+            NavigationParameters param = new NavigationParameters();
+            param.Add(ParameterNames.HomeContentViewModel, this);
+            if (view.Contains("ChatGPT")) { 
+                param.Add(ParameterNames.Tag, view);
+                toolregion.RequestNavigate(ToolRegionName, "HomeChatGPTAIContent", param);
+                return;
+            }
+            
+            toolregion.RequestNavigate(ToolRegionName, view, param);
         }
 
         /// <summary>
@@ -210,7 +219,7 @@ namespace PDF_Master.ViewModels
         /// <summary>
         /// 从其他格式文件创建PDF
         /// </summary>
-        private async void createFromOtherFile()
+        public async void createFromOtherFile()
         {
             string txt = Properties.Resources.txtex;
             string word = Properties.Resources.wordex;
@@ -285,7 +294,7 @@ namespace PDF_Master.ViewModels
         /// <summary>
         /// 从扫描仪创建
         /// </summary>
-        private async void createFromScanner(string args)
+        public async void createFromScanner(string args)
         {
             dialog.ShowDialog(DialogNames.CreateFromScannerDialogs, async e =>
             {
@@ -377,8 +386,9 @@ namespace PDF_Master.ViewModels
                 mainContentViewModel = mainVM;
                 mainContentViewModel.homeContentViewModel = this;
             }
-
-            toolregion.RequestNavigate(ToolRegionName, "Guid");
+            NavigationParameters param = new NavigationParameters();
+            param.Add(ParameterNames.HomeContentViewModel, this);
+            toolregion.RequestNavigate(ToolRegionName, "Guid", param);
         }
 
         public bool IsNavigationTarget(NavigationContext navigationContext)

+ 16 - 0
PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAIErrorCorrectionContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
+{
+    public class ChatGPTAIErrorCorrectionContentViewModel : BindableBase
+    {
+        public ChatGPTAIErrorCorrectionContentViewModel()
+        {
+
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAIRewritingContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
+{
+    public class ChatGPTAIRewritingContentViewModel : BindableBase
+    {
+        public ChatGPTAIRewritingContentViewModel()
+        {
+
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAITranslationContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
+{
+    public class ChatGPTAITranslationContentViewModel : BindableBase
+    {
+        public ChatGPTAITranslationContentViewModel()
+        {
+
+        }
+    }
+}

+ 49 - 0
PDF Office/ViewModels/HomePanel/HomeChatGPTAIContentViewModel.cs

@@ -0,0 +1,49 @@
+using PDF_Master.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Windows.Controls;
+
+namespace PDF_Master.ViewModels.HomePanel
+{
+    public class HomeChatGPTAIContentViewModel : BindableBase, INavigationAware
+    {
+        public string RegionName = "";
+
+        private string chatGPTAIRegionName;
+
+        public string ChatGPTAIRegionName
+        {
+            get { return chatGPTAIRegionName; }
+            set { SetProperty(ref chatGPTAIRegionName, value); }
+        }
+
+        public IRegionManager region;
+
+        public HomeChatGPTAIContentViewModel(IRegionManager regionManager)
+        {
+            region=regionManager;
+            ChatGPTAIRegionName = Guid.NewGuid().ToString();
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            navigationContext.Parameters.TryGetValue<string>(ParameterNames.Tag, out RegionName);
+           
+            region.RequestNavigate(ChatGPTAIRegionName, RegionName);
+            
+        }
+    }
+}

+ 38 - 21
PDF Office/ViewModels/HomePanel/HomeGuidContentViewModel.cs

@@ -1,33 +1,50 @@
-using ComPDFKit.PDFDocument;
-using ComPDFKitViewer.PdfViewer;
-using PDF_Master.CustomControl;
-using PDF_Master.Helper;
-using PDF_Master.Model;
-using PDF_Master.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
-using PDF_Master.Model.PDFTool;
-using PDF_Master.Views.HomePanel.PDFTools;
-using PDFSettings;
-using Prism.Commands;
+using PDF_Master.Model;
 using Prism.Mvvm;
-using Prism.Services.Dialogs;
+using Prism.Regions;
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-using System.Xml.Linq;
+using System.Windows.Controls;
 
 namespace PDF_Master.ViewModels.HomePanel
 {
-    public class HomeGuidContentViewModel : BindableBase
+    public class HomeGuidContentViewModel : BindableBase, INavigationAware
     {
         //Todo:首页快捷工具Command事件,已写在HomePanel/PDFTools/QuickToolsContentViewModel.cs里面了
-        public HomeGuidContentViewModel()
+        HomeContentViewModel homeContentViewModel = null;
+
+        private string homeToolRegionName;
+
+        public string HomeToolRegionName
+        {
+            get { return homeToolRegionName; }
+            set { SetProperty(ref homeToolRegionName, value); }
+        }
+
+        public IRegionManager toolregion;
+
+        public HomeGuidContentViewModel(IRegionManager regionManager)
+        {
+            toolregion = regionManager;
+            HomeToolRegionName = Guid.NewGuid().ToString();
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
         {
-          
-          
+            return true;
         }
 
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            navigationContext.Parameters.TryGetValue<HomeContentViewModel>(ParameterNames.HomeContentViewModel, out homeContentViewModel);
+            if (homeContentViewModel != null)
+            {
+                NavigationParameters param = new NavigationParameters();
+                param.Add(ParameterNames.HomeContentViewModel, homeContentViewModel);
+                toolregion.RequestNavigate(HomeToolRegionName, "HomeFilesContent", param);
+            }
+        }
     }
 }

+ 92 - 0
PDF Office/ViewModels/HomePanel/PDFTools/HomeFilesContentViewModel.cs

@@ -0,0 +1,92 @@
+using Microsoft.Win32;
+using PDF_Master.Helper;
+using PDF_Master.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Master.ViewModels.HomePanel.PDFTools
+{
+    public class HomeFilesContentViewModel : BindableBase, INavigationAware
+    {
+        HomeContentViewModel homeContentViewModel = null;
+        public DelegateCommand OpenFileCommand { get; set; }
+
+        public DelegateCommand CreateBlackPDFCommand { get; set; }
+
+        public DelegateCommand CreateFromOtherFile { get; set; }
+
+        public DelegateCommand<string> CreateFromScanner { get; set; }
+
+        public HomeFilesContentViewModel()
+        {
+            OpenFileCommand = new DelegateCommand(OpenFile);
+            CreateBlackPDFCommand = new DelegateCommand(CreatBlankPDF);
+            CreateFromOtherFile = new DelegateCommand(createFromOtherFile);
+            CreateFromScanner = new DelegateCommand<string>(createFromScanner);
+        }
+
+        /// <summary>
+        /// 从扫描仪创建
+        /// </summary>
+        private async void createFromScanner(string args)
+        {
+
+            if (homeContentViewModel != null)
+            {
+                homeContentViewModel.createFromScanner("");
+            }
+        }
+
+        /// <summary>
+        /// 打开文件
+        /// </summary>
+        public async void OpenFile()
+        {
+            if (homeContentViewModel != null)
+            {
+                homeContentViewModel.OpenFile();
+            }
+        }
+
+        /// <summary>
+        /// 创建空白文档
+        /// </summary>
+        public void CreatBlankPDF()
+        {
+            if (homeContentViewModel != null)
+            {
+                homeContentViewModel.CreatBlankPDF();
+            }
+        }
+
+        /// <summary>
+        /// 从其他格式文件创建PDF
+        /// </summary>
+        private async void createFromOtherFile()
+        {
+            if (homeContentViewModel != null)
+            {
+                homeContentViewModel.createFromOtherFile();
+            }
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            navigationContext.Parameters.TryGetValue<HomeContentViewModel>(ParameterNames.HomeContentViewModel, out homeContentViewModel);
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+
+        }
+    }
+}

+ 49 - 30
PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs

@@ -107,6 +107,7 @@ namespace PDF_Master.ViewModels.PageEdit
 
         public CPDFViewer PDFViewer;
 
+        public PageEditItem CurrentPageEditItem = null;
         public ViewContentViewModel viewContentViewModel;
 
         private IDialogService dialogs;
@@ -2059,7 +2060,7 @@ namespace PDF_Master.ViewModels.PageEdit
                     selectedfile = "";
                     CPDFDocument saveDoc1 = CPDFDocument.CreateDocument();
                     //string filepath = data.FileName + " " + "1.pdf";
-                    filename = GetFileName(data, 1);
+                    filename = GetFileName(data, 0);
                     string path1 = Path.Combine(directory, filename);
                     path1 = CommonHelper.CreateFilePath(path1);
                     bool result = saveDoc1.ImportPages(pdfViewer.Document, pageRange);
@@ -2081,36 +2082,38 @@ namespace PDF_Master.ViewModels.PageEdit
 
                     #endregion 方案一 //part1
 
-                    #region 方案二 //Part2
-
-                    //List<int> pageList2 = new List<int>();
-                    //for (int i = 1; i <= pdfViewer.Document.PageCount; i++)
-                    //{
-                    //    if (!pageList1.Contains(i - 1))//pagelist1 存放的是index
-                    //        pageList2.Add(i);
-                    //}
-                    //string pageRange2 = string.Join(",", pageList2);
-                    //CPDFDocument saveDoc2 = CPDFDocument.CreateDocument();
-                    //string filepath2 = data.FileName + " " + "2.pdf";
-                    //string path2 = Path.Combine(dialog.SelectedPath, filepath2);
-                    //path2 = CommonHelper.CreateFilePath(path2);
-                    //bool result1 = saveDoc2.ImportPages(pdfViewer.Document, pageRange2);
-                    //if (!result1)
-                    //{
-                    //    saveDoc2.Release();
-                    //    ShowToast();
-                    //    return;
-                    //}
-                    //result1 = saveDoc2.WriteToFilePath(path2);
-                    //if (!result1)
-                    //{
-                    //    saveDoc2.Release();
-                    //    ShowToast();
-                    //    return;
-                    //}
-                    //saveDoc2.Release();
-                    //selectedfile = path2;
+                    #region 方案二 //Part2 奇数页、偶数页需要拆分成两个
+                    if (data.PageMode == HomePageSplitDialogModel.PageRangeMode.OddPage || data.PageMode == HomePageSplitDialogModel.PageRangeMode.EvenPage)
+                    {
 
+                        List<int> pageList2 = new List<int>();
+                        for (int i = 1; i <= pdfViewer.Document.PageCount; i++)
+                        {
+                            if (!pageList1.Contains(i - 1))//pagelist1 存放的是index
+                                pageList2.Add(i);
+                        }
+                        string pageRange2 = string.Join(",", pageList2);
+                        CPDFDocument saveDoc2 = CPDFDocument.CreateDocument();
+                        string filepath2 = /*data.FileName + " " + "2.pdf";*/ GetFileName(data, 1);
+                        string path2 = /*Path.Combine(dialog.SelectedPath, filepath2);*/Path.Combine(directory, filepath2);
+                        path2 = CommonHelper.CreateFilePath(path2);
+                        bool result1 = saveDoc2.ImportPages(pdfViewer.Document, pageRange2);
+                        if (!result1)
+                        {
+                            saveDoc2.Release();
+                            ShowToast();
+                            return;
+                        }
+                        result1 = saveDoc2.WriteToFilePath(path2);
+                        if (!result1)
+                        {
+                            saveDoc2.Release();
+                            ShowToast();
+                            return;
+                        }
+                        saveDoc2.Release();
+                        selectedfile = path2;
+                    }
                     #endregion 方案二 //Part2
                 }
                 //显示文件夹,并选中一个文件
@@ -2337,6 +2340,12 @@ namespace PDF_Master.ViewModels.PageEdit
             if (needRefreshPageNum)
             {
                 RefreshPageNum();
+
+                //从页面编辑退出的值,根据内容走,进页面编辑是这一页内容,退出来还是
+                if (CurrentPageEditItem != null)
+                {
+                    PDFViewer.GoToPage(CurrentPageEditItem.PageNumber-1);
+                }
             }
             if (needClearUndoHistory)
             {
@@ -2859,6 +2868,7 @@ namespace PDF_Master.ViewModels.PageEdit
             {
                 PDFViewer.GoToPage(targetindex);
             }
+
             return true;
         }
 
@@ -2957,6 +2967,15 @@ namespace PDF_Master.ViewModels.PageEdit
                 isFirstLoad = false;
 
                 Initializing = false;
+
+                if (PageEditItems.Count > 0)
+                {
+                    if (PageEditItems.IndexOf(PageEditItems[PDFViewer.CurrentIndex]) > -1)
+                    {
+                        //记录 进页面编辑是这一页内容
+                        CurrentPageEditItem = PageEditItems[PDFViewer.CurrentIndex];
+                    }
+                }
             }
         }
 

+ 20 - 1
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Layout.cs

@@ -5,10 +5,14 @@ using ComPDFKitViewer.PdfViewer;
 using PDF_Master.CustomControl;
 using PDF_Master.CustomControl.CompositeControl;
 using PDF_Master.Helper;
+using PDF_Master.Model;
 using PDF_Master.Model.PropertyPanel.AnnotPanel;
+using PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs;
+using PDF_Master.Views.Dialog.ChatGPTAIDialogs;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Regions;
+using Prism.Services.Dialogs;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -480,17 +484,32 @@ namespace PDF_Master.ViewModels.Tools
             {
                 SetSelectTextOrImageMenuItem(T_RightMenuSelectionAddOutline, "OutLine", annotCommand, out menuItem);
                 popMenu.Items.Add(menuItem);
+                SetSelectTextOrImageMenuItem("AI Translation", "Translation", annotCommand, out menuItem);
+                popMenu.Items.Add(menuItem);
             }
 
             return popMenu;
         }
 
+
+        private void MenuTranslate_Click(object sender, RoutedEventArgs eventArgs)
+        {
+            string selectedText = PDFViewer.GetSelectedText();
+            DialogParameters printValue = new DialogParameters();
+            printValue.Add(ParameterNames.PDFViewer, PDFViewer);
+            dialogs.ShowDialog(DialogNames.SelectedTranslation, printValue, e => { });
+        }
+
         private void SetSelectTextOrImageMenuItem(string header, string tag, AnnotCommandArgs annotCommand, out MenuItem menuItem)
         {
             menuItem = new MenuItem();
             menuItem.Header = header;
             menuItem.Tag = tag;
-
+            if (tag == "Translation") {
+                menuItem.Click -= MenuTranslate_Click;
+                menuItem.Click += MenuTranslate_Click;
+                return;
+            }
             if (tag == "OutLine" || tag == "Link")
             {
                 InBookModeSetIsHidden(menuItem);

+ 19 - 2
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -639,6 +639,12 @@ namespace PDF_Master.ViewModels
             }
         }
 
+
+        /// <summary>
+        /// 定义BOTA展开后的最小宽度,小于等于该宽度时无法再缩小宽度,再往左边拖动便是收起BOTA
+        /// </summary>
+        public double BOTAMiniWidth = 260;
+
         private GridLength botaWidth = new GridLength(48);
 
         /// <summary>
@@ -684,13 +690,14 @@ namespace PDF_Master.ViewModels
                 SetProperty(ref openBOTA, value);
                 if (openBOTA && BOTAWidth.Value <= 48)
                 {
-                    BOTAWidth = new GridLength(260);
+                    BOTAWidth = new GridLength(BOTAMiniWidth);
                 }
                 Settings.Default.AppProperties.InitialVIew.RememberBOTA = openBOTA;
                 //关闭BOTA的逻辑在xaml.cs代码里控制,无法绑定后台
             }
         }
 
+
         public SecurityInfo SecurityInfo = new SecurityInfo();
 
         private Dictionary<string, string> regionNameByTabItem;
@@ -785,6 +792,8 @@ namespace PDF_Master.ViewModels
         public DelegateCommand RedoCommand { get; set; }
         public DelegateCommand<object> MenuEnterReadMode { get; set; }
 
+        public DelegateCommand AITranslationCommand { get; set; }
+
         public DelegateCommand PrintCommand { get; set; }
 
         public DelegateCommand SelectCommand { get; set; }
@@ -906,6 +915,7 @@ namespace PDF_Master.ViewModels
             ReadModeRegionName = RegionNames.ReadModeRegionName;
             MenuEnterReadMode = new DelegateCommand<object>(MenuEnterReadModeEvent);
 
+            AITranslationCommand = new DelegateCommand(ShowAITranslationDialog);
             PrintCommand = new DelegateCommand(ShowPrintDialog);
 
             SelectCommand = new DelegateCommand(SelectClick);
@@ -1880,7 +1890,14 @@ namespace PDF_Master.ViewModels
         private void MenuEnterReadModeEvent(object obj)
         {
         }
-
+        public void ShowAITranslationDialog() {
+            DialogParameters printValue = new DialogParameters();
+            printValue.Add(ParameterNames.PDFViewer, PDFViewer);
+            printValue.Add(ParameterNames.FilePath, PDFViewer.Document.FileName);
+            printValue.Add(ParameterNames.PrintCurrentPage, PDFViewer.CurrentIndex);
+            printValue.Add(ParameterNames.Unicode, unicode);
+            dialogs.ShowDialog(DialogNames.DocumentaryTranslation, printValue, e => { });
+        }
         public void ShowPrintDialog()
         {
             DialogParameters printValue = new DialogParameters();

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 97 - 0
PDF Office/Views/Dialog/ChatGPTAIDialogs/DocumentaryTranslationDialog.xaml


+ 15 - 0
PDF Office/Views/Dialog/ChatGPTAIDialogs/DocumentaryTranslationDialog.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Master.Views.Dialog.ChatGPTAIDialogs
+{
+    /// <summary>
+    /// Interaction logic for DocumentaryTranslationContent
+    /// </summary>
+    public partial class DocumentaryTranslationDialog : UserControl
+    {
+        public DocumentaryTranslationDialog()
+        {
+            InitializeComponent();
+        }
+    }
+}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 81 - 0
PDF Office/Views/Dialog/ChatGPTAIDialogs/SelectedTranslationDialog.xaml


+ 15 - 0
PDF Office/Views/Dialog/ChatGPTAIDialogs/SelectedTranslationDialog.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Master.Views.Dialog.ChatGPTAIDialogs
+{
+    /// <summary>
+    /// Interaction logic for SelectedTranslationContent
+    /// </summary>
+    public partial class SelectedTranslationDialog : UserControl
+    {
+        public SelectedTranslationDialog()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 4 - 4
PDF Office/Views/Dialog/PageEditDialogs/InsertDialog.xaml

@@ -12,9 +12,9 @@
     xmlns:pageeditdialogs="clr-namespace:PDF_Master.ViewModels.Dialog.PageEditDialogs"
     xmlns:prism="http://prismlibrary.com/"
     Width="468"
-    Height="350"
+    Height="358"
     d:DataContext="{d:DesignInstance Type=pageeditdialogs:InsertDialogViewModel}"
-    d:DesignHeight="350"
+    d:DesignHeight="358"
     d:DesignWidth="468"
     prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
     prism:ViewModelLocator.AutoWireViewModel="True"
@@ -122,7 +122,7 @@
                         </ItemsPanelTemplate>
                     </ListBox.ItemsPanel>
                 </ListBox>
-                <StackPanel Grid.Row="0" Margin="16,0,16,10">
+                <StackPanel Grid.Row="0" Margin="16,5,16,12">
                     <TextBlock
                         FontFamily="Segoe UI"
                         FontSize="12"
@@ -207,7 +207,7 @@
                             VerticalAlignment="Center"
                             FontFamily="Segoe UI"
                             FontSize="14"
-                            Text="X" />
+                            Text="X" Margin="5,0" />
                         <!--<TextBox
                         Width="80"
                         Height="32"

+ 3 - 3
PDF Office/Views/Dialog/PageEditDialogs/SplitDialog.xaml

@@ -8,10 +8,10 @@
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:pageeditdialogs="clr-namespace:PDF_Master.ViewModels.Dialog.PageEditDialogs"
     xmlns:prism="http://prismlibrary.com/"
-    Width="480"
-    Height="460"
+    Width="468"
+    Height="464"
     d:DataContext="{d:DesignInstance Type=pageeditdialogs:SplitDialogViewModel}"
-    d:DesignHeight="480"
+    d:DesignHeight="464"
     d:DesignWidth="468"
     prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
     prism:ViewModelLocator.AutoWireViewModel="True"

+ 63 - 1
PDF Office/Views/HomeContent.xaml

@@ -59,6 +59,68 @@
         <!--  左侧菜单栏  -->
         <StackPanel>
             <Button
+                x:Name="Home"
+                Height="40"
+                Margin="32,32,32,0"
+                Command="{Binding ShowToolCommand}"
+                CommandParameter="Guid"
+                Foreground="#FFFFFF"
+                Style="{StaticResource btn.brand}">
+                <StackPanel Orientation="Horizontal">
+                    <TextBlock
+                        VerticalAlignment="Center"
+                        FontFamily="Segoe UI"
+                        FontSize="16"
+                        Text="Home" />
+                </StackPanel>
+            </Button>
+            <Button
+                Height="40"
+                Margin="32,32,32,0"
+                Command="{Binding ShowToolCommand}"
+                CommandParameter="ChatGPTAITranslationContent"
+                Foreground="#FFFFFF"
+                Style="{StaticResource btn.brand}">
+                <StackPanel Orientation="Horizontal">
+                    <TextBlock
+                        VerticalAlignment="Center"
+                        FontFamily="Segoe UI"
+                        FontSize="16"
+                        Text="AI Translation" />
+                </StackPanel>
+            </Button>
+            <Button
+                Height="40"
+                Margin="32,32,32,0"
+                Command="{Binding ShowToolCommand}"
+                CommandParameter="ChatGPTAIRewritingContent"
+                Foreground="#FFFFFF"
+                Style="{StaticResource btn.brand}">
+                <StackPanel Orientation="Horizontal">
+                    <TextBlock
+                        VerticalAlignment="Center"
+                        FontFamily="Segoe UI"
+                        FontSize="16"
+                        Text="AI Rewriting" />
+                </StackPanel>
+            </Button>
+            <Button
+                Height="40"
+                Margin="32,32,32,0"
+                Command="{Binding ShowToolCommand}"
+                CommandParameter="ChatGPTAIErrorCorrectionContent"
+                Foreground="#FFFFFF"
+                Style="{StaticResource btn.brand}">
+                <StackPanel Orientation="Horizontal">
+                    <TextBlock
+                        VerticalAlignment="Center"
+                        FontFamily="Segoe UI"
+                        FontSize="16"
+                        Text="AI Error Correction" />
+                </StackPanel>
+            </Button>
+            <Button
+                Visibility="Collapsed"
                 x:Name="BtnOpenPDF"
                 Height="40"
                 Margin="32,32,32,0"
@@ -75,7 +137,7 @@
                 </StackPanel>
             </Button>
 
-            <Grid Margin="32,16,32,24">
+            <Grid Margin="32,16,32,24"  Visibility="Collapsed">
                 <Button
                     x:Name="BtnCreatPDF"
                     Height="40"

+ 57 - 0
PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAIErrorCorrectionContent.xaml

@@ -0,0 +1,57 @@
+<UserControl x:Class="PDF_Master.Views.HomePanel.ChatGPTAI.ChatGPTAIErrorCorrectionContent"
+            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:PDF_Master.Views.HomePanel.ChatGPTAI"
+      xmlns:converter="clr-namespace:PDF_Master.DataConvert"
+      xmlns:prism ="http://prismlibrary.com/"
+      prism:ViewModelLocator.AutoWireViewModel="True"
+      Background="White"  MinWidth="540" MinHeight="460"
+      mc:Ignorable="d"  
+      d:DesignHeight="760" d:DesignWidth="1032"
+     >
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="*" />
+            <RowDefinition Height="*" />
+        </Grid.RowDefinitions>
+        <StackPanel Grid.Row="0">
+            <Grid  Width="968">
+                <StackPanel HorizontalAlignment="Left">
+                    <TextBlock Text="AI Error Correction" FontFamily="Segoe UI"
+            FontSize="20"
+            FontWeight="Bold"
+            Foreground="{StaticResource color.sys.text.neutral.lv1}" Height="28" HorizontalAlignment="Left"></TextBlock>
+                    <TextBlock
+                    HorizontalAlignment="Center"
+                    FontFamily="Segoe UI"
+                    FontSize="14"
+                    Foreground="#94989C"
+                    Text="Limited to 150 characters per session, 5 times per month"
+                    TextAlignment="Center"
+                        TextWrapping="Wrap"
+                        />
+                </StackPanel>
+                <Button HorizontalAlignment="Right" Width="104" Height="32" Content="Rewrite" VerticalAlignment="Bottom" Style="{StaticResource Btn.cta}"></Button>
+            </Grid>
+            <Grid Width="968" Height="260" Margin="0,12,0,0">
+                <TextBox Name="textBoxEnterCharacters" Width="968" Height="260" >
+                </TextBox>
+                <TextBlock Text="{Binding ElementName=textBoxEnterCharacters,Path=Text.Length,StringFormat={}{0:/150}}" Panel.ZIndex="1" Height="22" FontSize="14" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,12,8"/>
+            </Grid>
+        </StackPanel>
+        <StackPanel Grid.Row="1">
+            <Grid Width="968">
+                <TextBlock Text="Result" FontFamily="Segoe UI"
+            FontSize="20"
+            FontWeight="Bold"
+            Foreground="{StaticResource color.sys.text.neutral.lv1}" Height="28" HorizontalAlignment="Left"></TextBlock>
+                <Button HorizontalAlignment="Right" Width="104" Height="32" Content="Copy" Background="White"></Button>
+            </Grid>
+            <TextBox Width="968" Height="260" Margin="0,12,0,0">
+
+            </TextBox>
+        </StackPanel>
+    </Grid>
+</UserControl>

+ 15 - 0
PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAIErrorCorrectionContent.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Master.Views.HomePanel.ChatGPTAI
+{
+    /// <summary>
+    /// Interaction logic for ChatGPTAIErrorCorrectionContent
+    /// </summary>
+    public partial class ChatGPTAIErrorCorrectionContent : UserControl
+    {
+        public ChatGPTAIErrorCorrectionContent()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 57 - 0
PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAIRewritingContent.xaml

@@ -0,0 +1,57 @@
+<UserControl x:Class="PDF_Master.Views.HomePanel.ChatGPTAI.ChatGPTAIRewritingContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:PDF_Master.Views.HomePanel.ChatGPTAI"
+      xmlns:converter="clr-namespace:PDF_Master.DataConvert"
+      xmlns:prism ="http://prismlibrary.com/"
+      prism:ViewModelLocator.AutoWireViewModel="True"
+      Background="White"  MinWidth="540" MinHeight="460"
+      mc:Ignorable="d"  
+      d:DesignHeight="760" d:DesignWidth="1032"
+     >
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="*" />
+            <RowDefinition Height="*" />
+        </Grid.RowDefinitions>
+        <StackPanel Grid.Row="0">
+            <Grid  Width="968">
+                <StackPanel HorizontalAlignment="Left">
+                    <TextBlock Text="AI Rewriting" FontFamily="Segoe UI"
+            FontSize="20"
+            FontWeight="Bold"
+            Foreground="{StaticResource color.sys.text.neutral.lv1}" Height="28" HorizontalAlignment="Left"></TextBlock>
+                    <TextBlock
+                    HorizontalAlignment="Center"
+                    FontFamily="Segoe UI"
+                    FontSize="14"
+                    Foreground="#94989C"
+                    Text="Limited to 150 characters per session, 5 times per month"
+                    TextAlignment="Center"
+                        TextWrapping="Wrap"
+                        />
+                </StackPanel>
+                <Button HorizontalAlignment="Right" Width="104" Height="32" Content="Rewrite" VerticalAlignment="Bottom" Style="{StaticResource Btn.cta}"></Button>
+            </Grid>
+            <Grid Width="968" Height="260" Margin="0,12,0,0">
+                <TextBox Name="textBoxEnterCharacters" Width="968" Height="260" >
+                </TextBox>
+                <TextBlock Text="{Binding ElementName=textBoxEnterCharacters,Path=Text.Length,StringFormat={}{0:/150}}" Panel.ZIndex="1" Height="22" FontSize="14" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,12,8"/>
+            </Grid>
+        </StackPanel>
+        <StackPanel Grid.Row="1">
+            <Grid Width="968">
+                <TextBlock Text="Result" FontFamily="Segoe UI"
+            FontSize="20"
+            FontWeight="Bold"
+            Foreground="{StaticResource color.sys.text.neutral.lv1}" Height="28" HorizontalAlignment="Left"></TextBlock>
+                <Button HorizontalAlignment="Right" Width="104" Height="32" Content="Copy" Background="White"></Button>
+            </Grid>
+            <TextBox Width="968" Height="260" Margin="0,12,0,0">
+
+            </TextBox>
+        </StackPanel>
+    </Grid>
+</UserControl>

+ 15 - 0
PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAIRewritingContent.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Master.Views.HomePanel.ChatGPTAI
+{
+    /// <summary>
+    /// Interaction logic for ChatGPTAIRewritingContent
+    /// </summary>
+    public partial class ChatGPTAIRewritingContent : UserControl
+    {
+        public ChatGPTAIRewritingContent()
+        {
+            InitializeComponent();
+        }
+    }
+}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 81 - 0
PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAITranslationContent.xaml


+ 15 - 0
PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAITranslationContent.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Master.Views.HomePanel.ChatGPTAI
+{
+    /// <summary>
+    /// Interaction logic for ChatGPTAITranslationContent
+    /// </summary>
+    public partial class ChatGPTAITranslationContent : UserControl
+    {
+        public ChatGPTAITranslationContent()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 17 - 0
PDF Office/Views/HomePanel/HomeChatGPTAIContent.xaml

@@ -0,0 +1,17 @@
+<UserControl x:Class="PDF_Master.Views.HomePanel.HomeChatGPTAIContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:PDF_Master.Views.HomePanel"
+             xmlns:prism ="http://prismlibrary.com/"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             xmlns:pDFTools="clr-namespace:PDF_Master.Views.HomePanel.PDFTools"
+             Background="White"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <Grid>
+        <ContentControl
+            prism:RegionManager.RegionName="{Binding ChatGPTAIRegionName}" Margin="32"/>
+    </Grid>
+</UserControl>

+ 15 - 0
PDF Office/Views/HomePanel/HomeChatGPTAIContent.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Master.Views.HomePanel
+{
+    /// <summary>
+    /// Interaction logic for HomeChatGPTAIContent
+    /// </summary>
+    public partial class HomeChatGPTAIContent : UserControl
+    {
+        public HomeChatGPTAIContent()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 4 - 1
PDF Office/Views/HomePanel/HomeGuidContent.xaml

@@ -23,7 +23,10 @@
                     <RowDefinition Height="Auto" />
                     <RowDefinition />
                 </Grid.RowDefinitions>
-                <pDFTools:QuickToolsContent x:Name="hometool" Margin="32" />
+                <!--快捷工具
+                <pDFTools:QuickToolsContent x:Name="hometool" Margin="32" />-->
+                <ContentControl
+            prism:RegionManager.RegionName="{Binding HomeToolRegionName}" Margin="32"/>
                 <recentFiles:RecentFilesContent
                     x:Name="Recentlist"
                     Grid.Row="1"

+ 2 - 1
PDF Office/Views/HomePanel/HomeGuidContent.xaml.cs

@@ -10,6 +10,7 @@ namespace PDF_Master.Views.HomePanel
         public HomeGuidContent()
         {
             InitializeComponent();
-        }
+        }
+
     }
 }

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 88 - 0
PDF Office/Views/HomePanel/PDFTools/HomeFilesContent.xaml


+ 15 - 0
PDF Office/Views/HomePanel/PDFTools/HomeFilesContent.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Master.Views.HomePanel.PDFTools
+{
+    /// <summary>
+    /// Interaction logic for HomeFilesContent
+    /// </summary>
+    public partial class HomeFilesContent : UserControl
+    {
+        public HomeFilesContent()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 12 - 6
PDF Office/Views/HomePanel/RecentFiles/RecentFilesContent.xaml

@@ -13,8 +13,8 @@
     d:DataContext="{d:DesignInstance Type=recentfiles:RecentFilesContentViewModel}"
     d:DesignHeight="450"
     d:DesignWidth="800"
-    IsVisibleChanged="UserControl_IsVisibleChanged"
     prism:ViewModelLocator.AutoWireViewModel="True"
+    IsVisibleChanged="UserControl_IsVisibleChanged"
     KeyDown="UserControl_KeyDown"
     Loaded="UserControl_Loaded"
     mc:Ignorable="d">
@@ -278,24 +278,30 @@
 
                 <Button
                     x:Name="BtnAddFiles"
-                    Width="128"
-                    Height="128"
+                    Width="92"
+                    Height="114"
                     MaxHeight="128"
                     Background="Transparent"
                     BorderThickness="0"
                     Command="{Binding OpenFilesCommand}"
                     Foreground="#6B6F7D"
                     Style="{StaticResource OnlyContentBtn}">
-                    <Grid Width="128" Height="128">
+                    <Grid>
                         <Rectangle
                             Width="90"
-                            Height="112"
+                            Height="114"
                             RadiusX="2"
                             RadiusY="4"
                             Stroke="{StaticResource color.icon.base.neutral.norm.lv2}"
                             StrokeDashArray="6 6"
                             StrokeThickness="2" />
-                        <Path Data="M62.3333 65.6667V79H65.6667V65.6667H79V62.3333H65.6667V49H62.3333V62.3333H49V65.6667H62.3333Z" Fill="{StaticResource color.icon.base.neutral.norm.lv2}" />
+                        <Path
+                            Width="30"
+                            Height="30"
+                            HorizontalAlignment="Center"
+                            VerticalAlignment="Center"
+                            Data="M13.3333 16.6667V30H16.6667V16.6667H30V13.3333H16.6667V0H13.3333V13.3333H0V16.6667H13.3333Z"
+                            Fill="{StaticResource color.icon.base.neutral.norm.lv2}" />
                         <!--<Image
                             Width="128"
                             Height="128"

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

@@ -18,10 +18,9 @@
     DragEnter="UserControl_DragEnter"
     DragLeave="UserControl_DragLeave"
     DragOver="UserControl_DragOver"
-    PreviewDrop="UserControl_Drop"
-    IsVisibleChanged="UserControl_IsVisibleChanged"
     Loaded="UserControl_Loaded"
     MouseDown="UserControl_MouseDown"
+    PreviewDrop="UserControl_Drop"
     Unloaded="UserControl_Unloaded"
     mc:Ignorable="d">
 
@@ -179,7 +178,7 @@
     <Grid Background="{StaticResource color.sys.layout.mg}">
         <Grid.RowDefinitions>
             <RowDefinition Name="HeadRow" Height="40" />
-            <RowDefinition Name="ToolRow" Height="{Binding ToolTooRow,Mode=TwoWay}" />
+            <RowDefinition Name="ToolRow" Height="{Binding ToolTooRow, Mode=TwoWay}" />
 
             <RowDefinition Height="*" />
             <RowDefinition Height="32" />
@@ -433,6 +432,16 @@
                         Data="M13.9393 12.1L9.36972 7.53039L10.4304 6.46973L15.5303 11.5697C15.8232 11.8626 15.8232 12.3374 15.5303 12.6303L10.4304 17.7303L9.36972 16.6696L13.9393 12.1Z"
                         Fill="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}}, Path=Foreground}" />
                 </Button>
+                <Button
+                    Margin="6,0"
+                    Command="{Binding AITranslationCommand}"
+                    Style="{StaticResource subToolBar}"
+                    ToolTip="AI Translation">
+                    <Image
+                        Width="28"
+                        Height="28"
+                        Source="pack://application:,,,/PDF Master;component/Resources/HomeTools/ChatGPTTranslation.png" />
+                </Button>
                 <Button
                     Command="{Binding PrintCommand}"
                     Style="{StaticResource subToolBar}"
@@ -622,6 +631,7 @@
                     Background="Transparent"
                     Cursor="SizeWE"
                     FocusVisualStyle="{x:Null}"
+                    PreviewMouseUp="BOTASplitter_PreviewMouseUp"
                     ResizeBehavior="PreviousAndNext"
                     ShowsPreview="True" />
                 <Grid Name="GridViewer" Grid.Column="2">
@@ -717,7 +727,7 @@
             Visibility="{Binding ToolContentVisible}">
             <ContentControl Name="ContentTool" prism:RegionManager.RegionName="{Binding ToolContentRegionName}" />
         </Border>
-        <cus:LoadingControl Grid.RowSpan="3" Visibility="{Binding IsLoading}" />
+        <!--<cus:LoadingControl Grid.RowSpan="3" Visibility="{Binding IsLoading}" />-->
 
         <Rectangle
             x:Name="RectangleBota"

+ 15 - 18
PDF Office/Views/ViewContent.xaml.cs

@@ -40,7 +40,9 @@ namespace PDF_Master.Views
         /// <summary>
         /// 是否是展开工具栏
         /// </summary>
-        private bool expandToolRow = true;
+        private bool expandToolRow = true;
+
+        private bool DelayIsEnable = true;
 
         public ViewContent()
         {
@@ -64,7 +66,7 @@ namespace PDF_Master.Views
                 }
                 else
                 {
-                    BOTACloumn.MinWidth = 260;
+                    BOTACloumn.MinWidth = viewModel.BOTAMiniWidth;
                     BOTASplitter.Visibility = Visibility.Visible;
                 }
             }
@@ -204,10 +206,8 @@ namespace PDF_Master.Views
                     Grid.SetColumn(GridViewer, 0);
                 }
             }
-        }
+        }
 
-        private bool DelayIsEnable = true;
-
         /// <summary>
         /// 鼠标移动到控件范围时显示控件
         /// </summary>
@@ -573,19 +573,6 @@ namespace PDF_Master.Views
             }
         }
 
-        private void UserControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
-        {
-            //疑似无效事件,暂时注释掉,上线前确认没问题后删除
-            //if ((bool)e.NewValue)
-            //{
-            //    //显示后自动聚焦,解决切换页签或者刚打开后直接按快捷键没响应的问题
-            //    System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
-            //    {
-            //        ToolTabControl.Focus();
-            //    }));
-            //}
-        }
-
         private void AddTabCommand_Executed(object sender, ExecutedRoutedEventArgs e)
         {
             viewModel.mainViewModel.mainWindowViewModel.AddTab.Execute();
@@ -655,5 +642,15 @@ namespace PDF_Master.Views
             if (App.SparkleUpdateDetector != null)
                 App.SparkleUpdateDetector?.CheckForUpdatesAtUserRequest();
         }
+
+        private void BOTASplitter_PreviewMouseUp(object sender, MouseButtonEventArgs e)
+        {
+            if(e.GetPosition(this).X<viewModel.BOTAMiniWidth)
+            {
+                //需要拦截控件本身关于拖拽事件后的操作,才能响应关闭BOTA的逻辑
+                e.Handled = true;
+                viewModel.OpenBOTA = false;
+            }
+        }
     }
 }