Remotely/Desktop.Linux/ViewModels/MessageBoxViewModel.cs
2021-07-29 07:54:00 -07:00

38 lines
1.1 KiB
C#

using Avalonia.Controls;
using Remotely.Desktop.Linux.Controls;
using Remotely.Desktop.Linux.Services;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Input;
namespace Remotely.Desktop.Linux.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();
});
}
}