# Xui.ToolKit.UI.Navigation

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

## Types

- [`record class NavigationItem`](#api-01be9542a3068b82)
- [`class NavigationPage`](#api-d13ca0c07d104eb5)
- [`class NavigationShell`](#api-6f84bebcd2186494)

<a id="api-01be9542a3068b82"></a>

## `record class NavigationItem`

A named destination whose content is created when first opened.

- **`Id`** — Stable application-defined destination identifier.

- **`Title`** — Label shown in navigation and the page header.

- **`Create`** — Creates a fresh, unattached view for this destination.

```csharp
public sealed record NavigationItem(string Id, string Title, Func<View> Create);
```

<a id="api-9ad3cbefea633c53"></a>

### [`NavigationItem.NavigationItem(string Id, string Title, Func<View> Create)`](#api-9ad3cbefea633c53)


```csharp
public NavigationItem(string Id, string Title, Func<View> Create);
```

A named destination whose content is created when first opened.

- **`Id`** — Stable application-defined destination identifier.

- **`Title`** — Label shown in navigation and the page header.

- **`Create`** — Creates a fresh, unattached view for this destination.

<a id="api-7419fa3f04058174"></a>

### [`Func<View> NavigationItem.Create`](#api-7419fa3f04058174)


```csharp
public Func<View> Create { get; init; }
```

Creates a fresh, unattached view for this destination.

<a id="api-730b0a4e0890ed31"></a>

### [`string NavigationItem.Id`](#api-730b0a4e0890ed31)


```csharp
public string Id { get; init; }
```

Stable application-defined destination identifier.

<a id="api-18087333a9027ffd"></a>

### [`string NavigationItem.Title`](#api-18087333a9027ffd)


```csharp
public string Title { get; init; }
```

Label shown in navigation and the page header.


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

## `class NavigationPage`

A page title, optional Back button, and a content view.

```csharp
public sealed class NavigationPage : ViewCollection
{
    public NavigationPage(string title, View content, Action? goBack = null);
    protected override Size MeasureCore(Size available, IMeasureContext context);
    protected override void ArrangeCore(Rect rect, IMeasureContext context);
}
```

<a id="api-ae43177c3e035fa4"></a>

### [`NavigationPage.NavigationPage(string title, View content, Action? goBack = null)`](#api-ae43177c3e035fa4)


```csharp
public NavigationPage(string title, View content, Action? goBack = null);
```

Creates page chrome around application content.

<a id="api-bd1d0ad218a9840b"></a>

### [`void NavigationPage.ArrangeCore(Rect rect, IMeasureContext context)`](#api-bd1d0ad218a9840b)


```csharp
protected override void ArrangeCore(Rect rect, IMeasureContext context);
```

Override to arrange children within this view&#39;s final frame.

<a id="api-d6e647fb864b9799"></a>

### [`Size NavigationPage.MeasureCore(Size available, IMeasureContext context)`](#api-d6e647fb864b9799)


```csharp
protected override Size MeasureCore(Size available, IMeasureContext context);
```

Override to compute the desired border-edge size.


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

## `class NavigationShell`

A small application shell: a home page and push navigation on mobile, or a persistent sidebar with replaceable content on desktop.

```csharp
public sealed class NavigationShell : ViewCollection
{
    public NavigationShell(string title, View brand, IEnumerable<NavigationItem> destinations, bool desktop);
    public void Navigate(string id);
    protected override Size MeasureCore(Size available, IMeasureContext context);
    protected override void ArrangeCore(Rect rect, IMeasureContext context);
    protected override void RenderCore(IContext context);
}
```

<a id="api-c2b7c1222903f629"></a>

### [`NavigationShell.NavigationShell(string title, View brand, IEnumerable<NavigationItem> destinations, bool desktop)`](#api-c2b7c1222903f629)


```csharp
public NavigationShell(string title, View brand, IEnumerable<NavigationItem> destinations, bool desktop);
```

Creates a shell with a brand view and a short list of destinations.

- **`title`** — Application title shown in the desktop sidebar.

- **`brand`** — Logo or other home-page branding.

- **`destinations`** — Unique, nonempty destination IDs; &quot;Home&quot; is reserved.

- **`desktop`** — Whether to show a persistent sidebar.

<a id="api-29a938934a5528fb"></a>

### [`void NavigationShell.ArrangeCore(Rect rect, IMeasureContext context)`](#api-29a938934a5528fb)


```csharp
protected override void ArrangeCore(Rect rect, IMeasureContext context);
```

Override to arrange children within this view&#39;s final frame.

<a id="api-786a50cf5f79ddd7"></a>

### [`Size NavigationShell.MeasureCore(Size available, IMeasureContext context)`](#api-786a50cf5f79ddd7)


```csharp
protected override Size MeasureCore(Size available, IMeasureContext context);
```

Override to compute the desired border-edge size.

<a id="api-a23cdd3e3da8c519"></a>

### [`void NavigationShell.Navigate(string id)`](#api-a23cdd3e3da8c519)


```csharp
public void Navigate(string id);
```

Opens a destination. Desktop pages retain their state while switching.

<a id="api-1dda2e1f113c3ff6"></a>

### [`void NavigationShell.RenderCore(IContext context)`](#api-1dda2e1f113c3ff6)


```csharp
protected override void RenderCore(IContext context);
```

Override to render this view and its children.

