Ok, this is an embarassingly simple-looking problem, but is driving me crazy. I\'m learning about DataTemplating and am trying to apply a very VERY simple ItemTemplate to a List
ItemTemplate
wont work when you put ListBoxItem
directly as items. General concept is you databind a CRL collection to the ListBox.ItemsSource
and then specify the ItemTemplate
. Check the below code.
Bob
Jim
Dave
Larry
Tom
where sys
is xmlns:sys="clr-namespace:System;assembly=mscorlib"
In this way, there are 5 ListBoxItems
getting generated in the background and added to the ListBox
.