-
Notifications
You must be signed in to change notification settings - Fork 296
Storage.Pickers Sample for WindowsAppSDK 1.8 #512
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
base: release/experimental
Are you sure you want to change the base?
Storage.Pickers Sample for WindowsAppSDK 1.8 #512
Conversation
…icrosoft/WindowsAppSDK-Samples into user/DinahK-2SO/storage_pickers_sample
…ed' into user/DinahK-2SO/storage_pickers_sample
{ | ||
var picker = new Microsoft.Windows.Storage.Pickers.FileOpenPicker(this.AppWindow.Id); | ||
|
||
if (CommitButtonCheckBox.IsChecked == true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is IsChecked's type boolean? If so, do we need == true here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Hong-Xiang for raising this point. == true
seems to be the pattern in the official doc of checkbox: https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.checkbox?view=winrt-26100
Therefore, I am keeping it here.
{ | ||
string input = FileTypeFilterInput.Text?.Trim() ?? ""; | ||
if (string.IsNullOrEmpty(input)) | ||
return new string[] { "*" }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is collection expression support in this csharp project? If so, do we consider using that as a best practice? e.g. here would be ["*"]
?
|
||
return input.Split(new char[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries) | ||
.Select(s => s.Trim()) | ||
.ToArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this 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 introduces sample applications demonstrating the Microsoft.Windows.Storage.Pickers API for WindowsAppSDK 1.8, providing both C# and C++ implementations to showcase file picker functionality.
- Complete C# and C++ sample applications for Storage Pickers API
- Comprehensive UI with tabs for FileOpenPicker, FileSavePicker, and FolderPicker
- Project configuration files and manifests for both packaged and unpackaged deployment scenarios
Reviewed Changes
Copilot reviewed 29 out of 44 changed files in this pull request and generated 7 comments.
File | Description |
---|---|
cs-sample/* | Complete C# sample application with project files, manifests, and UI implementation |
cpp-sample/* | Complete C++ sample application with project files, package configuration, and UI implementation |
README.md | Documentation explaining the samples, screenshots, and usage instructions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
<PublishProtocol>FileSystem</PublishProtocol> | ||
<Platform>x64</Platform> | ||
<RuntimeIdentifier>win-x64</RuntimeIdentifier> | ||
<PublishDir>bin\\\win-x64\publish\</PublishDir> |
Copilot
AI
Sep 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PublishDir path contains unnecessary triple backslashes. This should be simplified to bin\\win-x64\\publish\\
or use forward slashes for better readability.
<PublishDir>bin\\\win-x64\publish\</PublishDir> | |
<PublishDir>bin/win-x64/publish/</PublishDir> |
Copilot uses AI. Check for mistakes.
<PublishProtocol>FileSystem</PublishProtocol> | ||
<Platform>ARM64</Platform> | ||
<RuntimeIdentifier>win-arm64</RuntimeIdentifier> | ||
<PublishDir>bin\\\win-arm64\publish\win-arm64\</PublishDir> |
Copilot
AI
Sep 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PublishDir path has both triple backslashes and a redundant 'win-arm64' directory at the end. This should be simplified to bin\\win-arm64\\publish\\
.
<PublishDir>bin\\\win-arm64\publish\win-arm64\</PublishDir> | |
<PublishDir>bin\win-arm64\publish\</PublishDir> |
Copilot uses AI. Check for mistakes.
<PropertyGroup> | ||
<Configuration>Release</Configuration> | ||
<Platform>ARM64</Platform> | ||
<PublishDir>bin\\\win-x64\publish\win-x64\</PublishDir> |
Copilot
AI
Sep 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Platform is set to ARM64 but the PublishDir references win-x64. This inconsistency will cause deployment issues. Either change Platform to x64 or update PublishDir to reference win-arm64.
<PublishDir>bin\\\win-x64\publish\win-x64\</PublishDir> | |
<PublishDir>bin\\\win-arm64\publish\win-arm64\</PublishDir> |
Copilot uses AI. Check for mistakes.
<!-- SuggestedFolder Tests --> | ||
<StackPanel Style="{StaticResource TestGroupStyle}"> | ||
<CheckBox x:Name="SuggestedFolderCheckBox" Content="Set SuggestedFolder"/> | ||
<TextBox x:Name="SuggestedFolderInput" PlaceholderText="Enter default extension" Text='C:\Temp'/> |
Copilot
AI
Sep 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PlaceholderText says 'Enter default extension' but this field is for SuggestedFolder. The placeholder should read 'Enter folder path' or similar.
<TextBox x:Name="SuggestedFolderInput" PlaceholderText="Enter default extension" Text='C:\Temp'/> | |
<TextBox x:Name="SuggestedFolderInput" PlaceholderText="Enter folder path" Text='C:\Temp'/> |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Friend Copilot. This is my bad. Nice catch.
Samples/StoragePickers/cs-sample/FilePickersAppSinglePackaged.csproj
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…icrosoft/WindowsAppSDK-Samples into user/DinahK-2SO/storage_pickers_sample
The C# and C++ samples for the

Microsoft.Windows.Storage.Pickers
API.