From fd041c3af584ce6f45aea275c61d6b0bf82921a0 Mon Sep 17 00:00:00 2001 From: ahopper Date: Mon, 29 Oct 2018 08:47:08 +0000 Subject: [PATCH 1/2] allow annimation of structs without typeConverter --- src/Avalonia.Animation/AnimatorKeyFrame.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Avalonia.Animation/AnimatorKeyFrame.cs b/src/Avalonia.Animation/AnimatorKeyFrame.cs index 09f259e754..5749dd7388 100644 --- a/src/Avalonia.Animation/AnimatorKeyFrame.cs +++ b/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."); From 17a976c99be3640a7841484c944bcb3e0f8b9de0 Mon Sep 17 00:00:00 2001 From: ahopper Date: Mon, 29 Oct 2018 10:32:23 +0000 Subject: [PATCH 2/2] space removed --- src/Avalonia.Animation/AnimatorKeyFrame.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Animation/AnimatorKeyFrame.cs b/src/Avalonia.Animation/AnimatorKeyFrame.cs index 5749dd7388..78a9a1e412 100644 --- a/src/Avalonia.Animation/AnimatorKeyFrame.cs +++ b/src/Avalonia.Animation/AnimatorKeyFrame.cs @@ -61,7 +61,7 @@ namespace Avalonia.Animation { throw new ArgumentNullException($"KeyFrame value can't be null."); } - if(Value is T typedValue ) + if(Value is T typedValue) { return typedValue; }