Hello everyone , how can i set a picture in attribute in an object for example if i have this objectpublic class Employee { public string Nom { get; set; } public string Prenom { get; set; } public Image Img { get; set; } }
L.Add(new Employee { Nom = "Nourddine", Prenom = "Lagouit",What i need here ?! }); ListE.ItemsSource = L;
how can i set an image here
and sorry for my english
Hi,
If the image is in your sources, you need :
1. Your class should be like : public class Employee { public string Nom { get; set; } public string Prenom { get; set; } public string Img { get; set; } }
2. Fill dataL.Add(new Employee { Nom = "Nourddine", Prenom = "Lagouit", Img="your_img.png"}); // .png .jpg ..... ListE.ItemsSource = L;
3. To bind it use Source="{Binding Img}"
in your xaml page.
Hope that helps.
Mabrouk.
Answers
Hi,
If the image is in your sources, you need :
1. Your class should be like :
public class Employee { public string Nom { get; set; } public string Prenom { get; set; } public string Img { get; set; } }
2. Fill data
L.Add(new Employee { Nom = "Nourddine", Prenom = "Lagouit", Img="your_img.png"}); // .png .jpg ..... ListE.ItemsSource = L;
3. To bind it use
Source="{Binding Img}"
in your xaml page.Hope that helps.
Mabrouk.
thanks man this is a great idea