# Xui.ToolKit.UI.Mobile.Navigation

Assembly: **Xui.ToolKit.UI** · [C# declarations](index.cs) · [Assembly overview](../index.md)

## Types

- [`interface INavigation`](#api-6a4a416b8be4e2dd)
- [`interface INavigationAware`](#api-c71ce862ac311b2d)
- [`interface IPage`](#api-67c2781bafc47851)
- [`enum NavigationDirection`](#api-5788607300ae30b1)
- [`enum NavigationPhase`](#api-b06822c230705972)
- [`enum NavigationRole`](#api-3b7457922c3bac3e)
- [`readonly record struct NavigationStateChange`](#api-7b0a643746de71f7)
- [`class NavigationView`](#api-4782cf6f60459642)
- [`enum PageClipMode`](#api-8435938815d663e2)
- [`readonly record struct PagePresentation`](#api-de6eb7a528c0f7a3)

<a id="api-6a4a416b8be4e2dd"></a>

## `interface INavigation`

Commands and state exposed by a navigation host.

```csharp
public interface INavigation
{
    bool CanGoBack { get; }

    bool IsTransitioning { get; }

    void Push(View page);
    void Pop();
}
```

<a id="api-740fe919af3747d0"></a>

### [`bool INavigation.CanGoBack`](#api-740fe919af3747d0)


```csharp
bool CanGoBack { get; }
```

Gets whether the current page has a previous page.

<a id="api-0ff9b3c21e4db577"></a>

### [`bool INavigation.IsTransitioning`](#api-0ff9b3c21e4db577)


```csharp
bool IsTransitioning { get; }
```

Gets whether a push, pop, or interactive pop is active.

<a id="api-2faf467e5d3828b7"></a>

### [`void INavigation.Pop()`](#api-2faf467e5d3828b7)


```csharp
void Pop();
```

Pops the current page, if one exists beneath it.

<a id="api-070209037ae51417"></a>

### [`void INavigation.Push(View page)`](#api-070209037ae51417)


```csharp
void Push(View page);
```

Pushes `page` above the current page.


<a id="api-c71ce862ac311b2d"></a>

## `interface INavigationAware`

Implemented by pages that synchronize custom visuals with navigation progress.

```csharp
public interface INavigationAware
{
    void OnNavigationStateChanged(in NavigationStateChange change);
}
```

<a id="api-4fbad2c25aa26218"></a>

### [`void INavigationAware.OnNavigationStateChanged(in NavigationStateChange change)`](#api-4fbad2c25aa26218)


```csharp
void OnNavigationStateChanged(in NavigationStateChange change);
```

Receives lifecycle and progress changes for this page.


<a id="api-67c2781bafc47851"></a>

## `interface IPage`

Optional page metadata used by [`Xui.ToolKit.UI.Mobile.Navigation.NavigationView`](../xui-toolkit-ui-mobile-navigation/index.md#api-4782cf6f60459642).

```csharp
public interface IPage
{
    PagePresentation Presentation { get; }
}
```

<a id="api-55211fa7714bca00"></a>

### [`PagePresentation IPage.Presentation`](#api-55211fa7714bca00)


```csharp
PagePresentation Presentation { get; }
```

Gets the page&#39;s surface, clipping, and transition-shadow preferences.


<a id="api-5788607300ae30b1"></a>

## `enum NavigationDirection`

Describes the direction of a navigation transition.

```csharp
public enum NavigationDirection
{
    None,
    Forward,
    Backward,
}
```

<a id="api-85f42e67f2202e71"></a>

### [`NavigationDirection.Backward`](#api-85f42e67f2202e71)


```csharp
Backward
```

A pop toward a previous page.

<a id="api-a1b940676aaab913"></a>

### [`NavigationDirection.Forward`](#api-a1b940676aaab913)


```csharp
Forward
```

A push toward a newer page.

<a id="api-b796d76d1179a68e"></a>

### [`NavigationDirection.None`](#api-b796d76d1179a68e)


```csharp
None
```

No direction, used when a transition is not applicable.


<a id="api-b06822c230705972"></a>

## `enum NavigationPhase`

Describes the lifecycle point of a navigation transition.

```csharp
public enum NavigationPhase
{
    WillAppear,
    Appearing,
    Appeared,
    WillDisappear,
    Disappearing,
    Disappeared,
    Cancelled,
}
```

<a id="api-1897a021170e056b"></a>

### [`NavigationPhase.Appeared`](#api-1897a021170e056b)


```csharp
Appeared
```

The page is fully visible.

<a id="api-5a1d50cd344b4367"></a>

### [`NavigationPhase.Appearing`](#api-5a1d50cd344b4367)


```csharp
Appearing
```

The page is becoming visible; use [`Xui.ToolKit.UI.Mobile.Navigation.NavigationStateChange.Progress`](../xui-toolkit-ui-mobile-navigation/index.md#api-9936ab56a5a42c67).

<a id="api-4ec67ef79ecaf4ae"></a>

### [`NavigationPhase.Cancelled`](#api-4ec67ef79ecaf4ae)


```csharp
Cancelled
```

An interactive transition was returned to its starting page.

<a id="api-ef3b630bd51d7973"></a>

### [`NavigationPhase.Disappeared`](#api-ef3b630bd51d7973)


```csharp
Disappeared
```

The page is no longer visible.

<a id="api-2aa58fcd8a58c3fc"></a>

### [`NavigationPhase.Disappearing`](#api-2aa58fcd8a58c3fc)


```csharp
Disappearing
```

The page is becoming hidden; use [`Xui.ToolKit.UI.Mobile.Navigation.NavigationStateChange.Progress`](../xui-toolkit-ui-mobile-navigation/index.md#api-9936ab56a5a42c67).

<a id="api-17197be026a4694c"></a>

### [`NavigationPhase.WillAppear`](#api-17197be026a4694c)


```csharp
WillAppear
```

The page is about to become visible.

<a id="api-60f1a7d22932d167"></a>

### [`NavigationPhase.WillDisappear`](#api-60f1a7d22932d167)


```csharp
WillDisappear
```

The page is about to become hidden.


<a id="api-3b7457922c3bac3e"></a>

## `enum NavigationRole`

Describes whether a page is entering or leaving a transition.

```csharp
public enum NavigationRole
{
    Incoming,
    Outgoing,
}
```

<a id="api-ba2147880e9c30b3"></a>

### [`NavigationRole.Incoming`](#api-ba2147880e9c30b3)


```csharp
Incoming
```

The page being revealed.

<a id="api-f0ec597d0d90ebca"></a>

### [`NavigationRole.Outgoing`](#api-f0ec597d0d90ebca)


```csharp
Outgoing
```

The page being covered or removed.


<a id="api-7b0a643746de71f7"></a>

## `readonly record struct NavigationStateChange`

Allocation-free notification sent only to pages participating in a transition.

```csharp
public readonly record struct NavigationStateChange(NavigationPhase Phase, NavigationDirection Direction, NavigationRole Role, nfloat Progress, bool IsInteractive);
```

<a id="api-de6c53c0cb278fdc"></a>

### [`NavigationStateChange.NavigationStateChange(NavigationPhase Phase, NavigationDirection Direction, NavigationRole Role, NFloat Progress, bool IsInteractive)`](#api-de6c53c0cb278fdc)


```csharp
public NavigationStateChange(NavigationPhase Phase, NavigationDirection Direction, NavigationRole Role, nfloat Progress, bool IsInteractive);
```

Allocation-free notification sent only to pages participating in a transition.

<a id="api-604a1568bb162d06"></a>

### [`NavigationDirection NavigationStateChange.Direction`](#api-604a1568bb162d06)


```csharp
public NavigationDirection Direction { get; init; }
```



<a id="api-5169c30582e51311"></a>

### [`bool NavigationStateChange.IsInteractive`](#api-5169c30582e51311)


```csharp
public bool IsInteractive { get; init; }
```



<a id="api-c67f25a8eb25781f"></a>

### [`NavigationPhase NavigationStateChange.Phase`](#api-c67f25a8eb25781f)


```csharp
public NavigationPhase Phase { get; init; }
```



<a id="api-9936ab56a5a42c67"></a>

### [`NFloat NavigationStateChange.Progress`](#api-9936ab56a5a42c67)


```csharp
public nfloat Progress { get; init; }
```



<a id="api-a7e846f583d729a3"></a>

### [`NavigationRole NavigationStateChange.Role`](#api-a7e846f583d729a3)


```csharp
public NavigationRole Role { get; init; }
```




<a id="api-4782cf6f60459642"></a>

## `class NavigationView`

A stack-based navigation host with UIKit-style page transitions and an interactive leading-edge pop gesture. It owns page surfaces, clipping, transition shading, and lifecycle notifications.

```csharp
public class NavigationView : ViewCollection, INavigation, IFullScreenView
{
    public TimeSpan TransitionDuration { get; set; }
    public Easing.CubicBezier TransitionEasing { get; set; }
    public nfloat BackSwipeEdgeWidth { get; set; }
    public Color DefaultPageBackground { get; set; }
    public bool DrawsOpaqueFullScreen { get; }
    public bool UsesBackgroundTransitionShade { get; set; }
    public bool UsesRoundedPageTransitionShadow { get; set; }
    public View? OverlayContent { get; set; }

    public NavigationView(View rootPage);
    public bool CanGoBack { get; }
    public bool IsTransitioning { get; }

    public void Push(View page);
    public void Pop();
    protected override void OnActivate();
    protected override Size MeasureCore(Size available, IMeasureContext context);
    protected override void ArrangeCore(Rect rect, IMeasureContext context);
    protected override void RenderCore(IContext context);
    public override void OnPointerEvent(ref PointerEventRef e, EventPhase phase);
    protected override void AnimateCore(TimeSpan previous, TimeSpan current);
}
```

<a id="api-f6ff3f62be83dc92"></a>

### [`NavigationView.NavigationView(View rootPage)`](#api-f6ff3f62be83dc92)


```csharp
public NavigationView(View rootPage);
```

Creates a navigation stack with `rootPage` as its first page.

<a id="api-8e1bc1a61efdf6c9"></a>

### [`void NavigationView.AnimateCore(TimeSpan previous, TimeSpan current)`](#api-8e1bc1a61efdf6c9)


```csharp
protected override void AnimateCore(TimeSpan previous, TimeSpan current);
```

Override to animate this view and its children.

<a id="api-930168067f3d1e71"></a>

### [`void NavigationView.ArrangeCore(Rect rect, IMeasureContext context)`](#api-930168067f3d1e71)


```csharp
protected override void ArrangeCore(Rect rect, IMeasureContext context);
```

Override to arrange children within this view&#39;s final frame.

<a id="api-b4f8979e6610c075"></a>

### [`NFloat NavigationView.BackSwipeEdgeWidth`](#api-b4f8979e6610c075)


```csharp
public nfloat BackSwipeEdgeWidth { get; set; }
```

Width of the leading-edge region that may start an interactive pop.

<a id="api-76860439a1eabaab"></a>

### [`bool NavigationView.CanGoBack`](#api-76860439a1eabaab)


```csharp
public bool CanGoBack { get; }
```

Gets whether the current page has a previous page.

<a id="api-5979ca4a8e8fc738"></a>

### [`Color NavigationView.DefaultPageBackground`](#api-5979ca4a8e8fc738)


```csharp
public Color DefaultPageBackground { get; set; }
```

Default opaque surface behind pages that do not provide a background.

<a id="api-a57ee0917bae2467"></a>

### [`bool NavigationView.DrawsOpaqueFullScreen`](#api-a57ee0917bae2467)


```csharp
public bool DrawsOpaqueFullScreen { get; }
```

Whether the current state paints the whole display area opaquely.

<a id="api-556cbd2fd939c931"></a>

### [`bool NavigationView.IsTransitioning`](#api-556cbd2fd939c931)


```csharp
public bool IsTransitioning { get; }
```

Gets whether a push, pop, or interactive pop is active.

<a id="api-9357ac19d339d6f9"></a>

### [`Size NavigationView.MeasureCore(Size available, IMeasureContext context)`](#api-9357ac19d339d6f9)


```csharp
protected override Size MeasureCore(Size available, IMeasureContext context);
```

Override to compute the desired border-edge size.

<a id="api-bc4ba5ff680e6943"></a>

### [`void NavigationView.OnActivate()`](#api-bc4ba5ff680e6943)


```csharp
protected override void OnActivate();
```

Called when this view becomes active — it will receive events, render, and animate. Override this to start animations, subscribe to data sources, or acquire resources.

<a id="api-8a8a9d0216c6ead8"></a>

### [`void NavigationView.OnPointerEvent(ref PointerEventRef e, EventPhase phase)`](#api-8a8a9d0216c6ead8)


```csharp
public override void OnPointerEvent(ref PointerEventRef e, EventPhase phase);
```

Called during event dispatch to handle a pointer event in a specific event phase.

<a id="api-8423070a15bda257"></a>

### [`View? NavigationView.OverlayContent`](#api-8423070a15bda257)


```csharp
public View? OverlayContent { get; set; }
```

Optional content rendered above the page stack and docked at the navigation viewport&#39;s top-right corner.

<a id="api-a8e7c4042bdcf8ed"></a>

### [`void NavigationView.Pop()`](#api-a8e7c4042bdcf8ed)


```csharp
public void Pop();
```

Pops the current page, if one exists beneath it.

<a id="api-b4d9b05b51314166"></a>

### [`void NavigationView.Push(View page)`](#api-b4d9b05b51314166)


```csharp
public void Push(View page);
```

Pushes `page` above the current page.

<a id="api-743bcf80ff7a9b54"></a>

### [`void NavigationView.RenderCore(IContext context)`](#api-743bcf80ff7a9b54)


```csharp
protected override void RenderCore(IContext context);
```

Override to render this view and its children.

<a id="api-a2a25fc9dfd0477f"></a>

### [`TimeSpan NavigationView.TransitionDuration`](#api-a2a25fc9dfd0477f)


```csharp
public TimeSpan TransitionDuration { get; set; }
```

Duration of non-interactive pushes and pops.

<a id="api-b6f89bf8ed82ef58"></a>

### [`CubicBezier NavigationView.TransitionEasing`](#api-b6f89bf8ed82ef58)


```csharp
public Easing.CubicBezier TransitionEasing { get; set; }
```

Fast decelerating curve used by UIKit-style navigation transitions.

<a id="api-6ad35ead551326df"></a>

### [`bool NavigationView.UsesBackgroundTransitionShade`](#api-6ad35ead551326df)


```csharp
public bool UsesBackgroundTransitionShade { get; set; }
```

Gets or sets whether the back page is darkened during navigation transitions.

<a id="api-bd8d170c57bb5e2a"></a>

### [`bool NavigationView.UsesRoundedPageTransitionShadow`](#api-bd8d170c57bb5e2a)


```csharp
public bool UsesRoundedPageTransitionShadow { get; set; }
```

Gets or sets whether the foreground page receives its rounded gradient edge shadow. Disabled while isolating the cost of the gradient shadow from the flat shade.


<a id="api-8435938815d663e2"></a>

## `enum PageClipMode`

Controls the clipping applied by [`Xui.ToolKit.UI.Mobile.Navigation.NavigationView`](../xui-toolkit-ui-mobile-navigation/index.md#api-4782cf6f60459642) to a page.

```csharp
public enum PageClipMode
{
    Device,
    Bounds,
    None,
}
```

<a id="api-1510daf917d038d4"></a>

### [`PageClipMode.Bounds`](#api-1510daf917d038d4)


```csharp
Bounds
```

Clips to the square navigation bounds.

<a id="api-04feeb572b7cf375"></a>

### [`PageClipMode.Device`](#api-04feeb572b7cf375)


```csharp
Device
```

Clips to the display bounds and physical screen corner radius.

<a id="api-3f0dbf24b43da71c"></a>

### [`PageClipMode.None`](#api-3f0dbf24b43da71c)


```csharp
None
```

Does not apply a navigation clip.


<a id="api-de6eb7a528c0f7a3"></a>

## `readonly record struct PagePresentation`

Presentation preferences supplied by a page to its navigation host.

```csharp
public readonly record struct PagePresentation
{
    public PagePresentation();
    public PagePresentation(Color? background, PageClipMode clip, bool usesTransitionShadow);
    public Color? Background { get; init; }
    public PageClipMode Clip { get; init; }
    public bool UsesTransitionShadow { get; init; }
}
```

<a id="api-227dad232c2fd35e"></a>

### [`PagePresentation.PagePresentation()`](#api-227dad232c2fd35e)


```csharp
public PagePresentation();
```

Creates the default opaque, device-clipped page presentation with its transition shadow enabled.

<a id="api-6d31037580732e7a"></a>

### [`PagePresentation.PagePresentation(Color? background, PageClipMode clip, bool usesTransitionShadow)`](#api-6d31037580732e7a)


```csharp
public PagePresentation(Color? background, PageClipMode clip, bool usesTransitionShadow);
```

Creates a page presentation with explicit surface, clipping, and shadow preferences.

<a id="api-fe68a72d55e33499"></a>

### [`Color? PagePresentation.Background`](#api-fe68a72d55e33499)


```csharp
public Color? Background { get; init; }
```

Gets the page background, or `null` to use the navigation default.

<a id="api-38e2875fbd83bbc0"></a>

### [`PageClipMode PagePresentation.Clip`](#api-38e2875fbd83bbc0)


```csharp
public PageClipMode Clip { get; init; }
```

Gets the clipping applied to the page.

<a id="api-c9bddf3075b2ced1"></a>

### [`bool PagePresentation.UsesTransitionShadow`](#api-c9bddf3075b2ced1)


```csharp
public bool UsesTransitionShadow { get; init; }
```

Gets whether the transition shadow is drawn for this page.

