Windows Phone 7 listpicker itemsource模板问题
我试图让列表选择器显示 iList 中的属性。当我运行应用程序时,出现的是绑定信息..不是那个属性..
这是xaml
<phone:PhoneApplicationPage.Resources>
<DataTemplate x:Name="lpkItemTemplate">
<TextBlock Text="{Binding Operation}" />
</DataTemplate>
<DataTemplate x:Name="lpkFullItemTemplate">
<TextBlock Text="{Binding Operation}" />
</DataTemplate>
</phone:PhoneApplicationPage.Resources>
<toolkit:ListPicker x:Name="lbOperation" Header="Operations" SelectedIndex="0"
FullModeItemTemplate="{Binding lpkFullItemTemplate}"
ItemTemplate="{Binding lpkItemTemplate}"
Grid.Row="5"
>
和背后的代码,
Dim Os As List(Of wsOperation.Operation) = e.Result
Me.lbOperation.ItemsSource = Os
我认为这是一个模板错误,因为列表中的行数是当我单击列表选择器时出现。但我询问的属性(“操作”)不显示数据。相反,我显示了大约 10 行 wsOperation.Operation。
谢谢 香农
~~~~~~~~~ 也许更多的信息将有助于找到可能的解决方案 时列表选择器显示的内容..这就是列表选择器显示的内容
运行此页面ProcWP.wsOperation.Operation
这是当我单击上面的行时
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
I'm trying to get the listpicker to show a property that is in an iList. When i run the app, what comes up instead is the binding info.. not that property..
Here is the xaml
<phone:PhoneApplicationPage.Resources>
<DataTemplate x:Name="lpkItemTemplate">
<TextBlock Text="{Binding Operation}" />
</DataTemplate>
<DataTemplate x:Name="lpkFullItemTemplate">
<TextBlock Text="{Binding Operation}" />
</DataTemplate>
</phone:PhoneApplicationPage.Resources>
<toolkit:ListPicker x:Name="lbOperation" Header="Operations" SelectedIndex="0"
FullModeItemTemplate="{Binding lpkFullItemTemplate}"
ItemTemplate="{Binding lpkItemTemplate}"
Grid.Row="5"
>
and the code behind
Dim Os As List(Of wsOperation.Operation) = e.Result
Me.lbOperation.ItemsSource = Os
i'm thinking it is a template error because the number of rows in the list is the number that comes up when i click on the listpicker.. but the property i've asked ("Operation") is not displaying the data. Instead i get ~10 rows of wsOperation.Operation showing up.
thanks
shannon
~~~~~~~~~
maybe a little more info will help with a possible solution
Here is what the listpicker shows when i run this page
ProcWP.wsOperation.Operation
when i click on the above line.. this is what the listpicker shows
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
ProcWP.wsOperation.Operation
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题的答案就在工具包里:ListPicker。我需要将 {Binding lpkFullItemTemplate} 更改为 {StaticResource lpkFullItemTemplate} 并与 itemTemplate 相同
,所以现在看起来像这样
the answer to this problem was in the toolkit:ListPicker. I needed to change the {Binding lpkFullItemTemplate} to {StaticResource lpkFullItemTemplate} and same with itemTemplate
so it looks like this now