Skip to content

Conversation

DinahK-2SO
Copy link

@DinahK-2SO DinahK-2SO commented Sep 10, 2025

The C# and C++ samples for the Microsoft.Windows.Storage.Pickers API.
image

@DinahK-2SO DinahK-2SO self-assigned this Sep 10, 2025
@DinahK-2SO DinahK-2SO marked this pull request as ready for review September 26, 2025 08:13
{
var picker = new Microsoft.Windows.Storage.Pickers.FileOpenPicker(this.AppWindow.Id);

if (CommitButtonCheckBox.IsChecked == true)

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?

Copy link
Author

@DinahK-2SO DinahK-2SO Oct 2, 2025

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
image

Therefore, I am keeping it here.

{
string input = FileTypeFilterInput.Text?.Trim() ?? "";
if (string.IsNullOrEmpty(input))
return new string[] { "*" };

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();

Choose a reason for hiding this comment

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

same as above

Copy link

@Copilot 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 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>
Copy link

Copilot AI Sep 28, 2025

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.

Suggested change
<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>
Copy link

Copilot AI Sep 28, 2025

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\\.

Suggested change
<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>
Copy link

Copilot AI Sep 28, 2025

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.

Suggested change
<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'/>
Copy link

Copilot AI Sep 28, 2025

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.

Suggested change
<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.

Copy link
Author

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.

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.

4 participants