I have the attached C# code written within my Silverlight 4.0 out of browser with elevated trust application that loops through files within the MyPictures filesystem directory and writes them to a collection for display.
How can I alter this code to display a single image file (not a collection) from a path (located within the MyPictures directory) written against a data item within my database? Currently I can pull item data (string, int bindings etc) onto my page but I don't know how to pull an image file (located in my local filesystem) from a path written against my data item. The attached code is taken from the below web page:
It displays a collection of image files from the local filesystem (MyPictures) but how can I alter this to simply show a single image file from my data source?
string path = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
foreach (string dir in Directory.EnumerateDirectories(path))
TreeViewItem item = new TreeViewItem();
item.Header = dir.Substring(dir.LastIndexOf('\\') + 1);