committed by
GitHub
401 changed files with 2601 additions and 1789 deletions
@ -0,0 +1,30 @@ |
|||
using System; |
|||
using Avalonia.Animation.Animators; |
|||
|
|||
namespace Avalonia.Animation; |
|||
|
|||
public abstract class CustomAnimatorBase |
|||
{ |
|||
internal abstract IAnimator CreateWrapper(); |
|||
internal abstract Type WrapperType { get; } |
|||
} |
|||
|
|||
public abstract class CustomAnimatorBase<T> : CustomAnimatorBase |
|||
{ |
|||
public abstract T Interpolate(double progress, T oldValue, T newValue); |
|||
|
|||
internal override Type WrapperType => typeof(AnimatorWrapper); |
|||
internal override IAnimator CreateWrapper() => new AnimatorWrapper(this); |
|||
|
|||
internal class AnimatorWrapper : Animator<T> |
|||
{ |
|||
private readonly CustomAnimatorBase<T> _parent; |
|||
|
|||
public AnimatorWrapper(CustomAnimatorBase<T> parent) |
|||
{ |
|||
_parent = parent; |
|||
} |
|||
|
|||
public override T Interpolate(double progress, T oldValue, T newValue) => _parent.Interpolate(progress, oldValue, newValue); |
|||
} |
|||
} |
|||
@ -1,26 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
using Avalonia.Rendering; |
|||
|
|||
namespace Avalonia.Animation |
|||
{ |
|||
public class RenderLoopClock : ClockBase, IRenderLoopTask, IGlobalClock |
|||
{ |
|||
protected override void Stop() |
|||
{ |
|||
AvaloniaLocator.Current.GetRequiredService<IRenderLoop>().Remove(this); |
|||
} |
|||
|
|||
bool IRenderLoopTask.NeedsUpdate => HasSubscriptions; |
|||
|
|||
void IRenderLoopTask.Render() |
|||
{ |
|||
} |
|||
|
|||
void IRenderLoopTask.Update(TimeSpan time) |
|||
{ |
|||
Pulse(time); |
|||
} |
|||
} |
|||
} |
|||
@ -1,46 +0,0 @@ |
|||
namespace Avalonia.Interactivity |
|||
{ |
|||
/// <summary>
|
|||
/// Provides both old and new property values with a routed event.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">The type of values.</typeparam>
|
|||
public class RoutedPropertyChangedEventArgs<T> : RoutedEventArgs |
|||
{ |
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="RoutedPropertyChangedEventArgs{T}"/> class.
|
|||
/// </summary>
|
|||
/// <param name="oldValue">The old property value.</param>
|
|||
/// <param name="newValue">The new property value.</param>
|
|||
/// <param name="routedEvent">The routed event associated with these event args.</param>
|
|||
public RoutedPropertyChangedEventArgs(T oldValue, T newValue, RoutedEvent? routedEvent) |
|||
: base(routedEvent) |
|||
{ |
|||
OldValue = oldValue; |
|||
NewValue = newValue; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="RoutedPropertyChangedEventArgs{T}"/> class.
|
|||
/// </summary>
|
|||
/// <param name="oldValue">The old property value.</param>
|
|||
/// <param name="newValue">The new property value.</param>
|
|||
/// <param name="routedEvent">The routed event associated with these event args.</param>
|
|||
/// <param name="source">The source object that raised the routed event.</param>
|
|||
public RoutedPropertyChangedEventArgs(T oldValue, T newValue, RoutedEvent? routedEvent, object? source) |
|||
: base(routedEvent, source) |
|||
{ |
|||
OldValue = oldValue; |
|||
NewValue = newValue; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the old value of the property.
|
|||
/// </summary>
|
|||
public T OldValue { get; init; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the new value of the property.
|
|||
/// </summary>
|
|||
public T NewValue { get; init; } |
|||
} |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue