update pr/58
This commit is contained in:
1 parent
e9329ef982
commit
ce93f34467
8 files changed
+65
-112
No files matched your search
@@ -1,36 +1,30 @@
|
||||
using System;
|
||||
using System.Windows.Input;
|
||||
using GalaSoft.MvvmLight;
|
||||
using GalaSoft.MvvmLight.CommandWpf;
|
||||
using HandyControl.Tools.Extension;
|
||||
|
||||
namespace HandyControlDemo.ViewModel.Basic
|
||||
{
|
||||
public class InteractiveDialogViewModel : ViewModelBase, IDialogResultable
|
||||
public class InteractiveDialogViewModel : ViewModelBase, IDialogResultable<string>
|
||||
{
|
||||
public Action CloseAction { get; set; }
|
||||
|
||||
private string _result;
|
||||
|
||||
public string Result
|
||||
{
|
||||
get => _result;
|
||||
set => Set(ref _result, value);
|
||||
}
|
||||
|
||||
private string _message;
|
||||
|
||||
|
||||
public object Result { get; set; }
|
||||
|
||||
public Action ClosureToken { get; set; }
|
||||
|
||||
public ICommand CloseCommand { get; }
|
||||
|
||||
public string Message
|
||||
{
|
||||
get => _message;
|
||||
set => Set(ref _message, value);
|
||||
}
|
||||
|
||||
|
||||
public InteractiveDialogViewModel()
|
||||
{
|
||||
CloseCommand = new RelayCommand<string>(result =>
|
||||
{
|
||||
Result = result;
|
||||
ClosureToken();
|
||||
});
|
||||
}
|
||||
public RelayCommand CloseCmd => new Lazy<RelayCommand>(() => new RelayCommand(() => CloseAction?.Invoke())).Value;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user