Skip to content

Navigation Transitions

Header: winui/ui/Animation.hpp.

struct FadeThroughPageTransition

The new page zooms in from 90 % after the old one has faded. Going back, the old page drops 200 DIPs away.

struct ZoomPageTransition

The new page grows from 94 % as it fades in, and the old one grows to 104 % as it fades out. Going back plays the reverse.

struct RisePageTransition

The default navigation transition. The new page rises 140 DIPs as it fades in, and the old one fades out over 150 ms.

Example:

auto frame = std::make_unique<ui::NavigationFrameControl>();
frame->set_content_transitions({ui::NavigationTransition{}});
frame->navigate([] { return std::make_unique<ui::TextControl>("Home"); },
                ui::RisePageTransition{});

struct SlidePageTransition

From the bottom, the new page slides up 200 DIPs. From the left or right, the old page slides 150 DIPs away and the new one 200 DIPs in.

Example:

auto frame = std::make_unique<ui::NavigationFrameControl>();
frame->navigate([] { return std::make_unique<ui::TextControl>("Next"); },
                ui::SlidePageTransition{.direction = ui::PageSlideDirection::FromRight});

Field Type Default
direction PageSlideDirection PageSlideDirection::FromBottom Where the new page comes from.

struct NoPageTransition

No animation at all. A page that plays a connected animation navigates with it.

Tests

  • tests/test_animation.cpp