Files
HandyControl/HandyControlDemo/ViewModel/Basic/InteractiveDialogViewModel.cs
T
2019-04-03 22:07:17 +08:00

31 lines
749 B
C#

using System;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.CommandWpf;
using HandyControl.Tools.Extension;
namespace HandyControlDemo.ViewModel.Basic
{
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 string Message
{
get => _message;
set => Set(ref _message, value);
}
public RelayCommand CloseCmd => new Lazy<RelayCommand>(() => new RelayCommand(() => CloseAction?.Invoke())).Value;
}
}