using Remotely.Desktop.Core.Interfaces; using Remotely.Desktop.Win.ViewModels; using Remotely.Desktop.Win.Views; using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace Remotely.Desktop.Win.Services { public class RemoteControlAccessServiceWin : IRemoteControlAccessService { public Task PromptForAccess(string requesterName, string organizationName) { var result = App.Current.Dispatcher.Invoke(() => { var promptWindow = new PromptForAccessWindow(); var viewModel = promptWindow.DataContext as PromptForAccessWindowViewModel; if (!string.IsNullOrWhiteSpace(requesterName)) { viewModel.RequesterName = requesterName; } if (!string.IsNullOrWhiteSpace(organizationName)) { viewModel.OrganizationName = organizationName; } promptWindow.ShowDialog(); return viewModel.PromptResult; }); return Task.FromResult(result); } } }