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 8edf0f06ba..c64eb0ff9c 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 3a543b59f7..84bacafd70 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 { ///