In my app I download images using dependency service into platform tmp app (in ios, going to implement android version latter), then I load try to show the downloaded images but the If i Bind the image path to a Image control in xaml it never shows the image. By the way im storing a partial path to the image and at runtime i get the full path, the flow is like this:
- Download image with dependency service using NSUrlSession.
- Move the image to /Caches/ directory in my app root.
- Save that partial path like "/Caches/img1.jpg" in a db
- Load a view at my app and get the image from the db.
- Build the full image path like "file:///Users/mbuild/Library/Developer/CoreSimulator/Devices/BF78E8FE-16D2-4F85-9C64-E8DCC98848F6/data/Containers/Data/Application/570C1598-6EBC-40CC-833E-50478E70FD7C/Library/Caches/53d09f9f-531d-4412-87cb-41a26d986e4e-1513113235590-img_0151.jpg" I try with and without "file://" also try it on a device because this is a simulator path.
- Use that path like a viewmodel string property like "ImgSrc"
- Bind the property to a Image control in several ways like:
<Image Source="{Binding ImgSrc}" /> OR <Image HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Aspect="AspectFit"> <Image.Source> <FileImageSource File="{Binding ImgSrc}" /> </Image.Source> </Image>
I dont know what im doing wrong
Any Ideas?