Quantcast
Viewing all articles
Browse latest Browse all 18858

WPF, image source data binding from a string

Hi, here is what I am trying to do:

 

I have a .xaml form with Image in it.

        <Image Height="150" HorizontalAlignment="Left" Name="image" Stretch="Fill" VerticalAlignment="Top" Width="196" Margin="12,64,0,0"
               Source="{}"/>

 

In the same project, I have a file named test_data.cs which has a class with a string that contains a link to an image

using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace TestApp_WPF_WTF
{publicclass Test_data
  {publicstring imageLocation = "http://www.digitaltrends.com/wp-content/uploads/2010/07/starcraft2_logo.jpg";

  }
}

 

I would like the Source property of Image class to be filled with the value of imageLocation variable from Test_data class.  Could some one please help me with the correct way to do it?


Viewing all articles
Browse latest Browse all 18858

Trending Articles