Files
HandyControl/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/InteractiveDialogViewModel.cs
T
2021-06-21 21:49:43 +08:00

39 lines
859 B
C#

using System;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using HandyControl.Tools.Extension;
namespace HandyControlDemo.ViewModel
{
public class InteractiveDialogViewModel : ViewModelBase, IDialogResultable<string>
{
public Action CloseAction { get; set; }
private string _result;
public string Result
{
get => _result;
#if NET40
set => Set(nameof(Result), ref _result, value);
#else
set => Set(ref _result, value);
#endif
}
private string _message;
public string Message
{
get => _message;
#if NET40
set => Set(nameof(Message), ref _message, value);
#else
set => Set(ref _message, value);
#endif
}
public RelayCommand CloseCmd => new(() => CloseAction?.Invoke());
}
}