Open dotMorten opened 5 years ago
@dotmorten is this blocking you from being able to adopt NavigationView in Xamarin? That would help inform the priority of this feature request.
@jevansaks It's blocking me from using icons for sure. I could switch to use image controls, but these icons are used in quite a lot of places, and would be the natural thing to use. It's forcing users who write xplat code to always use the same sort of xamarin.forms image (on-disk and packages with app as content), as all the other ones aren't possible, and thus rendering blank.
Here's the limitation in Xamarin.Forms: https://github.com/xamarin/Xamarin.Forms/blob/54b082198c7a367a037fe9f784feeed609b0aea5/Xamarin.Forms.Platform.UAP/FileImageSourcePathConverter.cs#L10
Only Forms' FileImageSource is able to convert to an IconSouce. All the other image sources are stream based.
Reassigning this request to @ryandemopoulos to help route to the best owner.
Thanks @dotMorten . Our team is pretty heads-down with Build coming next week, but we'll take a look at this soon (probably later next week).
@ryandemopoulos Sounds good. I'll also be there all next week, if you want to chat face-to-face
Just wanted to ask about the status of this issue => any idea if an when this will be done?
Proposal: Create IconSource from Bitmap stream
Summary
Currently we can only create IconSources from bitmaps on disk or Uri endpoing. There's no way to create IconSources from arbitrary streams (like embedded resources), or pulling from a URI that needs custom authentication.
Rationale
Porting Xamarin.Forms' Shell to UWP, I'm hit with this limitation where icons are packaged differently with the app, and there's no guarantee that an icon is available on disk. This means that in many scenarios the icons are rendered blank because there's no URI to map the resource to.
Functional Requirements
Syncronous instantiation to allow converters to return the correct type. Can be loading pixels on-demand and async if needed, with knowledge of the DPI required.