ookii-dialogs-wpf icon indicating copy to clipboard operation
ookii-dialogs-wpf copied to clipboard

Fixed InitialFolder so it now works more than first time its called p…

Open buildcomplete opened this issue 6 years ago • 2 comments

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'

buildcomplete avatar Apr 10 '19 07:04 buildcomplete

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

buildcomplete avatar Apr 10 '19 07:04 buildcomplete

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 17 '21 15:06 CLAassistant