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

38 lines
1016 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;
using DMS.Core.Enums;
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-02 17:42:11 +08:00
public partial class PollLevelDialogViewModel : DialogViewModelBase<PollLevelType?>
2025-07-05 16:13:46 +08:00
{
[ObservableProperty]
private PollLevelType _selectedPollLevelType;
public List<PollLevelType> PollLevelTypes { get; }
public PollLevelDialogViewModel(PollLevelType currentPollLevelType)
{
PollLevelTypes = Enum.GetValues(typeof(PollLevelType)).Cast<PollLevelType>().ToList();
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
}
}
}