Files
DMS/DMS.WPF/ViewModels/Dialogs/PollLevelDialogViewModel.cs

37 lines
1012 B
C#
Raw Normal View History

2025-07-05 16:13:46 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using CommunityToolkit.Mvvm.ComponentModel;
2025-09-02 17:42:11 +08:00
using CommunityToolkit.Mvvm.Input;
2025-07-05 16:13:46 +08:00
2025-07-19 11:11:01 +08:00
namespace DMS.WPF.ViewModels.Dialogs
2025-07-05 16:13:46 +08:00
{
2025-09-05 19:59:21 +08:00
public partial class PollLevelDialogViewModel : DialogViewModelBase<int?>
2025-07-05 16:13:46 +08:00
{
[ObservableProperty]
private int _selectedPollingInterval;
2025-07-05 16:13:46 +08:00
public List<int> PollingIntervals { get; }
2025-07-05 16:13:46 +08:00
public PollLevelDialogViewModel(int currentPollingInterval)
2025-07-05 16:13:46 +08:00
{
PollingIntervals = new List<int> { 10, 100, 500, 1000, 5000, 10000, 20000, 30000, 60000, 180000, 300000, 600000, 1800000, 3600000 };
SelectedPollingInterval = currentPollingInterval;
Title = "修改轮询间隔";
2025-09-02 17:42:11 +08:00
PrimaryButText = "确定";
}
[RelayCommand]
private void PrimaryButton()
{
Close(SelectedPollingInterval);
2025-09-02 17:42:11 +08:00
}
[RelayCommand]
private void CancleButton()
{
Close(null);
2025-07-05 16:13:46 +08:00
}
}
}