Skip to content

Commit 35e9edf

Browse files
Update WindowExtensions.Dialogs.cs (#167)
1 parent 6ef4acd commit 35e9edf

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/WinUIEx/WindowExtensions.Dialogs.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,17 @@ public static FileSavePicker CreateSaveFilePicker(this Window window)
4343
WinRT.Interop.InitializeWithWindow.Initialize(savePicker, window.GetWindowHandle());
4444
return savePicker;
4545
}
46+
47+
/// <summary>
48+
/// Creates a new instance of a FolderPicker with the provided window as a parent.
49+
/// </summary>
50+
/// <param name="window">Parent window</param>
51+
/// <returns>FolderPicker</returns>
52+
public static FolderPicker CreateFolderPicker(this Window window)
53+
{
54+
FolderPicker folderPicker = new FolderPicker();
55+
WinRT.Interop.InitializeWithWindow.Initialize(folderPicker, window.GetWindowHandle());
56+
return folderPicker;
57+
}
4658
}
4759
}

0 commit comments

Comments
 (0)