ookii-dialogs-wpf
ookii-dialogs-wpf copied to clipboard
Fixed InitialFolder so it now works more than first time its called p…
The dialog.SetDefaultFolder(item) is only set first time the applications sets the folder, Next time the folder will be restored to last picked object and the 'Default folder' is ignored Use instead dialog.SetFolder which behaviour better matches the name 'InitialFolder'
Regarding the behaviour:
In our Application the user specifies many different filetypes, so dependant on the category we restore the default directory or last used for the category in either filepickers or folderpicker... therefore we need this functionality.
we have code like this many places in our application
var path = WpfShellDialogs.UserOpenFile(
"*.xml",
"Prediction model (.xml)|*.xml",
FolderProvider.GetLastOrDefaultFolder(FolderProvider.FolderName.PredictionModel));
Maybe a better fix would be something like
- InitialDirectory = DefaultDirectory (I would rename but to keep the interface maybe not renaming the Method is better) => InitialDirectory = behaviour from before patch
- add a SelectedDirectory for filepickers so it is possible to owerwrite the behaviour and thus have more control ourself