In This Article

TransitionPresenter Class

Represents an element that can display various transitions between two elements.

public class TransitionPresenter : ContentPresenter
Inheritance:
object Visual UIElement FrameworkElement ContentPresenter object
Derived:
WizardPagePresenter ToggleTransitionPresenter

Constructors

TransitionPresenter()

Initializes an instance of the class.

public TransitionPresenter()

Properties

DefaultDirection

The default TransitionDirection to use for transitions that use a direction.

public TransitionDirection DefaultDirection { get; set; }

Property Value

TransitionDirection:

The default value is Forward.

DefaultDuration

The default length of time for which a transition plays, not counting repetitions.

public Duration DefaultDuration { get; set; }

Property Value

Duration:

The presenter's default simple duration for transitions: the amount of time a transition takes to complete a single forward iteration. The default value is 200 milliseconds.

DefaultMode

The default TransitionMode to use for transitions that use a mode.

public TransitionMode DefaultMode { get; set; }

Property Value

TransitionMode:

The default value is In.

IsFirstContentTransitionEnabled

Indicates whether a transition should occur when the first Content is set.

public bool IsFirstContentTransitionEnabled { get; set; }

Property Value

bool:

true if a transition should occur when the first Content is set; otherwise, false.

IsPostTransitionFocusEnabled

Indicates whether focus is set to the content following the completion of a transition.

public bool IsPostTransitionFocusEnabled { get; set; }

Property Value

bool:

true if focus is set to the content following the completion of a transition; otherwise, false. The default value is false.

IsTransitioning

Indicates whether a transition is currently in progress.

public bool IsTransitioning { get; }

Property Value

bool:

true if a transition is currently in progress; otherwise, false.

IsTransitioningEnabled

Indicates whether animated transitioning is enabled.

public bool IsTransitioningEnabled { get; set; }

Property Value

bool:

true if animated transitioning is enabled; otherwise, false. The default value is true.

IsTransitioningSuspended

Indicates whether animated transitioning is suspended.

public bool IsTransitioningSuspended { get; set; }

Property Value

bool:

true if animated transitioning is suspended; otherwise, false. The default value is false.

Transition

The Transition to use for transitioning between two elements.

public Transition? Transition { get; set; }

Property Value

Transition

TransitionSelector

The TransitionSelector to use for programmatically selecting a Transition between two elements.

public TransitionSelector? TransitionSelector { get; set; }

Property Value

TransitionSelector

VisualChildrenCount

Gets the number of visual child elements within this element.

protected override int VisualChildrenCount { get; }

Property Value

int:

The number of visual child elements for this element.

Methods

ArrangeOverride(Size)

Positions the single child element and determines the content of a ContentPresenter object.

protected override Size ArrangeOverride(Size arrangeSize)
Parameter Type Description
arrangeSize Size

The size that this ContentPresenter object should use to arrange its child element.

Returns

Size:

The actual size needed by the element.

ChooseTemplate()

Returns the template to use. This may depend on the content or other properties.

protected override DataTemplate ChooseTemplate()

Returns

DataTemplate:

The DataTemplate to use.

GetVisualChild(int)

Overrides GetVisualChild(int), and returns a child at the specified index from a collection of child elements.

protected override Visual GetVisualChild(int index)
Parameter Type Description
index int

The zero-based index of the requested child element in the collection.

Returns

Visual:

The requested child element. This should not return null; if the provided index is out of range, an exception is thrown.

MeasureOverride(Size)

Determines the size of the ContentPresenter object based on the sizing properties, margin, and requested size of the child content.

protected override Size MeasureOverride(Size availableSize)
Parameter Type Description
availableSize Size

Returns

Size:

The size that is required to arrange child content.

OnTransitionCompleted(object?, object?)

Raises the TransitionCompleted event.

protected virtual void OnTransitionCompleted(object? fromContent, object? toContent)
Parameter Type Description
fromContent object

The element from which a transition occurred.

toContent object

The element to which a transition is occurred.

Events

TransitionCompleted

Occurs after a transition has completed.

public event RoutedPropertyChangedEventHandler<object> TransitionCompleted

Event Type

RoutedPropertyChangedEventHandler<object>

Fields

DefaultDirectionProperty

Defines the DefaultDirection property.

public static readonly DependencyProperty DefaultDirectionProperty

DefaultDurationProperty

Defines the DefaultDuration property.

public static readonly DependencyProperty DefaultDurationProperty

DefaultModeProperty

Defines the DefaultMode property.

public static readonly DependencyProperty DefaultModeProperty

IsFirstContentTransitionEnabledProperty

Defines the IsFirstContentTransitionEnabled property.

public static readonly DependencyProperty IsFirstContentTransitionEnabledProperty

IsPostTransitionFocusEnabledProperty

Defines the IsPostTransitionFocusEnabled property.

public static readonly DependencyProperty IsPostTransitionFocusEnabledProperty

IsTransitioningEnabledProperty

Defines the IsTransitioningEnabled property.

public static readonly DependencyProperty IsTransitioningEnabledProperty

IsTransitioningProperty

Defines the IsTransitioning property.

public static readonly DependencyProperty IsTransitioningProperty

IsTransitioningSuspendedProperty

Defines the IsTransitioningSuspended property.

public static readonly DependencyProperty IsTransitioningSuspendedProperty

TransitionCompletedEvent

Defines the TransitionCompleted event.

public static readonly RoutedEvent TransitionCompletedEvent

TransitionProperty

Defines the Transition property.

public static readonly DependencyProperty TransitionProperty

TransitionSelectorProperty

Defines the TransitionSelector property.

public static readonly DependencyProperty TransitionSelectorProperty

Extension Methods