I have a UWP project with an animation that worked fine prior to upgrading my workstation to the Windows 10 Fall Creators update. The app builds fine, but when I run it and tap on "Coming Soon", instead of the animation playing, now I get an exception.
I am running Visual Studio 2017 and my build targets Fall Creators.
Here is the XAML page:
<Page
x: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">
<controls:DropShadowPanel Grid.Row="0" BlurRadius="0.0" ShadowOpacity="1.0" OffsetX="3" OffsetY="3" Color="Black" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="35" Foreground="White" FontWeight="ExtraBold" FontFamily="MS Sans Serif" Text="{Binding FallbackValue='COMING SOON', Converter={StaticResource StringToUpperConverter}}" />
</controls:DropShadowPanel>
</Grid>
<Grid x:Name="ClueGrid" Width="300" Height="0" BorderBrush="Black" BorderThickness="10 5 10 10" Background="Blue" Grid.Row="1" VerticalAlignment="Top">
<controls:DropShadowPanel BlurRadius="0.0" ShadowOpacity="1.0" OffsetX="5" OffsetY="5" Color="Black" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock FontSize="90" Foreground="Goldenrod" FontWeight="ExtraBold" FontFamily="MS Sans Serif" Text="$1000"/>
</controls:DropShadowPanel>
</Grid>
</Grid>
And here is the code behind:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at
https://go.microsoft.com/fwlink/?LinkId=234238
namespace WaterCooler
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class JeopardyView : Page
{
public JeopardyView()
{
this.InitializeComponent();
ClueIsRevealed = false;
}
private bool ClueIsRevealed { get; set; }
private void Grid_Tapped(object sender, TappedRoutedEventArgs e)
{
if (ClueReveal.GetCurrentState() != ClockState.Active)
{
if (ClueIsRevealed == false)
{
ClueReveal.Begin();
}
else
{
ClueHide.Begin();
}
}
}
private void ClueReveal_Completed(object sender, object e)
{
ClueIsRevealed = true;
}
private void ClueHide_Completed(object sender, object e)
{
ClueIsRevealed = false;
}
}
}
And here is the exception:
Exception thrown at 0x00007FFCD79C4008 (KernelBase.dll) in Water Cooler.exe:
WinRT originate error - 0x800F1000 : 'Animation target not specified.'.
Exception thrown: 'System.Runtime.InteropServices.COMException' in Water
Cooler.exe
An exception of type 'System.Runtime.InteropServices.COMException' occurred
in Water Cooler.exe but was not handled in user code
No installed components were detected.
Animation target not specified.
The program '[7948] Water Cooler.exe' has exited with code 0 (0x0).
There is a small catch here. You accidentally added an empty double animation below the first 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>
This DoubleAnimation
is empty and has no target specified and that causes the exception :-) .
User contributions licensed under CC BY-SA 3.0