diff --git a/STranslate/STranslate.csproj b/STranslate/STranslate.csproj
index 39f86b1..a9504f9 100644
--- a/STranslate/STranslate.csproj
+++ b/STranslate/STranslate.csproj
@@ -104,6 +104,10 @@
+
+ Designer
+ MSBuild:Compile
+
MSBuild:Compile
Designer
@@ -112,6 +116,9 @@
App.xaml
Code
+
+ Loading.xaml
+
MainWindow.xaml
Code
diff --git a/STranslate/View/Loading.xaml b/STranslate/View/Loading.xaml
new file mode 100644
index 0000000..107929a
--- /dev/null
+++ b/STranslate/View/Loading.xaml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
diff --git a/STranslate/View/Loading.xaml.cs b/STranslate/View/Loading.xaml.cs
new file mode 100644
index 0000000..3c4bb12
--- /dev/null
+++ b/STranslate/View/Loading.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace STranslate.View
+{
+ ///
+ /// Loading.xaml 的交互逻辑
+ ///
+ public partial class Loading : UserControl
+ {
+ public Loading()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/STranslate/View/MainWindow.xaml b/STranslate/View/MainWindow.xaml
index 612c4fa..d459f27 100644
--- a/STranslate/View/MainWindow.xaml
+++ b/STranslate/View/MainWindow.xaml
@@ -37,6 +37,122 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -163,41 +279,47 @@
-
-
+
+
+
+
+
-
-
+
-
-
-
-
-
-
+
+
+
+
diff --git a/STranslate/ViewModel/MainVM.cs b/STranslate/ViewModel/MainVM.cs
index 5cda315..45aeb2d 100644
--- a/STranslate/ViewModel/MainVM.cs
+++ b/STranslate/ViewModel/MainVM.cs
@@ -182,6 +182,7 @@ namespace STranslate.ViewModel
}
public void InputTranslate()
{
+ IsExpanded = false;
ClearAll();
OpenMainWin();
}
@@ -300,9 +301,11 @@ namespace STranslate.ViewModel
{
try
{
+ IsLoading = true;
+
var isEng = string.Empty;
IdentifyLanguage = string.Empty;
- OutputTxt = "翻译中...";
+ //OutputTxt = "翻译中...";
//清空多种复制
SnakeRet = string.Empty;
SmallHumpRet = string.Empty;
@@ -323,12 +326,13 @@ namespace STranslate.ViewModel
//百度 Api
//var translateResp = await TranslateUtil.TranslateBaiduAsync(config.baidu.appid, config.baidu.secretKey, InputTxt, LanguageEnumDict[OutputComboSelected], LanguageEnumDict[InputComboSelected]);
-
+ IsLoading = false;
if (translateResp == string.Empty)
{
OutputTxt = "翻译出错,请稍候再试...";
return;
}
+ IsExpanded = true;
OutputTxt = translateResp;
//如果目标语言不是英文则不进行转换
@@ -403,6 +407,12 @@ namespace STranslate.ViewModel
///
private ConfigModel _GlobalConfig;
+ private bool _IsExpanded;
+ public bool IsExpanded { get => _IsExpanded; set => UpdateProperty(ref _IsExpanded, value); }
+
+ private bool _IsLoading = true;
+ public bool IsLoading { get => _IsLoading; set => UpdateProperty(ref _IsLoading, value); }
+
///
/// 识别语种
///