Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Ookii.Dialogs.Wpf/VistaFileDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,11 @@ internal virtual void SetDialogProperties(Ookii.Dialogs.Wpf.Interop.IFileDialog
if( !string.IsNullOrEmpty(_initialDirectory) )
{
Ookii.Dialogs.Wpf.Interop.IShellItem item = NativeMethods.CreateItemFromParsingName(_initialDirectory);
dialog.SetDefaultFolder(item);

// 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'
dialog.SetFolder(item);
}

if( !string.IsNullOrEmpty(_title) )
Expand Down