-
Notifications
You must be signed in to change notification settings - Fork 142
Expand file tree
/
Copy pathNormalizedKeyFrameAnimationBuilder{T}.Xaml.cs
More file actions
50 lines (46 loc) · 2.01 KB
/
NormalizedKeyFrameAnimationBuilder{T}.Xaml.cs
File metadata and controls
50 lines (46 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace CommunityToolkit.WinUI.Animations;
/// <inheritdoc cref="NormalizedKeyFrameAnimationBuilder{T}"/>
public abstract partial class NormalizedKeyFrameAnimationBuilder<T>
where T : unmanaged
{
/// <summary>
/// A custom <see cref="NormalizedKeyFrameAnimationBuilder{T}"/> class targeting the XAML layer.
/// </summary>
public sealed class Xaml : NormalizedKeyFrameAnimationBuilder<T>, AnimationBuilder.IXamlAnimationFactory
{
/// <summary>
/// Initializes a new instance of the <see cref="NormalizedKeyFrameAnimationBuilder{T}.Xaml"/> class.
/// </summary>
/// <param name="property">The target property to animate.</param>
/// <param name="delay">The target delay for the animation.</param>
/// <param name="duration">The target duration for the animation.</param>
/// <param name="repeat">The repeat options for the animation.</param>
public Xaml(string property, TimeSpan? delay, TimeSpan duration, RepeatOption repeat)
: base(property, delay, duration, repeat)
{
}
/// <inheritdoc/>
public override INormalizedKeyFrameAnimationBuilder<T> ExpressionKeyFrame(
double progress,
string expression,
EasingType easingType,
EasingMode easingMode)
{
throw new InvalidOperationException("Expression keyframes can only be used on the composition layer");
}
/// <inheritdoc/>
public Timeline GetAnimation(DependencyObject targetHint)
{
return TimedKeyFrameAnimationBuilder<T>.GetAnimation(
targetHint,
this.property,
this.delay,
this.duration,
this.repeat,
this.keyFrames.GetArraySegment());
}
}
}