I am using this lib https://github.com/augustoproiete/ookii-dialogs-wpf for dialog presentation.
I am using such dialog for pick singe folder
private void Btn_path_to_save_processed_clip_folder_Click(object sender, RoutedEventArgs e)
{
var dialog = new Ookii.Dialogs.Wpf.VistaFolderBrowserDialog
{
Description = "Select where to save processed clip folder",
SelectedPath = m_TbClipSaveDirectory,
UseDescriptionForTitle = true
};
if (dialog.ShowDialog(Application.Current.MainWindow).GetValueOrDefault())
{
m_TbClipSaveDirectory = dialog.SelectedPath;
}
}
Question is - is there an option to pick a few folders at once?
Or maybe some others ways?
Eventually I made it with NuGet
1) Right click on project -> Manage NuGet packages -> in browse tab fill WindowsAPICodePack-Shell and set up into needed package
2) Create dialog
using var dialog = new CommonOpenFileDialog
{
IsFolderPicker = true,
Multiselect = true
};
Here you can see two settings IsFolderPicker - in order to chose only folders not a files and Multiselect - for multiselection
and eventually result
if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
{
var folders = dialog.FileNames;
MessageBox.Show(string.Join("\n", folders));
}
Result is:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With