how to make a windows phone app with LongListSelecter shows images and texts

35 Views Asked by At

i am trying to make an app contain a long list selector that show list of people name phone number and image. i succeed to show only name and phone number but i couldn't find out a way to show images along with the strings .with observable collection i can only show pictures and with list method i can only make names and phone numbers. What should i do? here is my code

InitializeComponent();
List<SpeedDial> speeddial = new List<SpeedDial>();
speeddial.Add(new SpeedDial ( "deepu", "43" ));
speeddial.Add(new SpeedDial ( "anoop","32" ));
speeddial.Add(new SpeedDial ( "abhilash","76"  ));
SpeedDialLLS.ItemsSource = speeddial;
1

There are 1 best solutions below

1
Chirag Shah On

In the speeddial class add another proprty that holds the image of the corresponding contact. Then in the longlistselector itemtemplate add image control which has its source property binded to the image property that you created in speedial class.