I was looking for and Open Folder Dialog (wpf). I get the Ookii dialogs for wpf and I use VistaFolderBrowserDialog. (I don't like the FolderBrowserDialog of Windows Forms).
I save the "last open folder". So the next time the user open this VistaFolderBrowserDialog the Initial Folder is the "last one" I saved.
...
//Save the new actual folder
MyProject.ProgramConfigurationFile.Instance.OpenFolderPath = System.IO.Path.GetDirectoryName(folderDialog.SelectedPath);
VistaFolderBrowserDialog has the property => RootFolder:
public Environment..::..SpecialFolder RootFolder { get; set; } But it is a SpecialFolder type.
So I am looking for a way to set my String OpenFolderPath to the RootFolder property.
VistaFolderBrowserDialog folderDialog = new VistaFolderBrowserDialog();
folderDialog.Description = "Please select the folder";
folderDialog.UseDescriptionForTitle = true;
if ((bool)folderDialog.ShowDialog(this))
{
//Get the last open folder saved (if exist).
if(!String.IsNullOrEmpty(MyProject.ProgramConfigurationFile.Instance.OpenFolderPath))
{
folderDialog.RootFolder = Environment.SpecialFolder. //I would like to set OpenFolderPath
}
}
Other Folder Browsers are also welcome.
Thank you very much.