Skip to content

Commit aba8217

Browse files
Fixed InitialFolder so it now works more than first time its called pr. application
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'
1 parent 96c033f commit aba8217

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Ookii.Dialogs.Wpf/VistaFileDialog.cs

+5-1
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)