Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPF alternative for WinForms FolderBrowserDialog #438

Open
Jogge opened this Issue Mar 13, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@Jogge
Copy link

Jogge commented Mar 13, 2019

I'm missing a proper WPF-way to select a folder with a dialog.

Best answers on the internet says I have to reference WinForms and use the FolderBrowserDialog. I don't want to make a reference to WinForms just to make a dialog to select a folder.

WPF already have SaveFileDialog and OpenFileDialog...

Related links:
https://stackoverflow.com/questions/1922204/open-directory-dialog
https://stackoverflow.com/questions/4547320/using-folderbrowserdialog-in-wpf-application

@JohanLarsson

This comment has been minimized.

Copy link

JohanLarsson commented Mar 13, 2019

There is https://www.nuget.org/packages/Ookii.Dialogs/ but agreed it would be nice with something built-in as the need comes up a lot.

@miloush

This comment has been minimized.

Copy link

miloush commented Mar 13, 2019

Agree I am missing this often too. It is not even that difficult, since you just need to set PICKFOLDERS option on the already existing FileOpenDialog. There is FileDialog.SetOption method to manipulate the options, however, that is internal. Unfortunately it cannot be set by reflection either, since the options are filtered out when creating the dialog, not sure why.

Moreover, Visual Studio itself is using that dialog for File | Open | Folder...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.