重构了添加设备对话框的布局
This commit is contained in:
30
DMS.WPF/ViewModels/Dialogs/ConfirmDialogViewModel.cs
Normal file
30
DMS.WPF/ViewModels/Dialogs/ConfirmDialogViewModel.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
namespace DMS.WPF.ViewModels.Dialogs;
|
||||
|
||||
public partial class ConfirmDialogViewModel : DialogViewModelBase<Boolean>
|
||||
{
|
||||
|
||||
[ObservableProperty]
|
||||
private string _message;
|
||||
|
||||
public ConfirmDialogViewModel(string title,string message,string primaryButText)
|
||||
{
|
||||
Message = message;
|
||||
Title = title;
|
||||
PrimaryButText = primaryButText;
|
||||
}
|
||||
|
||||
|
||||
[RelayCommand]
|
||||
private void PrimaryButton()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
[RelayCommand]
|
||||
private void CancleButton()
|
||||
{
|
||||
Close(false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user