添加项目文件。

This commit is contained in:
GG Z
2024-09-22 11:05:41 +08:00
parent fb5d55723a
commit 49ceaae6a8
764 changed files with 78850 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
namespace Sai.RvKits.RvCommon;
public partial class AutoSaveViewModel : ObservableValidator
{
public AutoSaveViewModel()
{
IsActiveAutoSave = Properties.Settings.Default.IsActiveAutoSave;
IntervalTime = Properties.Settings.Default.AutoSaveIntervalTime;
}
[ObservableProperty]
private bool isActiveAutoSave;
[Required(ErrorMessage = "不可为空")]
[DefaultValue(15)]
[NotifyDataErrorInfo]
[Range(5, 30, ErrorMessage = "输入值应在5~30分钟之间")]
[ObservableProperty]
private int intervalTime;
[RelayCommand]
private void Closing()
{
Properties.Settings.Default.IsActiveAutoSave = IsActiveAutoSave;
Properties.Settings.Default.AutoSaveIntervalTime = IntervalTime;
Properties.Settings.Default.Save();
}
}