ColorKeyFrameCollection 类

定义

表示可通过索引单独访问的 ColorKeyFrame 对象的集合。 ColorKeyFrameCollection 是 ColorAnimationUsingKeyFrames.KeyFrames 属性的值。

public ref class ColorKeyFrameCollection sealed : IIterable<ColorKeyFrame ^>, IVector<ColorKeyFrame ^>
/// [Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class ColorKeyFrameCollection final : IIterable<ColorKeyFrame>, IVector<ColorKeyFrame>
[Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class ColorKeyFrameCollection : IEnumerable<ColorKeyFrame>, IList<ColorKeyFrame>
Public NotInheritable Class ColorKeyFrameCollection
Implements IEnumerable(Of ColorKeyFrame), IList(Of ColorKeyFrame)
继承
Object Platform::Object IInspectable ColorKeyFrameCollection
属性
实现

注解

枚举 C# 或 Microsoft Visual Basic 中的集合

ColorKeyFrameCollection 是可枚举的,因此可以使用特定于语言的语法(如 C# 中的 foreach )枚举集合中的项。 编译器为你执行类型强制转换,你无需显式强制转换为 IEnumerable<ColorKeyFrame> 。 如果需要显式强制转换(例如,如果要调用 GetEnumerator),请使用 ColorKeyFrame 约束强制转换为 IEnumerable

构造函数

ColorKeyFrameCollection()

初始化 ColorKeyFrameCollection 类的新实例。

属性

Size

获取集合的大小 (计数) 。

方法

Append(ColorKeyFrame)

将新项添加到集合。

Clear()

从集合中移除所有项。

First()

返回迭代器,以便对集合中的项进行迭代。

GetAt(UInt32)

返回位于指定索引处的项。

GetMany(UInt32, ColorKeyFrame[])

通过迭代器在一次传递中检索多个元素。

GetView()

获取集合中的不可变视图。

IndexOf(ColorKeyFrame, UInt32)

检索指定项的索引。

InsertAt(UInt32, ColorKeyFrame)

在指定的索引处插入指定的项。

RemoveAt(UInt32)

删除指定索引处的项。

RemoveAtEnd()

删除集合中的最后一项。

ReplaceAll(ColorKeyFrame[])

最初清除集合,然后将提供的数组作为新项插入。

SetAt(UInt32, ColorKeyFrame)

将指定索引处的值设置为指定的 ColorKeyFrame 值。

适用于

另请参阅