点击事件处理程序不起作用

时间:2014-04-20 12:55:18

标签: windows-phone-7 windows-phone-8 windows-phone-7.1

我想为我的应用使用点击选项,但我无法让它工作......

XAML

<Rectangle Name="rectangle4" Visibility="Collapsed" />
<Canvas Name="currentPanel" Tap="currentPanel_Tap" >
    <Rectangle Name="rectangle3" Visibility="Visible" />
    <TextBlock Name="currentBlock" Visibility="Visible" />
    <Image Name="image7" Visibility="Visible" />
</Canvas>
<StackPanel Name="optionsPanel" Visibility="Collapsed">
    <TextBlock Name="option1Block" />
    <TextBlock Name="option2Block" />
    <TextBlock Name="option3Block" />
    <TextBlock Name="option4Block" />
    <TextBlock Name="option5Block" />
    <TextBlock Name="option6Block" />
</StackPanel>

CODE

private void currentPanel_Tap(object sender, GestureEventArgs e)
    {
        rectangle4.Visibility = Visibility.Visible;
        optionsPanel.Visibility = Visibility.Visible;
        image7.Source = new BitmapImage(new Uri("/MyApp;component/Images/Small/drop%20down.png", UriKind.RelativeOrAbsolute));
    }

当点击画布的内容时,没有任何反应......我做错了什么?

0 个答案:

没有答案