ViewTransition Class
A view transition (https://drafts.csswg.org/css-view-transitions-1/#viewtransition): the animated transition between two states of a document. The old state is captured at the rendering opportunity that follows Document.StartViewTransition, the update callback then changes the document, and the tree of ::view-transition pseudo-elements, which shows the snapshots of the old state and the live images of the new state, is animated until its animations finish.
public sealed class ViewTransitionProperties
| Name | Description |
|---|---|
| Finished | Gets a task completed when the end state is visible: the animations finished or the transition was skipped. It only fails when the update callback failed (https://drafts.csswg.org/css-view-transitions-1/#dom-viewtransition-finished). |
| Ready | Gets a task completed when the pseudo-elements of the transition are created and the animations are about to start; it fails when the transition cannot begin or is skipped before (https://drafts.csswg.org/css-view-transitions-1/#dom-viewtransition-ready). |
| TransitionRoot | Gets the element that hosts the transition: the document element (https://drafts.csswg.org/css-view-transitions-2/#dom-viewtransition-transitionroot). |
| Types | Gets the types of the transition, matched by :active-view-transition-type() (https://drafts.csswg.org/css-view-transitions-2/#dom-viewtransition-types). |
| UpdateCallbackDone | Gets a task completed when the promise returned by the update callback is fulfilled; it fails when the promise is rejected (https://drafts.csswg.org/css-view-transitions-1/#dom-viewtransition-updatecallbackdone). |
Finished
ViewTransition.csGets a task completed when the end state is visible: the animations finished or the transition was skipped. It only fails when the update callback failed (https://drafts.csswg.org/css-view-transitions-1/#dom-viewtransition-finished).
public Task Finished { get; }Property value
See also
Ready
ViewTransition.csGets a task completed when the pseudo-elements of the transition are created and the animations are about to start; it fails when the transition cannot begin or is skipped before (https://drafts.csswg.org/css-view-transitions-1/#dom-viewtransition-ready).
public Task Ready { get; }TransitionRoot
ViewTransition.csGets the element that hosts the transition: the document element (https://drafts.csswg.org/css-view-transitions-2/#dom-viewtransition-transitionroot).
public Element? TransitionRoot { get; }Types
ViewTransition.csGets the types of the transition, matched by :active-view-transition-type() (https://drafts.csswg.org/css-view-transitions-2/#dom-viewtransition-types).
public ViewTransitionTypeSet Types { get; }UpdateCallbackDone
ViewTransition.csGets a task completed when the promise returned by the update callback is fulfilled; it fails when the promise is rejected (https://drafts.csswg.org/css-view-transitions-1/#dom-viewtransition-updatecallbackdone).
public Task UpdateCallbackDone { get; }Methods
| Name | Description |
|---|---|
| SkipTransition() | Finishes the transition immediately, or prevents it from starting; the update callback is still called (https://drafts.csswg.org/css-view-transitions-1/#dom-viewtransition-skiptransition). |
| WaitUntil(Task<object?>) | Delays the end of the transition until the task completes (https://drafts.csswg.org/css-view-transitions-2/#dom-viewtransition-waituntil). |
SkipTransition()
ViewTransition.csFinishes the transition immediately, or prevents it from starting; the update callback is still called (https://drafts.csswg.org/css-view-transitions-1/#dom-viewtransition-skiptransition).
public void SkipTransition()WaitUntil(Task<object?>)
ViewTransition.csDelays the end of the transition until the task completes (https://drafts.csswg.org/css-view-transitions-2/#dom-viewtransition-waituntil).