当前位置: 代码迷 >> Windows Mobile >> WP8 怎么获取LongListSelector内的名为“tbphone”textblock控件
  详细解决方案

WP8 怎么获取LongListSelector内的名为“tbphone”textblock控件

热度:25   发布时间:2016-04-25 07:22:51.0
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>