liyijie 1 éve
szülő
commit
88e91f693e
36 módosított fájl, 1093 hozzáadás és 36 törlés
  1. 15 2
      PDF Office/App.xaml.cs
  2. 6 1
      PDF Office/Model/DialogNames.cs
  3. 2 0
      PDF Office/Model/ParameterNames.cs
  4. 59 0
      PDF Office/PDF Master.csproj
  5. BIN
      PDF Office/Resources/HomeTools/ChatGPTTranslation.png
  6. BIN
      PDF Office/Resources/HomeTools/Translation.png
  7. BIN
      PDF Office/Resources/HomeTools/add_files.png
  8. 40 0
      PDF Office/ViewModels/Dialog/ChatGPTAIDialogs/DocumentaryTranslationDialogViewModel.cs
  9. 34 0
      PDF Office/ViewModels/Dialog/ChatGPTAIDialogs/SelectedTranslationDialogViewModel.cs
  10. 16 6
      PDF Office/ViewModels/HomeContentViewModel.cs
  11. 16 0
      PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAIErrorCorrectionContentViewModel.cs
  12. 16 0
      PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAIRewritingContentViewModel.cs
  13. 16 0
      PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAITranslationContentViewModel.cs
  14. 49 0
      PDF Office/ViewModels/HomePanel/HomeChatGPTAIContentViewModel.cs
  15. 38 21
      PDF Office/ViewModels/HomePanel/HomeGuidContentViewModel.cs
  16. 92 0
      PDF Office/ViewModels/HomePanel/PDFTools/HomeFilesContentViewModel.cs
  17. 20 1
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Layout.cs
  18. 11 1
      PDF Office/ViewModels/ViewContentViewModel.cs
  19. 97 0
      PDF Office/Views/Dialog/ChatGPTAIDialogs/DocumentaryTranslationDialog.xaml
  20. 15 0
      PDF Office/Views/Dialog/ChatGPTAIDialogs/DocumentaryTranslationDialog.xaml.cs
  21. 81 0
      PDF Office/Views/Dialog/ChatGPTAIDialogs/SelectedTranslationDialog.xaml
  22. 15 0
      PDF Office/Views/Dialog/ChatGPTAIDialogs/SelectedTranslationDialog.xaml.cs
  23. 63 1
      PDF Office/Views/HomeContent.xaml
  24. 57 0
      PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAIErrorCorrectionContent.xaml
  25. 15 0
      PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAIErrorCorrectionContent.xaml.cs
  26. 57 0
      PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAIRewritingContent.xaml
  27. 15 0
      PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAIRewritingContent.xaml.cs
  28. 81 0
      PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAITranslationContent.xaml
  29. 15 0
      PDF Office/Views/HomePanel/ChatGPTAI/ChatGPTAITranslationContent.xaml.cs
  30. 17 0
      PDF Office/Views/HomePanel/HomeChatGPTAIContent.xaml
  31. 15 0
      PDF Office/Views/HomePanel/HomeChatGPTAIContent.xaml.cs
  32. 4 1
      PDF Office/Views/HomePanel/HomeGuidContent.xaml
  33. 2 1
      PDF Office/Views/HomePanel/HomeGuidContent.xaml.cs
  34. 88 0
      PDF Office/Views/HomePanel/PDFTools/HomeFilesContent.xaml
  35. 15 0
      PDF Office/Views/HomePanel/PDFTools/HomeFilesContent.xaml.cs
  36. 11 1
      PDF Office/Views/ViewContent.xaml

+ 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>();
@@ -660,7 +668,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;
@@ -222,5 +223,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";

+ 59 - 0
PDF Office/PDF Master.csproj

@@ -517,6 +517,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" />
@@ -614,6 +619,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" />
@@ -632,6 +638,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" />
@@ -735,6 +742,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>
@@ -1057,6 +1070,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>
@@ -1111,12 +1133,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>
@@ -1501,6 +1529,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>
@@ -1873,6 +1909,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>
@@ -1936,6 +1984,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>
@@ -2275,6 +2331,9 @@
     <Resource Include="Resources\Service\edit.png" />
     <Resource Include="Resources\Service\more.png" />
     <Resource Include="Resources\Service\page-edit.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
PDF Office/Resources/HomeTools/ChatGPTTranslation.png


BIN
PDF Office/Resources/HomeTools/Translation.png


BIN
PDF Office/Resources/HomeTools/add_files.png


+ 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)
+        {
+
+        }
+    }
+}

+ 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);

+ 11 - 1
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -785,6 +785,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 +908,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 +1883,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();

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 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();
+        }
+    }
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 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();
+        }
+    }
+}

+ 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();
+        }
+    }
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 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();
-        }
+        }
+
     }
 }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 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();
+        }
+    }
+}

+ 11 - 1
PDF Office/Views/ViewContent.xaml

@@ -433,6 +433,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}"
@@ -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"