-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
Description
Describe the bug
The SuggestedStartLocation is not used by the StorageProvider window on macOS if the FileTypeChoices is set.
The SetAccessoryView in AvaloniaNative reset the directoryURL.
To Reproduce
In CatalogControl, modify the page DialogsPage.axaml.cs to set the SuggestedStartLocation :
this.Get<Button>("SaveFilePicker").Click += async delegate
{
var fileTypes = GetFileTypes();
var folderPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
var mainWindow = Application.Current?.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime ;
var topLevel = TopLevel.GetTopLevel(mainWindow.MainWindow);
var saveFolder = await topLevel.StorageProvider.TryGetFolderFromPathAsync(folderPath);
var file = await GetStorageProvider().SaveFilePickerAsync(new FilePickerSaveOptions()
{
Title = "Save file",
FileTypeChoices = fileTypes,
SuggestedStartLocation = saveFolder,
SuggestedFileName = "FileName",
ShowOverwritePrompt = true
});
Click open a file and select a folder (not the Documents one)
Then change the FileTypes combo to another value than None
And select Save a file. It will remain in the folder you selected in the Open a file
Expected behavior
If a SuggestedStartLocation is set, we need to go in this folder even if the filetypes is set.
Avalonia version
11.2.8, 11.3.1
OS
macOS
Additional context
No response
Tenjim