-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
File picker and bookmarks API #8303
Conversation
You can test this PR using the following package version. |
Nice! |
Does it finally support multi folder selection? #7209 |
No. Main goal to have mobile/wasm compatible API. |
If you rewrite the whole API and obsolete existing API, wouldn't it make sense to look at existing issues and make sure they don't exist in the new one too? When, if not now, is the best chance for that? |
I don't think I have seen anywhere multi-folder picker API in xplat frameworks. And overall usefulness seems low. |
No idea what xplat frameworks is. But multi folder picker is a common thing on Windows and MacOS and Linux (basically all desktop environments). Winforms support it therefore also WPF. WinUI currently seem to not support it, because it comes from UWP which also hasn't supported it but it was also requested. For mobile it might not make much sense but I have never used a mobile app that asked me to select a folder at all, because working with folders on mobile devices is quite uncommon. |
I really think we will need some docs how to handle this once it is ready. What do you think @maxkatz6 ? |
Demo of file picker with bookmarks (reusing same file without opening picker again). 1.mp4 |
This PR can now be tested, if anybody wants to try. I have to update macOS implementation to support file types. And test macos/ios once more. |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
@@ -76,21 +76,21 @@ | |||
<StackPanel Orientation="Vertical" Margin="10"> | |||
<Label Target="upDown" FontSize="14" FontWeight="Bold" VerticalAlignment="Center">Usage of decimal NumericUpDown:</Label> | |||
<NumericUpDown Name="upDown" Minimum="0" Maximum="10" Increment="0.5" | |||
CultureInfo="en-US" VerticalAlignment="Center" Value="{Binding DecimalValue}" |
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.
Removed default culture info, as it was crashing control catalog in the browser.
You can test this PR using the following package version. |
You can test this PR using the following package version. |
From what I understand, this API will also be used later to provide access to e.g. a Share dialog, which isn't a "file picker" or related to the "file system", so |
You can test this PR using the following package version. |
/// <summary> | ||
/// Gets or sets the file name that the file save picker suggests to the user. | ||
/// </summary> | ||
public string? SuggestedFileName { get; set; } |
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.
I think it's valid for both save and open dialogs
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.
For "open" dialog it should be "SelectedFile" or something of IStorageFile type. We can add it later on top of that api.
/// <summary> | ||
/// Gets or sets the initial location where the file open picker looks for files to present to the user. | ||
/// </summary> | ||
public IStorageFolder? SuggestedStartLocation { get; set; } |
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.
Could we move Title and SuggestedStartLocation to a common base class?
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.
Yep
You can test this PR using the following package version. |
What does the pull request do?
Initial implementation of new file picker API.
API layer was also inspired by HTML5 browser File API and naming from UWP.
Xamarin Essentials, Qt, Electron and react-native-document-picker were used as a reference for implementation (aside from native API docs).
Current progress:
Out of this PR, but to be done in this release:
Potentially in the future:
Usage:
Checklist
Breaking changes
None
Obsoletions / Deprecations
SystemDialog and OpenFileDialog/SaveFileDialog/OpenFolderDialog are obsolete now.
Fixed issues
Fixes #7234
Fixes #7209
Questions
Q: Should I rename
topLevel.StorageProvider
totopLevel.FilePicker
with related interface names? OrFileSystem
? OrFileManager
to match other*Manager
classes.Q: Should API be change in order to allow opening dialogs without window/toplevel at all? It's possible only on desktop.
Q: Replace bool properties with enum flags?