Dear JS-Support,
We got null reference exception with ColorAnimation.
Background: we would like to animate a button (with x:Name="buttonDoubleAnimationAndColorAnimationSample") background colour.
Code:
XAML:
<Page.Resources>
<Storyboard x:Key="PlayAnimationGo" x:Name="PlayAnimationNevGo" Duration="0:0:5" >
<ColorAnimation Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)"
From="Red" To="Green" Duration="0:0:5" />
</Storyboard>
</Page.Resources>
C# code behind:
Storyboard.SetTarget(PlayAnimationNevGo, buttonDoubleAnimationAndColorAnimationSample);
PlayAnimationNevGo.Begin();
Exception:
{"Value cannot be null.\r\nParameter name: key"}
StackTrace:
" at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.ContainsKey(TKey key)
at Windows.UI.Xaml.Controls.Control.TryFindTemplateChildFromName(String name)
at Windows.UI.Xaml.Controls.Control.GetTemplateChild(String childName)
at Windows.UI.Xaml.Media.Animation.Timeline.GetPropertyPathAndTargetBeforePath(FrameworkElement targetParent, DependencyObject& targetBeforePath, PropertyPath& propertyPath, Boolean isTargetParentTheTarget)
at Windows.UI.Xaml.Media.Animation.ColorAnimation.Apply(FrameworkElement frameworkElement, Boolean useTransitions, String visualStateGroupName, Boolean isTargetParentTheTarget)
at Windows.UI.Xaml.Media.Animation.Storyboard.Begin()
at XXX_DEVOnly_CSHTM5ColorAnimationTEST.MainPage.buttonDoubleAnimationAndColorAnimationSample_Click(Object sender, RoutedEventArgs e) in C:\Users\A\documents\visual studio 2015\Projects\KasszaWEB\XXX_DEVOnly_CSHTM5ColorAnimationTEST\MainPage.xaml.cs:line 23
at Windows.UI.Xaml.Controls.Primitives.ButtonBase.OnClick(RoutedEventArgs eventArgs)
at Windows.UI.Xaml.Controls.Primitives.ButtonBase.OnClick(Object e)
at CallSite.Target(Closure , CallSite , Action`1 , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2[T0,T1](CallSite site, T0 arg0, T1 arg1)
at DotNetForHtml5.Core.INTERNAL_EventManager`2.OnEvent(Object e)
at DotNetForHtml5.Core.INTERNAL_EventManager`2.<StartListeningToDomEventsIfNotAlreadyListening>b__7(Object e)
at DotNetForHtml5.Core.INTERNAL_EventsHelper.<>c__DisplayClass1.<AttachToDomEvents>b__0(Object e)
at CallSite.Target(Closure , CallSite , Action`1 , Object )
at DotNetForHtml5.Core.HtmlEventProxy.<>c__DisplayClass4.<.ctor>b__2(Object s, EventArgsWithJSEventObject e)
at DotNetForHtml5.Core.HtmlEventProxy.<>c__DisplayClassa.<OnEvent>b__9()"
Please, confirm, that you can reproduce the issue.
Waiting for your kind reply,
BR,
Péter