Browse Source

Add Animator property to Setter

pull/6077/head
Wiesław Šoltés 5 years ago
parent
commit
8f203c6800
  1. 2
      src/Avalonia.Animation/Animation.cs
  2. 3
      src/Avalonia.Animation/IAnimationSetter.cs
  3. 5
      src/Avalonia.Styling/Styling/Setter.cs

2
src/Avalonia.Animation/Animation.cs

@ -248,7 +248,7 @@ namespace Avalonia.Animation
{
foreach (var setter in keyframe.Setters)
{
var handler = GetAnimatorType(setter.Property);
var handler = setter.Animator ?? GetAnimatorType(setter.Property);
if (handler == null)
{

3
src/Avalonia.Animation/IAnimationSetter.cs

@ -1,8 +1,11 @@
using System;
namespace Avalonia.Animation
{
public interface IAnimationSetter
{
AvaloniaProperty Property { get; set; }
object Value { get; set; }
Type Animator { get; set; }
}
}

5
src/Avalonia.Styling/Styling/Setter.cs

@ -59,6 +59,11 @@ namespace Avalonia.Styling
}
}
/// <summary>
/// Gets or sets the property animator.
/// </summary>
public Type? Animator { get; set; }
public ISetterInstance Instance(IStyleable target)
{
target = target ?? throw new ArgumentNullException(nameof(target));

Loading…
Cancel
Save