Open perfect100 opened 3 months ago
What is the use case for this? The whole point of the file picker is to pick a file. You as a consumer of the file picker don't generally care what the file is as long as it matches your filters. If you want to do nothing when someone picks a specific option then you should just not offer the option?
@thevortexcloud typical use case would be to provide user a choice of different file types to save (.png, .jpg...), where app will get this index and actually save in a correct format after the picker. In case if app developer doesn't want to rely on extension.
But that's for Save file dialog. Not Open.
And I am not sure if we can implement this feature properly on most of platforms. Needs to be double checked.
Other than that, another (possibly better?) alternative would be to add MimeType property to the IStorageFile. Which is useful for both open/save scenarios. Also, should implementable pretty much everywhere, even on browser.
Is your feature request related to a problem? Please describe.
Assume that we want to import file from a file picker. Firstly we need to set the filters.
If user select
all
, I will do nothing...Currently, the only way to get the filter index is matching the file extension name.
Describe the solution you'd like
Get the filter index from IStorageFile directly.
Describe alternatives you've considered
No response
Additional context
No response