To test out UWP, I made a very simple small sample application that uses just the base classes to make a nice and scalable UI. One of the most recent problems that I have come across is making the button animate. In WPF this was a trivial process; however, in UWP, I came across a roadblock almost instantly when working with the Storyboard's attachable properties. I tried many variations of the following code, but all of them either said that the animation values were not valid for the object, or that it could not evaluate the values. The following sample errors with The TypeConverter for "DependencyObject" does not support converting from a string.
What am I doing wrong? I know it has something to do with Storyboard.Target, but if I set the value to something else like {Binding ElementName=Start}
, it would throw another error, saying No installed components were detected. Cannot resolve TargetProperty Background on specified object.
<Button Grid.Row="2" Name="Start" HorizontalAlignment="Center" Content="START" FontFamily="Nexa Bold" FontSize="10" BorderThickness="0" Foreground="AntiqueWhite" FontWeight="Black">
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard AutoReverse="True" Duration="0:0:0:1.000">
<ObjectAnimationUsingKeyFrames Storyboard.Target="Start" Storyboard.TargetProperty="Background">
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Button.Triggers>
All help is appreciated. Thanks!