Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

How to load image from asset catalog in code behind.

$
0
0

I am using Xamarin.Forms (latest version). My images are organized in asset catalogs.

I have splash screen images in Resources\Images.xcassets\LaunchImage.launchimage asset catalog. Images have build action set to ImageAsset.

How to load image in code behind, in for example ContentPage, from asset catalog?

I tired: myViewModel.BackgroundImage = @LaunchImage.launchimage/Default.png; and other combinations but without success.

Thanks in advance.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>