Submit big changes related with Material.Dialog
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
using Material.Dialog.Commands;
|
||||
|
||||
namespace Material.Dialog.ViewModels.Elements
|
||||
{
|
||||
public class ObsoleteDialogButtonViewModel : DialogButtonViewModel
|
||||
{
|
||||
public ObsoleteDialogButtonViewModel(DialogWindowViewModel parent, object content, string result) : base(parent, content)
|
||||
{
|
||||
_result = result;
|
||||
_command = new MaterialDialogRelayCommand(OnExecuteCommandHandler, CanExecuteCommandHandler);
|
||||
}
|
||||
|
||||
private bool CanExecuteCommandHandler(object arg)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private void OnExecuteCommandHandler(object obj)
|
||||
{
|
||||
if (Parent is null)
|
||||
return;
|
||||
|
||||
Parent.DialogResult = new DialogResult(obj.ToString());
|
||||
Parent.CloseWindow();
|
||||
}
|
||||
|
||||
private string _result;
|
||||
|
||||
/// <summary>
|
||||
/// This property is used for compat deprecated dialog library.
|
||||
/// </summary>
|
||||
public string Result
|
||||
{
|
||||
get => _result;
|
||||
set
|
||||
{
|
||||
_result = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user