iam using wpf xaml form
i need to view images in listbox or listview ......iam saved images in a folder in debug and stored the path of image in table...........is there is any way to load images to listbox without binding ?...i need to know that dynamically how it do? please help
Loading

Shajahan PothuvacholaPosted Feb 13, 2015, 10:53 PM
Shajahan PothuvacholaPosted Feb 13, 2015, 10:51 PM
This method is correct but ....i cant get the selected items value.....by doing get set...and also if i update the datatable then listbox cannot refresh through get set method.we want to re-load form ....without reloading i needed.........
thank you....
Pranay RanaPosted Feb 13, 2015, 1:53 AM
datatemplate will be like
<DataTemplate x:Key="DataTemplateItem">
<Canvas Width="236" Height="48">
<Image Source="{Binding imagepath}" Height="32"
Width="32" Canvas.Left="8" Canvas.Top="8"/>
<TextBlock Text="{Binding Name}"
Canvas.Left="56" Canvas.Top="8" Width="172"/>
Canvas>
DataTemplate>
<ListBox ItemTemplate="{DynamicResource DataTemplateItem}" ItemsSource="{Binding Items}"/>
public class Item
{
public string imagepath { get; set; }
public string Name { get; set; }
}
you can check this article : http://www.progware.org/Blog/post/ListBoxes-with-DataBound-Images-in-WPF.aspx
Prasham SabadraPosted Feb 13, 2015, 1:53 AM
I didn't tried but please have a look once on following articles, hope those will help you.
https://social.msdn.microsoft.com/Forums/vstudio/en-US/610cb105-f724-4156-8b39-1da6c9641170/wpf-listbox-display-image-using-a-keyvaluepairs-value-as-image-source?forum=wpf
http://tiku.io/questions/1722697/show-images-in-wpf-listbox