Animation Setters must contain correct type #18582
stevemonaco
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Seems obvious, but maybe not entirely. I'm writing C#-backed animations and was having issues with freezes. Controls with animations that never started, animation
Tasks which would never return from itsawait, etc. No exception, no debug output. I was writing a scaling animation which has a setter like this:It turns out there's an
InvalidCastExceptionwhich I don't get in my app. I eventually put the code into the Avalonia sandbox to figure out the issue. The correct setters with explicitdoubleusage are below:The cast exception occurs here:
Avalonia/src/Avalonia.Base/Animation/AnimationInstance`1.cs
Lines 133 to 143 in 9e24f9b
And is swallowed and forwarded into an observable error here:
Avalonia/src/Avalonia.Base/Animation/AnimationInstance`1.cs
Lines 100 to 110 in 9e24f9b
There should probably be some better way to mitigate this scenario.
Beta Was this translation helpful? Give feedback.
All reactions