Transition Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a visual behavior that occurs for predefined actions or state changes. Specific theme transitions (various Transition derived classes) can be applied to individual elements using the UIElement.Transitions property, or applied for scenario-specific theme transition properties such as ContentControl.ContentTransitions.
public ref class Transition : DependencyObject
/// [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 Transition : DependencyObject
[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 class Transition : DependencyObject
Public Class Transition
Inherits DependencyObject
- Inheritance
- Derived
- Attributes
Remarks
Transition derived classes
Transition is the parent class for several immediately derived classes that define library theme transitions. Here are some of the notable derived classes:
- AddDeleteThemeTransition
- ContentThemeTransition
- EdgeUIThemeTransition
- EntranceThemeTransition
- PaneThemeTransition
- PopupThemeTransition
- ReorderThemeTransition
- RepositionThemeTransition
For each of these classes, you typically define object elements. Most theme transitions don't have additional attributes, so you typically use a basic self-closing object element, for example <PopupThemeTransition />
. These are used to populate a TransitionCollection property. Those properties include:
- Border.ChildTransitions
- ContentControl.ContentTransitions
- ContentPresenter.ContentTransitions
- ItemsControl.ItemContainerTransitions
- ItemsPresenter.FooterTransitions
- ItemsPresenter.HeaderTransitions
- ListViewBase.FooterTransitions
- ListViewBase.HeaderTransitions
- Panel.ChildrenTransitions
- Popup.ChildTransitions
- SettingsFlyoutTemplateSettings.ContentTransitions
- UIElement.Transitions
Not all transitions make sense for any given property. For example, PopupThemeTransition is really only useful for Popup.ChildTransitions. For more info on how to use the theme transitions, see Animations overview and topics linked from there, including the design guidelines topics.
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.
Properties
Dispatcher |
Always returns |
DispatcherQueue |
Gets the |
Methods
ClearValue(DependencyProperty) |
Clears the local value of a dependency property. (Inherited from DependencyObject) |
GetAnimationBaseValue(DependencyProperty) |
Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject) |
GetValue(DependencyProperty) |
Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject) |
ReadLocalValue(DependencyProperty) |
Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject) |
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback) |
Registers a notification function for listening to changes to a specific DependencyProperty on this DependencyObject instance. (Inherited from DependencyObject) |
SetValue(DependencyProperty, Object) |
Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject) |
UnregisterPropertyChangedCallback(DependencyProperty, Int64) |
Cancels a change notification that was previously registered by calling RegisterPropertyChangedCallback. (Inherited from DependencyObject) |