Exemple #1
0
        public async Task <string> GetDirectoryAsync(string?initialDirectory = null)
        {
            var dialog = new OpenFolderDialog {
                Directory = initialDirectory
            };
            var window = _mainWindowProvider.Get();

            return(await dialog.ShowAsync(window));
        }
Exemple #2
0
        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);
        }