diff --git a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs index 55ebea3561..00d0aea188 100644 --- a/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/SettingsViewModel.cs @@ -31,7 +31,6 @@ using MaaWpfGui.Services.HotKeys; using MaaWpfGui.States; using MaaWpfGui.Utilities.ValueType; using MaaWpfGui.ViewModels.UserControl.Settings; -using MaaWpfGui.ViewModels.UserControl.TaskQueue; using Newtonsoft.Json; using Serilog; using Stylet; @@ -362,7 +361,7 @@ namespace MaaWpfGui.ViewModels.UI #region 配置 - public ObservableCollection ConfigurationList { get; set; } + public ObservableCollection ConfigurationList { get; set; } = []; private string? _currentConfiguration = ConfigurationHelper.GetCurrentConfiguration(); @@ -378,7 +377,7 @@ namespace MaaWpfGui.ViewModels.UI } } - private string _newConfigurationName; + private string _newConfigurationName = string.Empty; public string NewConfigurationName { @@ -495,7 +494,7 @@ namespace MaaWpfGui.ViewModels.UI private NotifyType _notifySource = NotifyType.None; - private Timer _resetNotifyTimer; + private Timer? _resetNotifyTimer; private void ResetNotifySource() { diff --git a/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs index 604998f95b..142178af2a 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/FightSettingsUserControlModel.cs @@ -554,7 +554,7 @@ public class FightSettingsUserControlModel : TaskViewModel /// /// Gets or private sets the list of drops. /// - public ObservableCollection DropsList { get; private set; } + public ObservableCollection DropsList { get; private set; } = []; private string _dropsItemId = ConfigurationHelper.GetValue(ConfigurationKeys.DropsItemId, string.Empty); diff --git a/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/InfrastSettingsUserControlModel.cs b/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/InfrastSettingsUserControlModel.cs index b941b3534d..428fe7a63f 100644 --- a/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/InfrastSettingsUserControlModel.cs +++ b/src/MaaWpfGui/ViewModels/UserControl/TaskQueue/InfrastSettingsUserControlModel.cs @@ -145,7 +145,7 @@ public class InfrastSettingsUserControlModel : TaskViewModel } } - private string _dormThresholdLabel; + private string _dormThresholdLabel = string.Empty; /// /// Gets or sets the label of dormitory threshold.