Skip to content
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

Fix ManagedStorageProvider OverwritePrompt behaviour #18076

Conversation

FishEagle
Copy link
Contributor

@FishEagle FishEagle commented Jan 29, 2025

What does the pull request do?

Fix issue with Avalonia.Dialogs.ManagedStorageProvider where it returns null, instead of the file selected, when the user choose to overwrite an existing file. As reported here: #17959

What is the current behavior?

Discards filename when the OverwritePrompt result is true.

What is the updated/expected behavior with this PR?

Returns filename so that SaveFilePickerAsync() result can be built correctly.

To test:

  1. Ensure you are using Managed System Dialogs (e.g. AppBuilder.UseManagedSystemDialogs() )
  2. var file = await storageProvider.SaveFilePickerAsync(...) should return the file selected to be overwritten, instead of null

Checklist

  • Added unit tests (if possible)? The fix is fairly straightforward. I tried to implement tests, but could not quite get it working for the dialog - would appreciate guidance on whether it is necessary and how to do it for this component, if needed.
  • Added XML documentation to any related classes? N/A
  • Consider submitting a PR to https://github.com/AvaloniaUI/avalonia-docs with user documentation N/A

Breaking changes

None

Obsoletions / Deprecations

None

Fixed issues

Fixes #17959

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0054609-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@cla-avalonia
Copy link
Collaborator

cla-avalonia commented Jan 29, 2025

  • All contributors have signed the CLA.

@FishEagle
Copy link
Contributor Author

@cla-avalonia agree

@FishEagle FishEagle force-pushed the fixes/17959-managed-storage-provider-save-file-picker branch from 9b1f6fc to cf104d2 Compare January 30, 2025 07:40
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0054631-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added bug backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Jan 30, 2025
Copy link
Member

@maxkatz6 maxkatz6 left a comment

Choose a reason for hiding this comment

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

Thanks!

@maxkatz6 maxkatz6 added this pull request to the merge queue Jan 30, 2025
Merged via the queue into AvaloniaUI:master with commit 874c99f Jan 30, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SaveFilePickerAsync select overwritefile, return result is null
4 participants