views:

267

answers:

2

I have a ListBox showing some objects associated each with some files. I also have a ListView of images linked to the listbox's selection. I would like the listview to show an icon corresponding to the filetype (an image for video, image, doc etc...) of each file with the filename below. I can figure out all the code except how to bind the image source to the image control and access it programmatically.I'm unable to access any controls from the datatemplate in my code-behind.

Thx

+1  A: 

Use a value converter which takes the file name with file type and return source of the image for that file type.

Wallstreet Programmer
A: 

Excuse me for the late reply. I ended up solving the problem with a template selector and setting a different template for every filetype

Sandy