我很困惑为什么我的应用程序正在关闭,我添加了 PointerDownThemeAnimation 并且它工作正常但只有一次,当我尝试再次单击它时应用程序停止。为什么?
这是我的代码:
private void staryrynek1(object sender, PointerRoutedEventArgs e)
{
pointerDownStoryboard.Begin();
}
private void staryrynek(object sender, PointerRoutedEventArgs e)
{
pointerUpStoryboard.Begin();
this.Frame.Navigate(typeof(StaryRynek));
}
和
<Grid x:Name="staryrynek_grid" Margin="10,92,10,0" VerticalAlignment="Top" PointerPressed="staryrynek1" PointerReleased="staryrynek">
<Grid.Resources>
<Storyboard x:Name="pointerDownStoryboard">
<PointerDownThemeAnimation TargetName="staryrynek_grid" />
</Storyboard>
<Storyboard x:Name="pointerUpStoryboard">
<PointerUpThemeAnimation TargetName="staryrynek_grid" />
</Storyboard>
</Grid.Resources>
<Grid.Background>
<SolidColorBrush Color="Black" Opacity="0.495"/>
</Grid.Background>
<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Top" Width="380" FontSize="29.333" Text="Stary Rynek"/>
</Grid>