Exemple #1
0
        public async Task <DialogResult> ShowDialog(Window window)
        {
            var dialog = new Avalonia.Controls.OpenFolderDialog {
                Directory = InitialDirectory,
                Title     = Title,
            };

            SelectedPath = await dialog.ShowAsync(window.window);

            return(SelectedPath is null ? DialogResult.Cancel : DialogResult.OK);
        }
        private async void FindLogFolder()
        {
            if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
            {
                var dialog = new Avalonia.Controls.OpenFolderDialog()
                {
                    Directory = LogFolderPath,
                    Title     = "Find new log folder path"
                };
                var newPath = await dialog.ShowAsync(desktop.MainWindow);

                LogFolderPath = newPath;
            }
        }