Remotely/Desktop.UI/ViewModels/HostNamePromptViewModel.cs
2024-07-16 09:25:15 -07:00

34 lines
881 B
C#

using Avalonia.Controls;
using System.Windows.Input;
using Remotely.Desktop.Shared.Abstractions;
using Microsoft.Extensions.Logging;
using Remotely.Desktop.Shared.Reactive;
namespace Remotely.Desktop.UI.ViewModels;
public interface IHostNamePromptViewModel : IBrandedViewModelBase
{
string Host { get; set; }
ICommand OKCommand { get; }
}
public class HostNamePromptViewModel : BrandedViewModelBase, IHostNamePromptViewModel
{
public HostNamePromptViewModel(
IBrandingProvider brandingProvider,
IUiDispatcher dispatcher,
ILogger<HostNamePromptViewModel> logger)
: base(brandingProvider, dispatcher, logger)
{
OKCommand = new RelayCommand<Window>(x => x?.Close());
}
public string Host
{
get => Get<string>() ?? "https://";
set => Set(value);
}
public ICommand OKCommand { get; }
}