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


Prasham SabadraRank #116 · 19.3K reputationPosted Feb 12, 2015, 8:53 PM EST
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
Pranay RanaRank #735 · 3.2K reputationPosted Feb 12, 2015, 8:53 PM EST
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
Shajahan Pothuvachola32 reputationPosted Feb 13, 2015, 5:51 PM EST
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....
Shajahan Pothuvachola32 reputationPosted Feb 13, 2015, 5:53 PM EST