Quellcode durchsuchen

AI翻译-UI添加复制提示,提示控件调整添加关闭逻辑

liyijie vor 1 Jahr
Ursprung
Commit
d97d9919a9

+ 3 - 0
PDF Office/CustomControl/ToastControl.xaml.cs

@@ -82,6 +82,9 @@ namespace PDF_Master.CustomControl
 
         private void DoubleAnimation_Completed(object sender, EventArgs e)
         {
+            //缺少关闭逻辑导致没有及时关闭动画,显示看起来比较卡顿
+            this.BeginAnimation(UserControl.OpacityProperty, null);
+
             this.Visibility = Visibility.Collapsed;
             this.Opacity = 1;
         }

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

@@ -99,6 +99,16 @@ namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
             }
         }
 
+        private string T_copied;
+
+        public string T_Copied
+        {
+            get { return T_copied; }
+            set
+            {
+                SetProperty(ref T_copied, value);
+            }
+        }
 
         private void InitString()
         {
@@ -109,6 +119,7 @@ namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
             T_Copy = App.HomePageLoader.GetString("ChatGTPAI_Copy");
             T_Result = App.HomePageLoader.GetString("ChatGTPAI_Result");
             T_TranslationBtn = App.HomePageLoader.GetString("ViewRightMenuText_AITranslationBtn");
+            T_Copied = App.HomePageLoader.GetString("ChatGTPAI_Copied");
         }
         #endregion
 
@@ -209,6 +220,19 @@ namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
             }
         }
 
+        private Visibility showTip = Visibility.Collapsed;
+        public Visibility ShowTip
+        {
+            get
+            {
+                return showTip;
+            }
+            set
+            {
+                SetProperty(ref showTip, value);
+            }
+        }
+
         private string fromlanguage = "";
 
         private string tolanguage = "";
@@ -371,6 +395,7 @@ namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
             try
             {
                 System.Windows.Forms.Clipboard.SetText(TranslateText);
+                ShowTip = Visibility.Visible;
             }
             catch { }
 

Datei-Diff unterdrückt, da er zu groß ist
+ 18 - 1
PDF Office/Views/Dialog/ChatGPTAIDialogs/SelectedTranslationDialog.xaml