Animating DependencyProperty
Posted: 11 Feb 2020, 23:02
Hello,
i am running into an error when i try to animate a dependency property.
I want to expose predefined render transforms to the user of the control through dependency properties.
The user can then define a storyboard to animate this properties.
In the code behind i have something like this:
The storyboard looks like this:
In Unity i get the following errors:
[noesis] Can't animate 'Double' value with a DoubleAnimation
UnityEngine.Debug:LogError(Object)
NoesisUnity:UnityLog(Int32, String) (at Assets/NoesisGUI/Plugins/NoesisUnity.cs:116)
Noesis.View:Noesis_View_Update(HandleRef, Double)
Noesis.View:Update(Double) (at Assets/NoesisGUI/Plugins/API/Core/View.cs:271)
NoesisView:LateUpdate() (at Assets/NoesisGUI/Plugins/NoesisView.cs:822)
[noesis] Can't animate property 'NoesisGui.Assets.Scripts.GuiUtility.Controls.AnimatedTextBlock.ScaleX' with a DoubleAnimation
UnityEngine.Debug:LogError(Object)
NoesisUnity:UnityLog(Int32, String) (at Assets/NoesisGUI/Plugins/NoesisUnity.cs:116)
Noesis.View:Noesis_View_Update(HandleRef, Double)
Noesis.View:Update(Double) (at Assets/NoesisGUI/Plugins/API/Core/View.cs:271)
NoesisView:LateUpdate() (at Assets/NoesisGUI/Plugins/NoesisView.cs:822)
Am i doing something wrong or do i miss something?
i am running into an error when i try to animate a dependency property.
I want to expose predefined render transforms to the user of the control through dependency properties.
The user can then define a storyboard to animate this properties.
In the code behind i have something like this:
Code: Select all
public static readonly DependencyProperty ScaleXProperty = DependencyProperty.Register(
"ScaleX", typeof(double), typeof(AnimatedTextBlock), new PropertyMetadata(1d));
public double ScaleX
{
get { return (double)GetValue(ScaleXProperty); }
set { SetValue(ScaleXProperty, value); }
}
Code: Select all
<Storyboard x:Key="Storyboard">
<DoubleAnimation Storyboard.TargetProperty="(controls1:AnimatedTextBlock.ScaleX)"
From="2" To="1" Duration="0:0:0.5"/>
</Storyboard> [noesis] Can't animate 'Double' value with a DoubleAnimation
UnityEngine.Debug:LogError(Object)
NoesisUnity:UnityLog(Int32, String) (at Assets/NoesisGUI/Plugins/NoesisUnity.cs:116)
Noesis.View:Noesis_View_Update(HandleRef, Double)
Noesis.View:Update(Double) (at Assets/NoesisGUI/Plugins/API/Core/View.cs:271)
NoesisView:LateUpdate() (at Assets/NoesisGUI/Plugins/NoesisView.cs:822)
[noesis] Can't animate property 'NoesisGui.Assets.Scripts.GuiUtility.Controls.AnimatedTextBlock.ScaleX' with a DoubleAnimation
UnityEngine.Debug:LogError(Object)
NoesisUnity:UnityLog(Int32, String) (at Assets/NoesisGUI/Plugins/NoesisUnity.cs:116)
Noesis.View:Noesis_View_Update(HandleRef, Double)
Noesis.View:Update(Double) (at Assets/NoesisGUI/Plugins/API/Core/View.cs:271)
NoesisView:LateUpdate() (at Assets/NoesisGUI/Plugins/NoesisView.cs:822)
Am i doing something wrong or do i miss something?