![](/img/trans.png)
[英]Items Data Binded to LongListSelector/Listbox not showing in windows phone 8 local database
[英]Longlistselector dynamically update not binded items
我有一個longlistselector綁定到我的班上。 在項目模板中,我有textblock,它沒有綁定到類中的任何字段。
有什么方法可以在列表上迭代並用數據填充該文本塊?
像這樣:
foreach (var item in myList)
{
item.textblock = SomeMethod(item.field);
}
<phone:LongListSelector x:Name="Name" ItemsSource="{Binding MyCollection}" Margin="0,0,-12,0">
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<StackPanel Margin="0,0,0,17">
<TextBlock Text="{Binding PropertyTitle}" TextWrapping="NoWrap"
Style="{StaticResource PhoneTextExtraLargeStyle}" />
</StackPanel>
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
</phone:LongListSelector>
其中PropertyTitle是您的財產的名稱
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.