添加了测试WPF的单元测试

This commit is contained in:
2025-07-27 21:09:36 +08:00
parent 4a56405629
commit 8b9b096df9
5 changed files with 130 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;
using System.Threading.Tasks;
namespace DMS.WPF.ViewModels.Dialogs
{
public abstract partial class DialogViewModelBase<TResult> : ObservableObject
{
[ObservableProperty]
private string _title;
[ObservableProperty]
private string _primaryButContent;
public event Func<TResult, Task> CloseRequested;
[RelayCommand]
protected virtual async Task Close(TResult result)
{
if (CloseRequested != null)
{
await CloseRequested(result);
}
}
}
}