mardi 5 mai 2015

WPF Using Image Control to dynamically view Online images

Situation

I'm trying to use an image control in my program that accesses an online image by binding it to a property.

XAML:

<Image Source="{Binding TheImage}" x:Name="imgPic" HorizontalAlignment="Left" Height="113" Margin="14,89,0,0" VerticalAlignment="Top" Width="120"/>

Specifically, I'm binding to the return value of the searchMembers method (which returns an object) mempic contains a URL, and this mempic will change depending on which member is currently logged in.

View Model:

public Uri TheImage
        {
            get { return new Uri(hillracing.searchMembers(Username).mempic); }
        }

Problem

Neither this code, or a static link to the image actually works.

Here is the test image I'm actually using http://ift.tt/1Pl9nRO

wondered if anyone could tell em what I was doing wrong.

thanks.




Aucun commentaire:

Enregistrer un commentaire