diff --git a/App.xaml b/App.xaml
index 2afcda8..186e68c 100644
--- a/App.xaml
+++ b/App.xaml
@@ -1,13 +1,14 @@
@@ -21,28 +22,36 @@
-
-
+
+
-
-
+
+
-
+
+
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
+
+
+
+
+
+
+
-
diff --git a/MainWindow.xaml b/MainWindow.xaml
index 46e9de5..7835d91 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -11,13 +11,15 @@
WindowStyle="None"
ResizeMode="CanResizeWithGrip"
WindowStartupLocation="CenterScreen"
- d:DesignHeight="800"
- d:DesignWidth="1400"
+
MinHeight="400"
MinWidth="800"
Loaded="MainWindow_OnLoaded"
+ WindowState="Maximized"
Background="{DynamicResource SecondaryRegionBrush}">
+
+
diff --git a/Model/Helper/MultilingualHelper.cs b/Model/Helper/MultilingualHelper.cs
index e223a2a..1a2df88 100644
--- a/Model/Helper/MultilingualHelper.cs
+++ b/Model/Helper/MultilingualHelper.cs
@@ -8,6 +8,12 @@ namespace SparkClient.Model.Helper;
///
public class MultilingualHelper
{
+ ///
+ /// 获取多语言字符
+ ///
+ /// KEY
+ /// 文字
+ ///
public static string getString(string key)
{
var result = Application.Current.TryFindResource(key);
@@ -18,12 +24,20 @@ public class MultilingualHelper
return (string)result;
}
+ ///
+ /// 设置语言
+ ///
+ ///
public static void setLanguage(string language)
{
LoadResources(language);
ConfigHelper.Instance.SetLang(language);
}
+ ///
+ /// 加载语言配置
+ ///
+ ///
private static void LoadResources(string resourceKey)
{
// 获取当前应用程序的App实例
diff --git a/ViewModel/BaseWindow/BaseControlVM.cs b/ViewModel/BaseWindow/BaseControlVM.cs
index d127296..e457d87 100644
--- a/ViewModel/BaseWindow/BaseControlVM.cs
+++ b/ViewModel/BaseWindow/BaseControlVM.cs
@@ -21,20 +21,44 @@ public class BaseControlVM : BaseViewModel
public object Content { get; }
public ICommand CloseCommand { get; }
+ ///
+ /// 构造:创建一个带有子页面的模板,并指定子窗口标题,并指定右侧按钮事件内容
+ ///
+ /// 子页面
+ /// 子窗口标题
+ /// 事件内哦那个
+ public BaseControlVM(BaseViewModel vm, string windowTitle, ICommand Function)
+ {
+ Content = vm;
+ WindowTitle = windowTitle;
+ CloseCommand = new RelayCommand(CloseVM);
+ }
+ ///
+ /// 构造:创建一个带有子页面的模板,并指定子窗口标题
+ ///
+ /// 子页面
+ /// 子窗口标题
public BaseControlVM(BaseViewModel vm, string windowTitle)
{
Content = vm;
WindowTitle = windowTitle;
CloseCommand = new RelayCommand(CloseVM);
}
-
+ ///
+ /// 构造:创建一个带有子页面的模板
+ ///
+ ///
public BaseControlVM(BaseViewModel vm)
{
Content = vm;
CloseCommand = new RelayCommand(CloseVM);
}
-
+
+ ///
+ /// 关闭并退回至上一个页面
+ ///
+ ///
public void CloseVM(object parameter)
{
WindowManager.mainViewModel.Content = WindowManager.PreviousVM();
diff --git a/ViewModel/BaseWindow/HomeWindowVM.cs b/ViewModel/BaseWindow/HomeWindowVM.cs
index 4dfac6c..69274c9 100644
--- a/ViewModel/BaseWindow/HomeWindowVM.cs
+++ b/ViewModel/BaseWindow/HomeWindowVM.cs
@@ -4,6 +4,7 @@ using System.Windows.Input;
using HandyControl.Controls;
using SparkClient.Model.Helper;
using SparkClient.ViewModel.Configuration;
+using SparkClient.ViewModel.Grading;
namespace SparkClient.ViewModel.BaseWindow;
@@ -12,11 +13,13 @@ public class HomeWindowVM : BaseViewModel
public ICommand ShowHelperPageCommand { get; }
public ICommand ShowConfigPageCommand { get; }
+ public ICommand ShowDiamondSelPageCommand { get; }
public HomeWindowVM()
{
ShowHelperPageCommand = new RelayCommand(ShowHelperPage);
ShowConfigPageCommand = new RelayCommand(ShowConfigPage);
+ ShowDiamondSelPageCommand = new RelayCommand(ShowDiamlondSelPage);
}
public void ShowHelperPage(object parameter)
@@ -32,4 +35,11 @@ public class HomeWindowVM : BaseViewModel
WindowManager.mainViewModel.Content = vm;
WindowManager.openContent.Add(vm);
}
+
+ public void ShowDiamlondSelPage(object parameter)
+ {
+ BaseControlVM vm = new BaseControlVM(new DiamondSelectVM(), MultilingualHelper.getString("DiamondSelect"));
+ WindowManager.mainViewModel.Content = vm;
+ WindowManager.openContent.Add(vm);
+ }
}
\ No newline at end of file
diff --git a/ViewModel/BaseWindow/MainViewModel.cs b/ViewModel/BaseWindow/MainViewModel.cs
index f24ceb6..9bf1240 100644
--- a/ViewModel/BaseWindow/MainViewModel.cs
+++ b/ViewModel/BaseWindow/MainViewModel.cs
@@ -12,6 +12,9 @@ public class MainViewModel : BaseViewModel
public ICommand SetZhcnLanguage { get; }
public ICommand SetEnLanguage { get; }
+ ///
+ /// 构造
+ ///
public MainViewModel()
{
Content = new HomeWindowVM();
@@ -21,11 +24,19 @@ public class MainViewModel : BaseViewModel
SetEnLanguage = new RelayCommand(setEnLanguage);
}
+ ///
+ /// 设置语言为ZH-CN
+ ///
+ ///
public void setZhLanguage(object parameter)
{
MultilingualHelper.setLanguage("zh-cn");
}
+ ///
+ /// 设置语言为EN
+ ///
+ ///
public void setEnLanguage(object parameter)
{
MultilingualHelper.setLanguage("en");
diff --git a/ViewModel/Configuration/AlgorithmConfigVM.cs b/ViewModel/Configuration/AlgorithmConfigVM.cs
index 5726ef2..badb4ec 100644
--- a/ViewModel/Configuration/AlgorithmConfigVM.cs
+++ b/ViewModel/Configuration/AlgorithmConfigVM.cs
@@ -2,5 +2,47 @@
public class AlgorithmConfigVM : BaseViewModel
{
+
+ public AlgorithmConfigVM()
+ {
+ // 初始化VIEW层参数
+ // 初始化VIEW层Command
+ this.InitAlgorithmData(null);
+ }
+
+ ///
+ /// 初始化算法数据
+ ///
+ ///
+ public void InitAlgorithmData(object param)
+ {
+ }
+
+ ///
+ /// 添加行
+ ///
+ /// 行数
+ public void AddRows(object row)
+ {
+
+ }
+
+ ///
+ /// 保存数据
+ ///
+ ///
+ public void SaveAlgorithmData(object param)
+ {
+ }
+
+ ///
+ /// 删除一行数据
+ ///
+ /// 行
+ public void DelAlgorRow(object row)
+ {
+
+ }
+
}
\ No newline at end of file
diff --git a/ViewModel/Configuration/ConfigMenuPageVM.cs b/ViewModel/Configuration/ConfigMenuPageVM.cs
index 49f1f2c..0ee8fb0 100644
--- a/ViewModel/Configuration/ConfigMenuPageVM.cs
+++ b/ViewModel/Configuration/ConfigMenuPageVM.cs
@@ -7,7 +7,6 @@ namespace SparkClient.ViewModel.Configuration;
public class ConfigMenuPageVM : BaseViewModel
{
public ICommand CloseCommand { get; }
-
public ICommand LevelConfigCommand { get; }
public ICommand AlgorithmConfigCommand { get; }
public ICommand CutConfigCommand { get; }
@@ -19,24 +18,38 @@ public class ConfigMenuPageVM : BaseViewModel
CutConfigCommand = new RelayCommand(CutConfig);
}
-
+ ///
+ /// 关闭并退回至上一页面
+ ///
+ ///
public void CloseVM(object parameter)
{
WindowManager.mainViewModel.Content = WindowManager.PreviousVM();
}
-
+ ///
+ /// 打开定级配置页面
+ ///
+ ///
public void LevelConfig(object parameter)
{
BaseControlVM vm = new BaseControlVM(new LevelConfigVM(), MultilingualHelper.getString("LevelConfig"));
WindowManager.mainViewModel.Content = vm;
WindowManager.openContent.Add(vm);
}
+ ///
+ /// 打开算法配置页面
+ ///
+ ///
public void AlgorithmConfig(object parameter)
{
BaseControlVM vm = new BaseControlVM(new AlgorithmConfigVM(), MultilingualHelper.getString("AlgorithmConfig"));
WindowManager.mainViewModel.Content = vm;
WindowManager.openContent.Add(vm);
}
+ ///
+ /// 打开切工仪配置页面
+ ///
+ ///
public void CutConfig(object parameter)
{
BaseControlVM vm = new BaseControlVM(new CutConfigVM(), MultilingualHelper.getString("CutConfig"));
diff --git a/ViewModel/Configuration/CutConfigVM.cs b/ViewModel/Configuration/CutConfigVM.cs
index 923d95a..4bcc97a 100644
--- a/ViewModel/Configuration/CutConfigVM.cs
+++ b/ViewModel/Configuration/CutConfigVM.cs
@@ -3,4 +3,45 @@
public class CutConfigVM: BaseViewModel
{
+ public CutConfigVM()
+ {
+ // 初始化VIEW层参数
+ // 初始化VIEW层Command
+ this.InitCutConfigData(null);
+ }
+
+ ///
+ /// 初始化切工仪数据
+ ///
+ ///
+ public void InitCutConfigData(object param)
+ {
+ }
+
+ ///
+ /// 添加行
+ ///
+ /// 行数
+ public void AddRows(object row)
+ {
+
+ }
+
+ ///
+ /// 保存数据
+ ///
+ ///
+ public void SaveCutConfigData(object param)
+ {
+
+ }
+
+ ///
+ /// 删除一行数据
+ ///
+ /// 行
+ public void DelCutRow(object row)
+ {
+
+ }
}
\ No newline at end of file
diff --git a/ViewModel/Configuration/LevelConfigVM.cs b/ViewModel/Configuration/LevelConfigVM.cs
index 885af86..27a0810 100644
--- a/ViewModel/Configuration/LevelConfigVM.cs
+++ b/ViewModel/Configuration/LevelConfigVM.cs
@@ -9,4 +9,46 @@ public class LevelConfigVM: BaseViewModel
{
_levels = new List(){"12314", "3455623", "4567894"};
}
+
+ ///
+ /// 加载顶级配置的数据
+ ///
+ ///
+ public void InitLevelConfig(object param)
+ {
+
+ }
+
+ ///
+ /// 更新保存响应
+ ///
+ ///
+ public void SaveLevelConfig(object param)
+ {
+
+ }
+ ///
+ /// 删除配置响应
+ ///
+ ///
+ public void DelLevelConfig(object param)
+ {
+ }
+
+ ///
+ /// 导入配置响应
+ ///
+ ///
+ public void LoadLevelConfig(object param)
+ {
+
+ }
+
+ ///
+ /// 切换定级响应
+ ///
+ ///
+ public void ChangeLevelModel(object param)
+ {
+ }
}
\ No newline at end of file
diff --git a/ViewModel/Grading/DiamondSelectVM.cs b/ViewModel/Grading/DiamondSelectVM.cs
new file mode 100644
index 0000000..ba68995
--- /dev/null
+++ b/ViewModel/Grading/DiamondSelectVM.cs
@@ -0,0 +1,6 @@
+namespace SparkClient.ViewModel.Grading;
+
+public class DiamondSelectVM:BaseViewModel
+{
+
+}
\ No newline at end of file
diff --git a/ViewModel/Grading/GradingResultVM.cs b/ViewModel/Grading/GradingResultVM.cs
new file mode 100644
index 0000000..e7bb2fa
--- /dev/null
+++ b/ViewModel/Grading/GradingResultVM.cs
@@ -0,0 +1,6 @@
+namespace SparkClient.ViewModel.Grading;
+
+public class GradingResultVM: BaseViewModel
+{
+
+}
\ No newline at end of file
diff --git a/ViewModel/HelperPageVM.cs b/ViewModel/HelperPageVM.cs
index a892c63..b2f0d2b 100644
--- a/ViewModel/HelperPageVM.cs
+++ b/ViewModel/HelperPageVM.cs
@@ -1,4 +1,4 @@
-namespace SparkClient.ViewModel.BaseWindow;
+namespace SparkClient.ViewModel;
public class HelperPageVM: BaseViewModel
{
diff --git a/Views/BaseWindow/HomeWindow.xaml b/Views/BaseWindow/HomeWindow.xaml
index 38b3b79..693c9ad 100644
--- a/Views/BaseWindow/HomeWindow.xaml
+++ b/Views/BaseWindow/HomeWindow.xaml
@@ -32,7 +32,7 @@