Browse Source
Merge pull request #2040 from ahopper/allow-animation-of-structs-without-typeConverter
allow animation of structs without typeConverter
pull/2043/head
Jumar Macato
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
0 deletions
-
src/Avalonia.Animation/AnimatorKeyFrame.cs
|
|
|
@ -61,6 +61,10 @@ namespace Avalonia.Animation |
|
|
|
{ |
|
|
|
throw new ArgumentNullException($"KeyFrame value can't be null."); |
|
|
|
} |
|
|
|
if(Value is T typedValue) |
|
|
|
{ |
|
|
|
return typedValue; |
|
|
|
} |
|
|
|
if (!typeConv.CanConvertTo(Value.GetType())) |
|
|
|
{ |
|
|
|
throw new InvalidCastException($"KeyFrame value doesnt match property type."); |
|
|
|
|