Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display List of WPF Objects in C#

Tags:

c#

wpf

xaml

This is hard to explain, and I am still pretty novice so I am apologies in advance.

Is there a way to take a WPF XAML document and display a list of them in a listBox?

Like if I wanted to make a contact list. I could create a .xaml file with the stuff I want (Icon, String to hold name, icon to show cell/home/pager) then call in to a list as if it were a class that I am making an instance off to fill the list.

Any help, even just a name, pattern or keyword to lookup, would be extremely helpful.

Thanks, Dane

like image 429
OmegaNine Avatar asked Dec 04 '25 10:12

OmegaNine


1 Answers

What you are looking for is called an ItemTemplate. It's a description of what each item in your collection should look like in your view.

A nice tutorial can be found here.

like image 154
nvoigt Avatar answered Dec 05 '25 23:12

nvoigt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!