Note that there are some explanatory texts on larger screens.

plurals
  1. POConverter failed to convert value of type 'Windows.Foundation.String' to type 'ImageSource'
    primarykey
    data
    text
    <p><strong>This is for my Windows 8 app:</strong></p> <p>In my object I have a string property that contains the path of the images I want to use.</p> <pre><code>public String ImagePath </code></pre> <p>In my XAML I have set up an Image tag with the following binding:</p> <pre><code>&lt;Image Source="{Binding ImagePath}" Margin="50"/&gt; </code></pre> <p>When I reference an image that I've included in my project (in the Asset folder) the image displays correctly. The path is: <code>Assets/car2.png</code></p> <p>However, when I reference an image that the user selects (using the FilePicker) I get an error (<strong>and no image</strong>). The path is: <code>C:\Users\Jeff\Pictures\myImage.PNG</code></p> <blockquote> <p>Converter failed to convert value of type 'Windows.Foundation.String' to type 'ImageSource'</p> </blockquote> <p>Just to add a little more info. When I use the file picker I am converting the file location to a URI:</p> <pre><code> Uri uriAddress = new Uri(file.Path.ToString()); _VM.vehicleSingle.ImagePath = uriAddress.LocalPath; </code></pre> <p><strong>Update:</strong> </p> <p>I'm also saving this image path to isolated storage. I think this is where the issue is. I'm able to save the path of the file selected, but when I try to bind to it when I'm reloading the Isolated Storage it doesn't work. </p> <p>So if I can't use an image outside of the application directory. Is there a way I can save that image and add it to the directory?</p> <p>I tried creating a BitmapImage property to my model but now I'm getting errors stating that it can't serialize a BitmapImage. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload