From bfb345539c8daf6bffcb3fb00b1a3f07c80d2ac7 Mon Sep 17 00:00:00 2001 From: sunhonglei Date: Tue, 24 Dec 2024 17:29:05 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9Adialog=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.xaml | 5 +- SparkClient.csproj | 3 - ViewModel/BaseWindow/HomeWindowVM.cs | 3 +- ViewModel/Grading/GradingResultVM.cs | 9 +-- Views/Dialog/JsonImport.xaml.cs | 2 - Views/Dialog/SaveDialog.xaml | 85 ------------------------ Views/Dialog/SaveDialog.xaml.cs | 90 -------------------------- Views/Dialog/StartDialog.xaml | 85 ------------------------ Views/Dialog/StartDialog.xaml.cs | 97 ---------------------------- 9 files changed, 8 insertions(+), 371 deletions(-) delete mode 100644 Views/Dialog/SaveDialog.xaml delete mode 100644 Views/Dialog/SaveDialog.xaml.cs delete mode 100644 Views/Dialog/StartDialog.xaml delete mode 100644 Views/Dialog/StartDialog.xaml.cs diff --git a/App.xaml b/App.xaml index c815002..4591e2a 100644 --- a/App.xaml +++ b/App.xaml @@ -74,10 +74,7 @@ - - - - + diff --git a/SparkClient.csproj b/SparkClient.csproj index d8f855a..aea9449 100644 --- a/SparkClient.csproj +++ b/SparkClient.csproj @@ -215,9 +215,6 @@ Code - - Code - diff --git a/ViewModel/BaseWindow/HomeWindowVM.cs b/ViewModel/BaseWindow/HomeWindowVM.cs index 861ef88..f9043fb 100644 --- a/ViewModel/BaseWindow/HomeWindowVM.cs +++ b/ViewModel/BaseWindow/HomeWindowVM.cs @@ -1,4 +1,5 @@ -using System.Windows.Input; +using System.Windows; +using System.Windows.Input; using SparkClient.Model.Helper; using SparkClient.Model.Services; using SparkClient.ViewModel.Configuration; diff --git a/ViewModel/Grading/GradingResultVM.cs b/ViewModel/Grading/GradingResultVM.cs index 2c56aeb..3abd661 100644 --- a/ViewModel/Grading/GradingResultVM.cs +++ b/ViewModel/Grading/GradingResultVM.cs @@ -15,6 +15,7 @@ using SparkClient.Views.Dialog; using NPOI.HPSF; using Application = System.Windows.Application; using MessageBox = SparkClient.Views.Dialog.MessageBox; +using System.Windows; namespace SparkClient.ViewModel.Grading; public class GradingResultVM : BaseViewModel @@ -505,11 +506,11 @@ public class GradingResultVM : BaseViewModel if (string.IsNullOrEmpty(DiamondCode)) { MessageBox messageBox = new MessageBox(); - messageBox.ShowInput(MultilingualHelper.getString("UpdateDiamondCode"), out string inputStr, + MessageBoxResult boxResult = messageBox.ShowInput(MultilingualHelper.getString("UpdateDiamondCode"), out string inputStr, MultilingualHelper.getString("ok"), MultilingualHelper.getString("Cancel") ); - if (inputStr.Length > 0) + if (boxResult == MessageBoxResult.OK && inputStr.Length > 0) { this.DiamondCode = inputStr; } @@ -546,12 +547,12 @@ public class GradingResultVM : BaseViewModel if (string.IsNullOrEmpty(DiamondCode)) { MessageBox messageBox = new MessageBox(); - messageBox.ShowInput(MultilingualHelper.getString("UpdateDiamondCode"), out string inputStr, + MessageBoxResult boxResult = messageBox.ShowInput(MultilingualHelper.getString("UpdateDiamondCode"), out string inputStr, MultilingualHelper.getString("ok"), MultilingualHelper.getString("Cancel") ); - if (inputStr.Length > 0) + if (boxResult == MessageBoxResult.OK && inputStr.Length > 0) { this.DiamondCode = inputStr; } diff --git a/Views/Dialog/JsonImport.xaml.cs b/Views/Dialog/JsonImport.xaml.cs index 42478f9..26964b1 100644 --- a/Views/Dialog/JsonImport.xaml.cs +++ b/Views/Dialog/JsonImport.xaml.cs @@ -1,6 +1,4 @@ using HandyControl.Controls; -using Newtonsoft.Json; -using SparkClient.Model.Helper; using SparkClient.ViewModel; using SparkClient.ViewModel.Dialog; using System.IO; diff --git a/Views/Dialog/SaveDialog.xaml b/Views/Dialog/SaveDialog.xaml deleted file mode 100644 index 4f8a1e5..0000000 --- a/Views/Dialog/SaveDialog.xaml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -