完成修改选定变量的启用状态更改
This commit is contained in:
@@ -1,31 +1,31 @@
|
||||
using System;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using DMS.Core.Enums;
|
||||
|
||||
namespace DMS.WPF.ViewModels.Dialogs;
|
||||
|
||||
public partial class IsActiveDialogViewModel : ObservableObject
|
||||
namespace DMS.WPF.ViewModels.Dialogs
|
||||
{
|
||||
[ObservableProperty]
|
||||
private bool? _selectedIsActive;
|
||||
|
||||
public IsActiveDialogViewModel(bool? currentIsActive)
|
||||
public partial class IsActiveDialogViewModel : DialogViewModelBase<bool?>
|
||||
{
|
||||
_selectedIsActive = currentIsActive;
|
||||
}
|
||||
[ObservableProperty]
|
||||
private bool? _selectedIsActive;
|
||||
|
||||
[RelayCommand]
|
||||
private void SelectIsActive(string isActiveString)
|
||||
{
|
||||
if (bool.TryParse(isActiveString, out bool isActive))
|
||||
public IsActiveDialogViewModel(bool currentIsActive)
|
||||
{
|
||||
SelectedIsActive = isActive;
|
||||
SelectedIsActive = currentIsActive;
|
||||
Title = "修改启用状态";
|
||||
PrimaryButText = "确定";
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void PrimaryButton()
|
||||
{
|
||||
Close(SelectedIsActive);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void CancleButton()
|
||||
{
|
||||
Close(null);
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private void Cancel()
|
||||
{
|
||||
SelectedIsActive = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user