From 8cc07795415ecb310d4bd3ac3242e6ed8daff18a Mon Sep 17 00:00:00 2001
From: status102 <102887808+status102@users.noreply.github.com>
Date: Tue, 10 Dec 2024 11:03:51 +0800
Subject: [PATCH] =?UTF-8?q?style:=20=E4=BF=AE=E6=94=B9=E5=8F=98=E9=87=8F?=
=?UTF-8?q?=E4=BB=A5=E7=AC=A6=E5=90=88=E9=A1=B9=E7=9B=AE=E9=A3=8E=E6=A0=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[skip changelog]
---
.../ViewModels/UI/SettingsViewModel.cs | 18 +++++++++---------
.../ConnectSettingsUserControlModel.cs | 3 ++-
...rnalNotificationSettingsUserControlModel.cs | 2 ++
.../Settings/GameSettingsUserControlModel.cs | 2 ++
.../Settings/GuiSettingsUserControlModel.cs | 2 ++
.../PerformanceUserControlModel.cs | 4 +++-
.../Settings/RemoteControlUserControlModel.cs | 2 ++
.../Settings/StartSettingsUserControlModel.cs | 2 ++
.../Settings/TimerSettingsUserControlModel.cs | 2 ++
.../VersionUpdateSettingsUserControlModel.cs | 2 ++
10 files changed, 28 insertions(+), 11 deletions(-)
rename src/MaaWpfGui/ViewModels/UserControl/{TaskQueue => Settings}/PerformanceUserControlModel.cs (92%)
diff --git a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs
index c8780abc0c..f7d2ef7625 100644
--- a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs
+++ b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs
@@ -112,47 +112,47 @@ namespace MaaWpfGui.ViewModels.UI
///
/// Gets 游戏设置model
///
- public static GameSettingsUserControlModel GameSettings { get; } = new();
+ public static GameSettingsUserControlModel GameSettings { get; } = GameSettingsUserControlModel.Instance;
///
/// Gets 连接设置model
///
- public static ConnectSettingsUserControlModel ConnectSettings { get; } = new();
+ public static ConnectSettingsUserControlModel ConnectSettings { get; } = ConnectSettingsUserControlModel.Instance;
///
/// Gets 启动设置Model
///
- public static StartSettingsUserControlModel StartSettings { get; } = new();
+ public static StartSettingsUserControlModel StartSettings { get; } = StartSettingsUserControlModel.Instance;
///
/// Gets 界面设置model
///
- public static GuiSettingsUserControlModel GuiSettings { get; } = new();
+ public static GuiSettingsUserControlModel GuiSettings { get; } = GuiSettingsUserControlModel.Instance;
///
/// Gets 定时设置model
///
- public static TimerSettingsUserControlModel TimerSettings { get; } = new();
+ public static TimerSettingsUserControlModel TimerSettings { get; } = TimerSettingsUserControlModel.Instance;
///
/// Gets 远程控制model
///
- public static RemoteControlUserControlModel RemoteControlSettings { get; } = new();
+ public static RemoteControlUserControlModel RemoteControlSettings { get; } = RemoteControlUserControlModel.Instance;
///
/// Gets 软件更新model
///
- public static VersionUpdateSettingsUserControlModel VersionUpdateSettings { get; } = new();
+ public static VersionUpdateSettingsUserControlModel VersionUpdateSettings { get; } = VersionUpdateSettingsUserControlModel.Instance;
///
/// Gets 外部通知model
///
- public static ExternalNotificationSettingsUserControlModel ExternalNotificationSettings { get; } = new();
+ public static ExternalNotificationSettingsUserControlModel ExternalNotificationSettings { get; } = ExternalNotificationSettingsUserControlModel.Instance;
///
/// Gets 性能设置model
///
- public static PerformanceUserControlModel PerformanceSettings { get; } = new();
+ public static PerformanceUserControlModel PerformanceSettings { get; } = PerformanceUserControlModel.Instance;
#endregion 设置界面Model
diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/ConnectSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/ConnectSettingsUserControlModel.cs
index 7dd75c0f26..a956c305c2 100644
--- a/src/MaaWpfGui/ViewModels/UserControl/Settings/ConnectSettingsUserControlModel.cs
+++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/ConnectSettingsUserControlModel.cs
@@ -28,7 +28,6 @@ using MaaWpfGui.Constants;
using MaaWpfGui.Helper;
using MaaWpfGui.Main;
using MaaWpfGui.States;
-using MaaWpfGui.Utilities;
using MaaWpfGui.Utilities.ValueType;
using MaaWpfGui.ViewModels.UI;
using MaaWpfGui.WineCompat;
@@ -46,6 +45,8 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings;
///
public class ConnectSettingsUserControlModel : PropertyChangedBase
{
+ public static ConnectSettingsUserControlModel Instance { get; } = new();
+
private static readonly ILogger _logger = Log.ForContext();
private static RunningState _runningState => RunningState.Instance;
diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/ExternalNotificationSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/ExternalNotificationSettingsUserControlModel.cs
index d51b07f762..413fb1ee75 100644
--- a/src/MaaWpfGui/ViewModels/UserControl/Settings/ExternalNotificationSettingsUserControlModel.cs
+++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/ExternalNotificationSettingsUserControlModel.cs
@@ -27,6 +27,8 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings;
///
public class ExternalNotificationSettingsUserControlModel : PropertyChangedBase
{
+ public static ExternalNotificationSettingsUserControlModel Instance { get; } = new();
+
// UI 绑定的方法
// ReSharper disable once UnusedMember.Global
public static void ExternalNotificationSendTest()
diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/GameSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/GameSettingsUserControlModel.cs
index cdf9a2d504..5f55f29ea4 100644
--- a/src/MaaWpfGui/ViewModels/UserControl/Settings/GameSettingsUserControlModel.cs
+++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/GameSettingsUserControlModel.cs
@@ -27,6 +27,8 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings;
public class GameSettingsUserControlModel : PropertyChangedBase
{
+ public static GameSettingsUserControlModel Instance { get; } = new();
+
private static readonly ILogger _logger = Log.ForContext();
private static VersionUpdateSettingsUserControlModel VersionUpdateSettings => SettingsViewModel.VersionUpdateSettings;
diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/GuiSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/GuiSettingsUserControlModel.cs
index 52d916b541..c3c4db53fd 100644
--- a/src/MaaWpfGui/ViewModels/UserControl/Settings/GuiSettingsUserControlModel.cs
+++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/GuiSettingsUserControlModel.cs
@@ -29,6 +29,8 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings;
public class GuiSettingsUserControlModel : PropertyChangedBase
{
+ public static GuiSettingsUserControlModel Instance { get; } = new();
+
///
/// Gets or sets the language list.
///
diff --git a/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/PerformanceUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/PerformanceUserControlModel.cs
similarity index 92%
rename from src/MaaWpfGui/ViewModels/UserControl/TaskQueue/PerformanceUserControlModel.cs
rename to src/MaaWpfGui/ViewModels/UserControl/Settings/PerformanceUserControlModel.cs
index 3396976eed..3782245573 100644
--- a/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/PerformanceUserControlModel.cs
+++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/PerformanceUserControlModel.cs
@@ -17,13 +17,15 @@ using MaaWpfGui.Helper;
using MaaWpfGui.ViewModels.UI;
using Stylet;
-namespace MaaWpfGui.ViewModels.UserControl.TaskQueue;
+namespace MaaWpfGui.ViewModels.UserControl.Settings;
///
/// 性能设置
///
public class PerformanceUserControlModel : PropertyChangedBase
{
+ public static PerformanceUserControlModel Instance { get; } = new();
+
public List GpuOptions => GpuOption.GetGpuOptions();
public GpuOption ActiveGpuOption
diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/RemoteControlUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/RemoteControlUserControlModel.cs
index b0a67a7653..9779542628 100644
--- a/src/MaaWpfGui/ViewModels/UserControl/Settings/RemoteControlUserControlModel.cs
+++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/RemoteControlUserControlModel.cs
@@ -23,6 +23,8 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings;
///
public class RemoteControlUserControlModel : PropertyChangedBase
{
+ public static RemoteControlUserControlModel Instance { get; } = new();
+
private string _remoteControlGetTaskEndpointUri = ConfigurationHelper.GetValue(ConfigurationKeys.RemoteControlGetTaskEndpointUri, string.Empty);
public string RemoteControlGetTaskEndpointUri
diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/StartSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/StartSettingsUserControlModel.cs
index 4716cea323..ed0ecc02a3 100644
--- a/src/MaaWpfGui/ViewModels/UserControl/Settings/StartSettingsUserControlModel.cs
+++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/StartSettingsUserControlModel.cs
@@ -40,6 +40,8 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings;
///
public class StartSettingsUserControlModel : PropertyChangedBase
{
+ public static StartSettingsUserControlModel Instance { get; } = new();
+
private static readonly ILogger _logger = Log.ForContext();
private static RunningState _runningState => RunningState.Instance;
diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/TimerSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/TimerSettingsUserControlModel.cs
index 2d5b63f7cd..40a353bc4b 100644
--- a/src/MaaWpfGui/ViewModels/UserControl/Settings/TimerSettingsUserControlModel.cs
+++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/TimerSettingsUserControlModel.cs
@@ -24,6 +24,8 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings;
///
public class TimerSettingsUserControlModel : PropertyChangedBase
{
+ public static TimerSettingsUserControlModel Instance { get; } = new();
+
private bool _forceScheduledStart = Convert.ToBoolean(ConfigurationHelper.GetGlobalValue(ConfigurationKeys.ForceScheduledStart, bool.FalseString));
///
diff --git a/src/MaaWpfGui/ViewModels/UserControl/Settings/VersionUpdateSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/Settings/VersionUpdateSettingsUserControlModel.cs
index 0ab5d19805..d2d75577f9 100644
--- a/src/MaaWpfGui/ViewModels/UserControl/Settings/VersionUpdateSettingsUserControlModel.cs
+++ b/src/MaaWpfGui/ViewModels/UserControl/Settings/VersionUpdateSettingsUserControlModel.cs
@@ -41,6 +41,8 @@ namespace MaaWpfGui.ViewModels.UserControl.Settings;
///
public class VersionUpdateSettingsUserControlModel : PropertyChangedBase
{
+ public static VersionUpdateSettingsUserControlModel Instance { get; } = new();
+
public enum UpdateVersionType
{
///