使用 windows phone 上的按钮隐藏边框和文本块

Hide border and textblock with a button on windows phone

我想让边框和文本块在单击按钮时消失,而在再次单击按钮时边框和文本块出现。

这是我的 xaml:

<Border x:Name="descbox" Background="#A6CFC9A8" Height="80" VerticalAlignment="Bottom" Visibility="Visible" Margin="0,-100,0,0">
    <ScrollViewer VerticalScrollMode="Auto" Height="auto" Margin="0,0,0.333,0" HorizontalScrollBarVisibility="Visible">
        <StackPanel Width="548">
            <TextBlock x:Name="desc" Text="{Binding Description}" FontFamily="verdana" FontSize="19" Foreground="#CC000000" TextWrapping="Wrap" Padding="0,10" TextAlignment="Justify" Margin="0,0,10.333,0"/>
        </StackPanel>
    </ScrollViewer>
</Border>

<Button Content="Button"/>

如何在 windows phone 8.1 中实现?

XAML :

<Button Content="Button" Click="Button_Click"/>

代码:

private void Button_Click(object sender, RoutedEventArgs e)
{
    if (descbox.Visibility == Visibility.Visible)
        descbox.Visibility = Visibility.Collapsed;
    else
        descbox.Visibility = Visibility.Visible;
}