public async Task <string> GetDirectoryAsync(string?initialDirectory = null) { var dialog = new OpenFolderDialog { Directory = initialDirectory }; var window = _mainWindowProvider.Get(); return(await dialog.ShowAsync(window)); }
private async Task <TResult> ShowDialogAsync <TResult>(DialogWindowBase <TResult> window) where TResult : DialogResultBase { var mainWindow = (MainWindow)_mainWindowProviderService.Get(); var result = await window.ShowDialog <TResult>(mainWindow); if (window is IDisposable disposable) { disposable.Dispose(); } return(result); }