TransitionPresenter Class
Represents an element that can display various transitions between two elements.
public class TransitionPresenter : ContentPresenter
- Inheritance:
- object Visual UIElement FrameworkElement ContentPresenter object
Remarks
For detailed documentation on this control's features and how to use them, please see the Shared Media Animation documentation topic.
Constructors
TransitionPresenter()
Initializes an instance of the TransitionPresenter
class.
public TransitionPresenter()
Properties
DefaultDirection
Gets or sets the default TransitionDirection to use for transitions that use a direction.
public TransitionDirection DefaultDirection { get; set; }
Property Value
- TransitionDirection:
The default TransitionDirection to use for transitions that use a direction. The default value is
Forward
.
DefaultDuration
Gets or sets 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
Gets or sets the default TransitionMode to use for transitions that use a mode.
public TransitionMode DefaultMode { get; set; }
Property Value
- TransitionMode:
The default TransitionMode to use for transitions that use a mode. The default value is
In
.
IsFirstContentTransitionEnabled
Gets or sets whether a transition should occur when the first Content is set.
public bool IsFirstContentTransitionEnabled { get; set; }
Property Value
IsPostTransitionFocusEnabled
Gets or sets 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 isfalse
.
IsTransitioning
Gets 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
Gets or sets whether animated transitioning is enabled.
public bool IsTransitioningEnabled { get; set; }
Property Value
- bool:
true
if animated transitioning is enabled; otherwise,false
. The default value istrue
.
IsTransitioningSuspended
Gets or sets whether animated transitioning is suspended.
public bool IsTransitioningSuspended { get; set; }
Property Value
- bool:
true
if animated transitioning is suspended; otherwise,false
. The default value isfalse
.
Transition
Gets or sets the Transition to use for transitioning between two elements.
public Transition Transition { get; set; }
Property Value
- Transition:
The Transition to use for transitioning between two elements.
TransitionSelector
Gets or sets the TransitionSelector to use for programmatically selecting a Transition between two elements.
public TransitionSelector TransitionSelector { get; set; }
Property Value
- TransitionSelector:
The TransitionSelector to use for programmatically selecting a Transition between two elements.
VisualChildrenCount
Gets the number of child elements for the Visual.
protected override int VisualChildrenCount { get; }
Property Value
- int:
The number of child elements.
Methods
ArrangeOverride(Size)
When overridden in a derived class, positions child elements and determines a size for a FrameworkElement derived class.
protected override Size ArrangeOverride(Size arrangeSize)
Parameter | Type | Description |
---|---|---|
arrangeSize | Size | The final area within the parent that this element should use to arrange itself and its children. |
Returns
- Size:
The actual size used.
ChooseTemplate()
Returns the template to use. This may depend on the content or other properties.
GetVisualChild(int)
Returns the specified Visual in the parent VisualCollection.
protected override Visual GetVisualChild(int index)
Parameter | Type | Description |
---|---|---|
index | int | The index of the visual object in the VisualCollection. |
Returns
- Visual:
The child in the VisualCollection at the specified index value.
MeasureOverride(Size)
When overridden in a derived class, measures the size in layout required for child elements and determines a size for the FrameworkElement-derived class.
protected override Size MeasureOverride(Size availableSize)
Parameter | Type | Description |
---|---|---|
availableSize | Size | The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available. |
Returns
- Size:
The size that this element determines it needs during layout, based on its calculations of child element sizes.
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
Fields
DefaultDirectionProperty
Identifies the DefaultDirection dependency property. This field is read-only.
public static readonly DependencyProperty DefaultDirectionProperty
DefaultDurationProperty
Identifies the DefaultDuration dependency property. This field is read-only.
public static readonly DependencyProperty DefaultDurationProperty
DefaultModeProperty
Identifies the DefaultMode dependency property. This field is read-only.
public static readonly DependencyProperty DefaultModeProperty
IsFirstContentTransitionEnabledProperty
Identifies the IsFirstContentTransitionEnabled dependency property. This field is read-only.
public static readonly DependencyProperty IsFirstContentTransitionEnabledProperty
IsPostTransitionFocusEnabledProperty
Identifies the IsPostTransitionFocusEnabled dependency property. This field is read-only.
public static readonly DependencyProperty IsPostTransitionFocusEnabledProperty
IsTransitioningEnabledProperty
Identifies the IsTransitioningEnabled dependency property. This field is read-only.
public static readonly DependencyProperty IsTransitioningEnabledProperty
IsTransitioningProperty
Identifies the IsTransitioning dependency property. This field is read-only.
public static readonly DependencyProperty IsTransitioningProperty
IsTransitioningSuspendedProperty
Identifies the IsTransitioningSuspended dependency property. This field is read-only.
public static readonly DependencyProperty IsTransitioningSuspendedProperty
TransitionCompletedEvent
Identifies the TransitionCompleted routed event. This field is read-only.
public static readonly RoutedEvent TransitionCompletedEvent
TransitionProperty
Identifies the Transition dependency property. This field is read-only.
public static readonly DependencyProperty TransitionProperty
TransitionSelectorProperty
Identifies the TransitionSelector dependency property. This field is read-only.
public static readonly DependencyProperty TransitionSelectorProperty