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]
|
2025-09-05 19:59:21 +08:00
|
|
|
private int _selectedPollLevelType;
|
2025-07-05 16:13:46 +08:00
|
|
|
|
2025-09-05 19:59:21 +08:00
|
|
|
public List<int> PollLevelTypes { get; }
|
2025-07-05 16:13:46 +08:00
|
|
|
|
2025-09-05 19:59:21 +08:00
|
|
|
public PollLevelDialogViewModel(int currentPollLevelType)
|
2025-07-05 16:13:46 +08:00
|
|
|
{
|
2025-09-05 19:59:21 +08:00
|
|
|
PollLevelTypes = new List<int> { 10, 100, 500, 1000, 5000, 10000, 20000, 30000, 60000, 180000, 300000, 600000, 1800000, 3600000 };
|
2025-07-05 16:13:46 +08:00
|
|
|
SelectedPollLevelType = currentPollLevelType;
|
2025-09-02 17:42:11 +08:00
|
|
|
Title = "修改轮询频率";
|
|
|
|
|
PrimaryButText = "确定";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[RelayCommand]
|
|
|
|
|
private void PrimaryButton()
|
|
|
|
|
{
|
|
|
|
|
Close(SelectedPollLevelType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[RelayCommand]
|
|
|
|
|
private void CancleButton()
|
|
|
|
|
{
|
|
|
|
|
Close(null);
|
2025-07-05 16:13:46 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|