-
Notifications
You must be signed in to change notification settings - Fork 769
Open
Labels
area-CommandingAppBar, UICommand, MVVM, etcAppBar, UICommand, MVVM, etcarea-ImagesImages, SVGImages, SVGarea-NavigationViewNavView controlNavView controlfeature proposalNew feature proposalNew feature proposalneeds-winui-3Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)team-ControlsIssue for the Controls teamIssue for the Controls team
Description
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.
public class BitmapStreamIconSource : IconSource
{
public BitmapStreamIconSource();
protected Task<RandomAccessStream> GetStreamAsync(float scaleFactor);
}
adrientetar, groege, jazzdelightsme and manfromarce
Metadata
Metadata
Assignees
Labels
area-CommandingAppBar, UICommand, MVVM, etcAppBar, UICommand, MVVM, etcarea-ImagesImages, SVGImages, SVGarea-NavigationViewNavView controlNavView controlfeature proposalNew feature proposalNew feature proposalneeds-winui-3Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)Indicates that feature can only be done in WinUI 3.0 or beyond. (needs winui 3)team-ControlsIssue for the Controls teamIssue for the Controls team