|
|
|
@ -18,25 +18,10 @@ namespace Avalonia.Animation |
|
|
|
public static readonly StyledProperty<IClock> ClockProperty = |
|
|
|
AvaloniaProperty.Register<Animatable, IClock>(nameof(Clock), inherits: true); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="PlayState"/> property.
|
|
|
|
/// </summary>
|
|
|
|
public static readonly DirectProperty<Animatable, PlayState> PlayStateProperty = |
|
|
|
AvaloniaProperty.RegisterDirect<Animatable, PlayState>( |
|
|
|
nameof(PlayState), |
|
|
|
o => o.PlayState, |
|
|
|
(o, v) => o.PlayState = v); |
|
|
|
|
|
|
|
private PlayState _playState = PlayState.Run; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the state of the animation for this
|
|
|
|
/// control.
|
|
|
|
/// </summary>
|
|
|
|
public PlayState PlayState |
|
|
|
public IClock Clock |
|
|
|
{ |
|
|
|
get { return _playState; } |
|
|
|
set { SetAndRaise(PlayStateProperty, ref _playState, value); } |
|
|
|
get => GetValue(ClockProperty); |
|
|
|
set => SetValue(ClockProperty, value); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -72,7 +57,7 @@ namespace Avalonia.Animation |
|
|
|
|
|
|
|
if (match != null) |
|
|
|
{ |
|
|
|
match.Apply(this, Clock.GlobalClock, e.OldValue, e.NewValue); |
|
|
|
match.Apply(this, Clock ?? Avalonia.Animation.Clock.GlobalClock, e.OldValue, e.NewValue); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|