I need to share an image across different pages of a Xamarin.Forms app.
I am unable to reuse both the ImageSource and stream after loading an image on a page. Hence, I need to load the same image on other pages as well.
I have posted a related issue here.
Here's some code:
public PhotoCapturedViewModel(IScreen screen, Stream stream) : base(screen, "")
{
Photo = ImageSource.FromStream(() => stream); // This stream was already used on another page
Apply = new DelegateCommand(_ => Publish(APPLY_PHOTO, new RenderedPhoto(stream, Description)));
}