-
Notifications
You must be signed in to change notification settings - Fork 145
Expand file tree
/
Copy pathIKeyFrameInfo.cs
More file actions
60 lines (52 loc) · 2.18 KB
/
IKeyFrameInfo.cs
File metadata and controls
60 lines (52 loc) · 2.18 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
51
52
53
54
55
56
57
58
59
60
// 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.
#if WINAPPSDK
using Microsoft.UI.Composition;
#else
using Windows.UI.Composition;
#endif
using System.Diagnostics.Contracts;
namespace CommunityToolkit.WinUI.Animations;
/// <summary>
/// An interface representing a generic model containing info for an abstract keyframe.
/// </summary>
public interface IKeyFrameInfo
{
/// <summary>
/// Gets the easing type to use to reach the new keyframe.
/// </summary>
EasingType EasingType { get; }
/// <summary>
/// Gets the easing mode to use to reach the new keyframe.
/// </summary>
EasingMode EasingMode { get; }
/// <summary>
/// Gets the value for the new keyframe to add.
/// </summary>
/// <typeparam name="T">The type of values being set by the animation being constructed.</typeparam>
/// <returns>The value for the current keyframe.</returns>
[Pure]
T GetValueAs<T>();
/// <summary>
/// Tries to insert an expression keyframe into the target animation, if possible.
/// </summary>
/// <param name="animation">The target <see cref="KeyFrameAnimation"/> instance.</param>
/// <param name="duration">The total duration for the full animation.</param>
/// <returns>Whether or not the curreent <see cref="IKeyFrameInfo"/> instance contained an expression.</returns>
bool TryInsertExpressionKeyFrame(KeyFrameAnimation animation, TimeSpan duration);
/// <summary>
/// Gets the normalized progress for the current keyframe.
/// </summary>
/// <param name="duration">The total duration for the full animation.</param>
/// <returns>The normalized progress for the current keyframe.</returns>
[Pure]
float GetNormalizedProgress(TimeSpan duration);
/// <summary>
/// Gets the timed progress for the current keyframe.
/// </summary>
/// <param name="duration">The total duration for the full animation.</param>
/// <returns>The timed progress for the current keyframe.</returns>
[Pure]
TimeSpan GetTimedProgress(TimeSpan duration);
}