Feature Request - Default Search Directory for UWP Icons (Platform Specific)

JamesMontemagnoJamesMontemagno USForum Administrator, Xamarin Team, Developer Group Leader Xamurai
edited July 2018 in Xamarin.Forms

I would really like to put all of my icons/images inside of the Assets folder, however this creates some not so great looking code:

<Image>
                <Image.Source>
                    <OnPlatform x:TypeArguments="ImageSource">
                        <On Platform="iOS" Value="icon_twitter.png"/>
                        <On Platform="Android" Value="icon_twitter.png"/>
                        <On Platform="UWP" Value="Assets/icon_twitter.png"/>
                    </OnPlatform>
                </Image.Source>
            </Image>

Ideally I would like to do:

<Image Source="icon_twitter.png"/>

I could do this if I put it into the UWP root, but that clutters up the project if it is large.

I would like something like:

On<UWP>().SetImageSearchDirectory("Assets");

Then my nice pretty Image would work.

Linked to: https://github.com/xamarin/Xamarin.Forms/issues/3228

Tagged:

Open · Last Updated

Sign In or Register to comment.