Remotely/Remotely_Desktop.Unix/ViewModels/MessageBoxViewModel.cs
2021-07-29 07:53:52 -07:00

38 lines
1.1 KiB
C#

using Avalonia.Controls;
using Remotely_Desktop.Unix.Controls;
using Remotely_Desktop.Unix.Services;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Input;
namespace Remotely_Desktop.Unix.ViewModels
{
public class MessageBoxViewModel : ViewModelBase
{
public string Caption { get; set; }
public string Message { get; set; }
public bool IsOkButtonVisible { get; set; }
public bool AreYesNoButtonsVisible { get; set; }
public MessageBoxResult Result { get; set; } = MessageBoxResult.Cancel;
public ICommand OKCommand => new Executor((param) =>
{
Result = MessageBoxResult.OK;
(param as Window).Close();
});
public ICommand YesCommand => new Executor((param) =>
{
Result = MessageBoxResult.Yes;
(param as Window).Close();
});
public ICommand NoCommand => new Executor((param) =>
{
Result = MessageBoxResult.No;
(param as Window).Close();
});
}
}