0
我在这里为数据绑定挣扎Windows Phone 7.1。我有一个DataLoader
类,其中一个OnservableCollection
的ItemList
(自定义类)作为属性。因此,每个数据透视表项都有自己的项目列表。在这个DataLoader
中,我从JSON加载数据JSON。到现在为止还挺好。将代码数据绑定到XAML数据透视表框
public ObservableCollection<ItemList> PivotItem { get; set; }
在这里,我存放5 ItemList
,一个与他对应的产品清单每个枢轴头。
但我的问题是,我想要将这些数据绑定到每个PivotItem中的ListBox
的XAML。
<phone:Pivot Title="iMetrópolis" Loaded="Pivot_Loaded">
<!--Elemento Pivot 1-->
<phone:PivotItem
x:Uid="PivotItem1"
Header="Todo" Margin="14,10,10,18">
<ListBox x:Name="FirstListBox" ItemsSource="{Binding Items}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,0,0,17" Width="432" Height="78">
// I want to add textboxes binding my data
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</phone:PivotItem>
.
.
.
感谢您的答复!
感谢您的回复!但是'ListBox'使用'ItemsSource'作为'ItemsSource',但是PON和PIN从其他来源获取不同于'questions'对象(?)内的内容的值。那么,我有(例如一个标题(字符串)列表,我想用它作为我的'ItemsSource',但我想显示每个字符串在PON'TextBox'。 –
嗨,队友!我已经理解了整个绑定的事情,你的回复真的有用! –