Skip to content

Conversation

@VladislavAntonyuk
Copy link
Collaborator

@VladislavAntonyuk VladislavAntonyuk commented Jan 6, 2026

Description of Change

Set initial folder for FilePicker and FolderPicker on Windows

PR Checklist

  • Has a linked Issue, and the Issue has been approved(bug) or Championed (feature/proposal)
  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Documentation created or updated: https://github.com/MicrosoftDocs/CommunityToolkit/pulls

Additional information

@VladislavAntonyuk VladislavAntonyuk self-assigned this Jan 6, 2026
Copilot AI review requested due to automatic review settings January 6, 2026 12:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the initial path/folder functionality for Windows file and folder pickers by migrating from the older Windows.Storage.Pickers API to the newer Microsoft.Windows.Storage.Pickers API. The implementation now properly sets the suggested folder path when opening pickers.

Key changes:

  • Migrated to Microsoft.Windows.Storage.Pickers API for both FolderPicker and FileSaver on Windows
  • Implemented proper window retrieval using IPlatformApplication and MauiWinUIWindow
  • Added SuggestedFolder property to set initial path for pickers
  • Enhanced error handling by separating cancellation from folder existence errors

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
FolderPickerImplementation.windows.cs Updated to use new Windows picker API with proper initial path support and window handling
FileSaverImplementation.windows.cs Updated to use new Windows picker API with proper initial path support and window handling
CommunityToolkit.Maui.Core.csproj Added Microsoft.WindowsAppSDK dependency and updated System.Speech version
FolderPickerViewModel.cs Sample code updated to demonstrate initial folder path usage
FileSaverViewModel.cs Sample code updated to demonstrate initial folder path usage

Copilot AI review requested due to automatic review settings January 18, 2026 14:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Refactored window retrieval in file/folder pickers to use pattern matching for clarity and modern C# style. Updated picker instantiation to use AppWindow.Id directly. Removed unused using statements. Changed csproj Windows ItemGroup condition to use $(NetVersion) for better .NET version flexibility. Cleaned up cancellation token registration variable naming.
@VladislavAntonyuk VladislavAntonyuk enabled auto-merge (squash) January 18, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants