I need to create an ordering list having as elements strings and images (some items are text, other -images). I have to configure this list from code behind, not in xaml. I created a class :
public class SimpleChoicePair
{
public SimpleChoice Choice { get; set; }
public FrameworkElement Content { get; set; }
}
where as Content I have TextBlock or Image objects. My listbox looks like:
var listboxChoices = new ListBox();
var list = new ObservableCollection();
listboxChoices.DisplayMemberPath = "Content";
listboxChoices.ItemsSource = choicesList;
But the items in the list display only the class name of TextBlock or Image. How can I display the uiElements themselves? Thanks for any help