Skip to content

Commit

Permalink
Update WindowExtensions.Dialogs.cs (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
moldypenguins authored Jan 16, 2025
1 parent 6ef4acd commit 35e9edf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/WinUIEx/WindowExtensions.Dialogs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,17 @@ public static FileSavePicker CreateSaveFilePicker(this Window window)
WinRT.Interop.InitializeWithWindow.Initialize(savePicker, window.GetWindowHandle());
return savePicker;
}

/// <summary>
/// Creates a new instance of a FolderPicker with the provided window as a parent.
/// </summary>
/// <param name="window">Parent window</param>
/// <returns>FolderPicker</returns>
public static FolderPicker CreateFolderPicker(this Window window)
{
FolderPicker folderPicker = new FolderPicker();
WinRT.Interop.InitializeWithWindow.Initialize(folderPicker, window.GetWindowHandle());
return folderPicker;
}
}
}

0 comments on commit 35e9edf

Please sign in to comment.