Transition Class
The base class for a transition between two elements.
public abstract class Transition : DependencyObject, ICloneable
- Inheritance:
- object object
- Derived:
- StoryboardTransitionBase
- Implements:
- ICloneable
Constructors
Transition()
Initializes an instance of the class.
protected Transition()
Properties
ClipToBounds
Gets or sets whether the transition should clip the content elements to the container bounds.
public bool ClipToBounds { get; set; }
Property Value
- bool:
true
if the transition should clip the content elements to the container bounds; otherwise,false
. The default value isfalse
.
IsToContentTopMost
Gets or sets whether the "to" content is topmost.
public bool IsToContentTopMost { get; set; }
Property Value
- bool:
true
if the "to" content is topmost; otherwise,false
. The default value istrue
.
Remarks
Transitions that "reveal" the "to" content should return false
.
Methods
Clone()
Creates a clone of the Transition.
EndTransition(TransitionPresenter, FrameworkElement, object, FrameworkElement, object)
Ends a transition, and notifies the presenter that the transition is complete.
protected void EndTransition(TransitionPresenter presenter, FrameworkElement fromContent, object fromContentData, FrameworkElement toContent, object toContentData)
Parameter | Type | Description |
---|---|---|
presenter | TransitionPresenter | The TransitionPresenter that is managing the transition. |
fromContent | FrameworkElement | The element from which a transition is occurring. |
fromContentData | object | Optional data related to the "from" element that is passed to the OnCompleted(TransitionPresenter, FrameworkElement, object, FrameworkElement, object) method. |
toContent | FrameworkElement | The element to which a transition is occurring. |
toContentData | object | Optional data related to the "to" element that is passed to the OnCompleted(TransitionPresenter, FrameworkElement, object, FrameworkElement, object) method. |
Remarks
This method must be called at the end of the transition so that the presenter is notified of the transition completion.
GetOppositeDirection(TransitionDirection)
Returns the opposite TransitionDirection of the specified TransitionDirection.
public static TransitionDirection GetOppositeDirection(TransitionDirection direction)
Parameter | Type | Description |
---|---|---|
direction | TransitionDirection | The TransitionDirection to examine. |
Returns
- TransitionDirection:
The opposite TransitionDirection of the specified TransitionDirection.
GetOppositeMode(TransitionMode)
Returns the opposite TransitionMode of the specified TransitionMode.
public static TransitionMode GetOppositeMode(TransitionMode mode)
Parameter | Type | Description |
---|---|---|
mode | TransitionMode | The TransitionMode to examine. |
Returns
- TransitionMode:
The opposite TransitionMode of the specified TransitionMode.
GetOppositeTransition()
Returns a variation of the transition that can be used for backing out a content that was inserted into the presenter using this transition.
public abstract Transition GetOppositeTransition()
Returns
- Transition:
A variation of the transition that can be used for backing out a content that was inserted into the presenter using this transition.
Remarks
Override this method to return an opposite variation of the transition if the transition supports the concept.
If the transition uses a TransitionMode, its value should be flipped using the GetOppositeMode(TransitionMode) method.
GetResolvedDirection(TransitionDirection, TransitionDirection)
Returns a resolved TransitionDirection value between an instance setting and a default setting.
protected static TransitionDirection GetResolvedDirection(TransitionDirection instanceDirection, TransitionDirection defaultDirection)
Parameter | Type | Description |
---|---|---|
instanceDirection | TransitionDirection | The instance TransitionDirection setting. |
defaultDirection | TransitionDirection | The default TransitionDirection setting. |
Returns
- TransitionDirection:
The resolved TransitionDirection value.
OnCompleted(TransitionPresenter, FrameworkElement, object, FrameworkElement, object)
Occurs when the transition has completed.
protected virtual void OnCompleted(TransitionPresenter presenter, FrameworkElement fromContent, object fromContentData, FrameworkElement toContent, object toContentData)
Parameter | Type | Description |
---|---|---|
presenter | TransitionPresenter | The TransitionPresenter that is managing the transition. |
fromContent | FrameworkElement | The element from which a transition is occurring. |
fromContentData | object | Optional data related to the "from" element. |
toContent | FrameworkElement | The element to which a transition is occurring. |
toContentData | object | Optional data related to the "to" element. |
Remarks
Place code to perform any post-transition cleanup in an override of this method.
OnStarted(TransitionPresenter, FrameworkElement, FrameworkElement)
Occurs when the transition should be started.
protected virtual void OnStarted(TransitionPresenter presenter, FrameworkElement fromContent, FrameworkElement toContent)
Parameter | Type | Description |
---|---|---|
presenter | TransitionPresenter | The TransitionPresenter that is managing the transition. |
fromContent | FrameworkElement | The element from which a transition is occurring. |
toContent | FrameworkElement | The element to which a transition is occurring. |
Remarks
Place code to perform the transition in an override of this method.
Fields
ClipToBoundsProperty
Identifies the ClipToBounds dependency property. This field is read-only.
public static readonly DependencyProperty ClipToBoundsProperty
IsToContentTopMostProperty
Identifies the IsToContentTopMost dependency property. This field is read-only.
public static readonly DependencyProperty IsToContentTopMostProperty