Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.


Hi, I've been trying to get an image inside of a frame to display onscreen. Currently, I have a property in my ViewModel which is bound to from Xaml. When the image source is set in Xaml to a local file instead of this bindable source, the image displays just fine, but when the bindable property is used, there is no image, no error, or anything else suggesting a problem - just no image.

_currentRecipe = await _recipeWebService.GetRecipe ();
_backRecipe = await _recipeWebService.GetRecipe ();
var currentPhotoStream = _currentRecipe.PhotoStream;
currentPhotoStream.Position = 0;
FrameImage1 = ImageSource.FromStream(()=>currentPhotoStream);
catch(Exception exception) {
Debug.WriteLine (exception.ToString());

This is the current code I am using to change the bound property. I'm truly at a loss on how to fix this. The stream is of the correct length according to the web-server, and saving the stream into a file that I exported using Android Device Monitor resulted in a valid jpg file on my workstation tat opened normally.



  • ManojkumarMaliManojkumarMali USMember ✭✭✭

    Try this...
    Except FrameImage1 use Xamarin.Forms.Image control.
    In view model;
    public Xamarin.Forms.ImageSource PhotoStream { get; set; }
    Convert stream to image and assign to view model;
    PhotoStream = ImageSource.FromStream(()=>new MemoryStream(imageStream));
    Assign image like;

Sign In or Register to comment.