I am styling the ListPicker
with a DataTemplate
. All the examples I have read assume that the ListItems are bound complex objects and so can refer to properties on the objects using the usual Binding Property
syntax. e.g.
this.myListPicker.Items.Add(new Profile() { Name = "Joe",
Occupation="Button pusher" });
and in the XAML,
<DataTemplate>
<StackPanel>
<TextBox Text="{Binding Name}" />
<TextBox Text="{Binding Occupation}" />
</StackPanel>
</DataTemplate>
However my ListPickers are bound to a List
of simple strings
and there does not seem to be a property on the string that actually refers to the string.
How do I get a handle to the string inside the DataTemplate
so that I can assign them to a e.g. TextBox
in the template?