Browse Source
Reuse animators in Transitions code + add missing BoxShadowsTransition + fix NRE in ISolidColorBrushAnimatorrelease/0.10.5
committed by
Max Katz
12 changed files with 138 additions and 52 deletions
@ -0,0 +1,23 @@ |
|||
using System; |
|||
using System.Reactive.Linq; |
|||
|
|||
using Avalonia.Animation.Animators; |
|||
using Avalonia.Media; |
|||
|
|||
namespace Avalonia.Animation |
|||
{ |
|||
/// <summary>
|
|||
/// Transition class that handles <see cref="AvaloniaProperty"/> with <see cref="BoxShadows"/> type.
|
|||
/// </summary>
|
|||
public class BoxShadowsTransition : Transition<BoxShadows> |
|||
{ |
|||
private static readonly BoxShadowsAnimator s_animator = new BoxShadowsAnimator(); |
|||
|
|||
/// <inheritdocs/>
|
|||
public override IObservable<BoxShadows> DoTransition(IObservable<double> progress, BoxShadows oldValue, BoxShadows newValue) |
|||
{ |
|||
return progress |
|||
.Select(progress => s_animator.Interpolate(Easing.Ease(progress), oldValue, newValue)); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue