Skip to content

Latest commit

 

History

History
69 lines (45 loc) · 5.79 KB

transitioncollection.md

File metadata and controls

69 lines (45 loc) · 5.79 KB
-api-id -api-type
T:Windows.UI.Xaml.Media.Animation.TransitionCollection
winrt class

Windows.UI.Xaml.Media.Animation.TransitionCollection

-description

Represents a collection of Transition objects. Each Transition object represents a different theme transition, part of the Windows Runtime animation library.

-xaml-syntax

<TransitionCollection>
    oneOrMoreTransitions
</TransitionCollection>

-remarks

TransitionCollection is used as the value type for these properties:

Note

Prior to Windows 10, version 1809 (SDK 17763), the XAML syntax for properties that have a TransitionCollection value requires that you declare an explicit TransitionCollection object element as the value, and then provide object elements as child elements of TransitionCollection for each of the transition animations you want to use. In Windows 10, version 1809 (SDK 17763) or later, TransitionCollection supports the implicit collection usage, so you can omit the collection object element. For more info on implicit collections and XAML, see XAML syntax guide.

Transition animations are preconfigured animations from the Windows Runtime animation library. Transition animations run automatically upon the conditions that the transition animation is associated with, using the property owner where the TransitionCollection is set as the target. The properties being animated vary depending on which transition you use.

VisualStateGroup.Transitions does not use the TransitionCollection type. VisualStateGroup.Transitions uses a built-in collection(list or vector) of VisualTransition objects.

Enumerating the collection in C# or Microsoft Visual Basic

A TransitionCollection is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate the items in the collection. The compiler does the type-casting for you and you won't need to cast to IEnumerable<Transition> explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerable<T> with a Transition constraint.

-examples

This example shows the XAML syntax for setting a TransitionCollection object element as part of setting the UIElement.Transitions property inline.

[!code-xamlEntranceThemeTransitionSimple]

[!code-xamlEntranceThemeTransitionStyle]

-see-also

UIElement.Transitions, ContentControl.ContentTransitions, Panel.ChildrenTransitions, IVector<T>, IIterable<T>, IList<T>