Table of Contents

Class TransitioningContentControl

Namespace
ReactiveUI
Assembly
ReactiveUI.WinUI.dll

A control with a single transition.

public class TransitioningContentControl : ContentControl, IEquatable<DependencyObject>, IAnimationObject, IVisualElement, IVisualElement2, IEquatable<UIElement>, IEquatable<FrameworkElement>, IEquatable<Control>, IWinRTObject, IDynamicInterfaceCastable, IEquatable<ContentControl>
Inheritance
TransitioningContentControl
Implements
IWinRTObject
Derived
Inherited Members
Extension Methods
WhenAnyMixin.WhenAny<TSender, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(TSender?, Expression<Func<TSender, T1>>, Expression<Func<TSender, T2>>, Expression<Func<TSender, T3>>, Expression<Func<TSender, T4>>, Expression<Func<TSender, T5>>, Expression<Func<TSender, T6>>, Expression<Func<TSender, T7>>, Expression<Func<TSender, T8>>, Expression<Func<TSender, T9>>, Expression<Func<TSender, T10>>, Expression<Func<TSender, T11>>, Expression<Func<TSender, T12>>, Func<IObservedChange<TSender, T1>, IObservedChange<TSender, T2>, IObservedChange<TSender, T3>, IObservedChange<TSender, T4>, IObservedChange<TSender, T5>, IObservedChange<TSender, T6>, IObservedChange<TSender, T7>, IObservedChange<TSender, T8>, IObservedChange<TSender, T9>, IObservedChange<TSender, T10>, IObservedChange<TSender, T11>, IObservedChange<TSender, T12>, TRet>)
WhenAnyMixin.WhenAny<TSender, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(TSender?, Expression<Func<TSender, T1>>, Expression<Func<TSender, T2>>, Expression<Func<TSender, T3>>, Expression<Func<TSender, T4>>, Expression<Func<TSender, T5>>, Expression<Func<TSender, T6>>, Expression<Func<TSender, T7>>, Expression<Func<TSender, T8>>, Expression<Func<TSender, T9>>, Expression<Func<TSender, T10>>, Expression<Func<TSender, T11>>, Expression<Func<TSender, T12>>, Func<IObservedChange<TSender, T1>, IObservedChange<TSender, T2>, IObservedChange<TSender, T3>, IObservedChange<TSender, T4>, IObservedChange<TSender, T5>, IObservedChange<TSender, T6>, IObservedChange<TSender, T7>, IObservedChange<TSender, T8>, IObservedChange<TSender, T9>, IObservedChange<TSender, T10>, IObservedChange<TSender, T11>, IObservedChange<TSender, T12>, TRet>, bool)

Constructors

TransitioningContentControl()

public TransitioningContentControl()

Fields

TransitionDirectionProperty

Identifies the Direction dependency property.

public static readonly DependencyProperty TransitionDirectionProperty

Field Value

DependencyProperty

Remarks

The default value is Left.

TransitionDurationProperty

Identifies the Duration dependency property.

public static readonly DependencyProperty TransitionDurationProperty

Field Value

DependencyProperty

Remarks

The default value is 0.3 seconds.

TransitionProperty

Identifies the Transition dependency property.

public static readonly DependencyProperty TransitionProperty

Field Value

DependencyProperty

Remarks

The default value is Fade.

Properties

Direction

Gets or sets the direction used by directional transitions.

public TransitioningContentControl.TransitionDirection Direction { get; set; }

Property Value

TransitioningContentControl.TransitionDirection

The transition direction. The default is Left.

Remarks

This property is ignored by Fade.

Duration

Gets or sets the transition duration.

public TimeSpan Duration { get; set; }

Property Value

TimeSpan

The duration.

Transition

Gets or sets the transition type used when the content changes.

public TransitioningContentControl.TransitionType Transition { get; set; }

Property Value

TransitioningContentControl.TransitionType

The transition type. The default is Fade.

Remarks

This property selects which visual state(s) the control will attempt to enter during a transition.

Methods

OnApplyTemplate()

public override void OnApplyTemplate()

Remarks

When the template is applied, the control locates and caches the required template parts and the visual state group used for transitions.

The following parts are required: PART_Container and PART_CurrentContentPresentationSite. If either is missing, an InvalidOperationException is thrown.

The PART_PreviousImageSite part is optional; if it is missing, transitions will not run and the control behaves like a normal ContentControl.

Exceptions

InvalidOperationException

Thrown if PART_Container or PART_CurrentContentPresentationSite cannot be found in the applied template.

OnContentChanged(object, object)

Called when the value of the Content property changes.

protected override void OnContentChanged(object oldContent, object newContent)

Parameters

oldContent object

The previous content value.

newContent object

The new content value.

Remarks

This override queues and begins a transition (when possible) before invoking the base implementation. If the required template parts are not available, or the control is already transitioning, the new content is applied immediately without animation.

Events

TransitionCompleted

Occurs when a transition has completed.

public event RoutedEventHandler? TransitionCompleted

Event Type

RoutedEventHandler

Remarks

The event is raised after the control returns to the Normal visual state and after the previous content snapshot has been released.

TransitionStarted

Occurs when a transition has started.

public event RoutedEventHandler? TransitionStarted

Event Type

RoutedEventHandler

Remarks

The event is raised when a transition is about to begin (after the control has prepared the outgoing snapshot and set the new content), but before the first visual state is entered.