WP8 如何获取LongListSelector内的名为“tbphone”textblock控件
当出发 SelectionChanged时,如何获取LongListSelector内的名为“tbphone”textblock控件
<phone:LongListSelector
SelectionChanged="selectchange"
Name="AddrBook"
JumpListStyle="{StaticResource AddrBookJumpListStyle}"
Background="Transparent"
GroupHeaderTemplate="{StaticResource AddrBookGroupHeaderTemplate}"
ItemTemplate="{StaticResource AddrBookItemTemplate}"
LayoutMode="List"
IsGroupingEnabled="true"
HideEmptyGroups ="true"/>
</phone:PanoramaItem>
<phone:PhoneApplicationPage.Resources>
<DataTemplate x:Key="AddrBookItemTemplate">
<StackPanel VerticalAlignment="Top">
<TextBlock FontWeight="Bold" FontSize="30" Text="{Binding DisplayName}" Margin="50,10,0,20"/>
<ListBox Name="listpn" ItemsSource="{Binding PhoneNumbers}">
<TextBlock Name="tbphone" Tag="tbp" FontSize="30" Text="{Binding PhoneNumber}"/>
</ListBox>
</StackPanel>
</DataTemplate>
</phone:PhoneApplicationPage.Resources> Windows?Phone?8
[解决办法]
抱歉,看错你问题了,上面的代码是WP7里面针对继承自ItemsControl的集合控件的。