添加项目文件。
This commit is contained in:
46
Szmedi.RvKits/Common/TimerSetterWin.xaml.cs
Normal file
46
Szmedi.RvKits/Common/TimerSetterWin.xaml.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Windows;
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace Szmedi.RvKits.Common
|
||||
{
|
||||
/// <summary>
|
||||
/// TimerSetterWin.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
[ObservableObject]
|
||||
public partial class TimerSetterWin
|
||||
{
|
||||
private int intervalTime;
|
||||
|
||||
public TimerSetterWin()
|
||||
{
|
||||
DataContext = this;
|
||||
InitializeComponent();
|
||||
|
||||
AutoSave = Properties.Settings.Default.AutoSave;
|
||||
IntervalTime = Properties.Settings.Default.AutoSaveIntervalTime;
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.AutoSave = AutoSave;
|
||||
Properties.Settings.Default.AutoSaveIntervalTime = IntervalTime;
|
||||
Properties.Settings.Default.Save();
|
||||
DialogResult = true;
|
||||
}
|
||||
[ObservableProperty]
|
||||
private bool autoSave;
|
||||
|
||||
[Required]
|
||||
[DefaultValue(15)]
|
||||
[Range(1, 30)]
|
||||
public int IntervalTime
|
||||
{
|
||||
get => intervalTime;
|
||||
set => SetProperty(ref intervalTime, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user