隐藏ListView的DataTemplate中的所有文本框

时间:2015-07-06 08:28:47

标签: c# xaml listview windows-runtime windows-phone

我正在编写 Windows Phone 8.1(WINRT)应用。我使用 ListView 来填充项目:

此ListView的DataTemplate为:

<ListView x:Name="EquipmentListView"
DataContext="{Binding}">                    
    <ListView.ItemTemplate>
        <DataTemplate>
            <Border>
                <Grid x:Name="ViewGrid">
                    <Grid.RowDefinitions>
                    <RowDefinition Height="Auto">                                            
                    </RowDefinition>
                    <RowDefinition Height="*">
                    </RowDefinition>
                    </Grid.RowDefinitions>
                        <Grid x:Name="ViewGridTitle"
                        Grid.Row="0" Tapped="ViewGridTitle_Tapped" >
                            <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                                <TextBlock Text="{Binding EquipmentTitle}" 
                                Grid.Column="0" >
                                </TextBlock>
                                <Image  Grid.Column="1" 
                                x:Name="ArrowHolder"                                              
                                Source="ms-appx:///Images/ic_arrow_down.png"  >
                                </Image>
                        </Grid>
                        <TextBlock Text="{Binding EquipmentDetails}" 
                        Grid.Row="1"   
                        x:Name="EquipmentDetails">
                        </TextBlock>
                </Grid>
            </Border>
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

点击任何 ViewGridTitle 后,listView中的所有 EquipmentDetails textblocks 都应隐藏。 怎么做?

0 个答案:

没有答案