Skip to content

Commit cc8abbe

Browse files
Merge pull request #1 from buildcomplete/buildcomplete-patch-nitial-directory
Fixed InitialFolder so it now works more than first time its called p…
2 parents 96c033f + aba8217 commit cc8abbe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Ookii.Dialogs.Wpf/VistaFileDialog.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,11 @@ internal virtual void SetDialogProperties(Ookii.Dialogs.Wpf.Interop.IFileDialog
647647
if( !string.IsNullOrEmpty(_initialDirectory) )
648648
{
649649
Ookii.Dialogs.Wpf.Interop.IShellItem item = NativeMethods.CreateItemFromParsingName(_initialDirectory);
650-
dialog.SetDefaultFolder(item);
650+
651+
// The dialog.SetDefaultFolder(item) is only set first time the applications sets the folder,
652+
// Next time the folder will be restored to last picked object and the 'Default folder' is ignored
653+
// Use instead dialog.SetFolder which behaviour better matches the name 'InitialFolder'
654+
dialog.SetFolder(item);
651655
}
652656

653657
if( !string.IsNullOrEmpty(_title) )

0 commit comments

Comments
 (0)