Submit big changes related with Material.Dialog

This commit is contained in:
appleneko2001
2022-02-12 23:26:24 +09:00
parent 52a06d2757
commit c80972cdbc
27 changed files with 771 additions and 758 deletions
@@ -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();
}
}
}
}