我有一个带有动画的 UWP 项目,在将我的工作站升级到 Windows 10 Fall Creators 更新之前效果很好。该应用程序构建良好,但是当我运行它并点击“即将推出”时,而不是播放动画,现在我得到了一个例外。我正在运行 Visual Studio 2017,我的构建目标是 Fall Creators。这是 XAML 页面:<Pagex:Class="WaterCooler.JeopardyView"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:local="using:WaterCooler"xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"mc:Ignorable="d"><Page.Resources> <local:StringToUpperConverter x:Key="StringToUpperConverter"/> <Storyboard x:Name="ClueReveal" Completed="ClueReveal_Completed"> <DoubleAnimation EnableDependentAnimation="True" Storyboard.TargetName="ClueGrid" Storyboard.TargetProperty="Grid.Height" From="0.0" To="300.0" Duration="0:0:1"/> <DoubleAnimation/> </Storyboard> <Storyboard x:Name="ClueHide" Completed="ClueHide_Completed"> <DoubleAnimation EnableDependentAnimation="True" Storyboard.TargetName="ClueGrid" Storyboard.TargetProperty="Grid.Height" From="300.0" To="0.0" Duration="0:0:1"/> </Storyboard></Page.Resources><Grid Padding="0" Width="300" Height="600" Tapped="Grid_Tapped"> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition/> </Grid.RowDefinitions> <Grid Width="300" Height="300" BorderBrush="Black" BorderThickness="10" Background="Blue" Tapped="Grid_Tapped">
1 回答
暮色呼如
TA贡献1853条经验 获得超9个赞
这里有一个小问题。您不小心在第一个下方添加了一个空的双动画DoubleAnimation:
<Storyboard x:Name="ClueReveal" Completed="ClueReveal_Completed">
<DoubleAnimation
EnableDependentAnimation="True"
Storyboard.TargetName="ClueGrid"
Storyboard.TargetProperty="Grid.Height"
From="0.0" To="300.0" Duration="0:0:1"/>
<!-- REMOVE THIS <DoubleAnimation/> -->
</Storyboard>
这DoubleAnimation是空的,没有指定目标,这会导致异常 :-) 。
- 1 回答
- 0 关注
- 146 浏览
添加回答
举报
0/150
提交
取消