-
Notifications
You must be signed in to change notification settings - Fork 395
Open
Description
Describe the bug
The default extension is always the first item in FileTypeChoices. Also, FileTypeChoices is always sorted, ignoring the original order!
var saveDialog = new FileSavePicker(AppWindow.Id)
{
DefaultFileExtension = ".xml",
};
saveDialog.FileTypeChoices.TryAdd("TXT", [".txt"]);
saveDialog.FileTypeChoices.TryAdd("JSON", [".json"]);
saveDialog.FileTypeChoices.TryAdd("XML", [".xml"]);
var picker = await saveDialog.PickSaveFileAsync();Steps to reproduce the bug
Can reproduce with WinUI 3 Gallery:
Expected behavior
The selected extension of "Save as File" dropdown must match in this order:
- The extension from
SuggestedFileName, if it's defined in theFileTypeChoices - The
DefaultFileExtensionif it's defined in theFileTypeChoices.
Screenshots
NuGet package version
Windows App SDK 1.8.2: 1.8.251003001
Packaging type
Unpackaged
Windows version
Windows 11 version 24H2 LTSC (26100, June Update)
IDE
Other, Visual Studio 2022
Additional context
No response
