Xui.ToolKit.UI.Navigation

Assembly: Xui.ToolKit.UI · C# declarations · Assembly overview

Types

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.

public sealed record NavigationItem(string Id, string Title, Func<View> Create);

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.

Func<View> NavigationItem.Create

public Func<View> Create { get; init; }

Creates a fresh, unattached view for this destination.

string NavigationItem.Id

public string Id { get; init; }

Stable application-defined destination identifier.

string NavigationItem.Title

public string Title { get; init; }

Label shown in navigation and the page header.

class NavigationPage

A page title, optional Back button, and a content view.

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);
}

public NavigationPage(string title, View content, Action? goBack = null);

Creates page chrome around application content.

void NavigationPage.ArrangeCore(Rect rect, IMeasureContext context)

protected override void ArrangeCore(Rect rect, IMeasureContext context);

Override to arrange children within this view's final frame.

Size NavigationPage.MeasureCore(Size available, IMeasureContext context)

protected override Size MeasureCore(Size available, IMeasureContext context);

Override to compute the desired border-edge size.

class NavigationShell

A small application shell: a home page and push navigation on mobile, or a persistent sidebar with replaceable content on desktop.

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);
}

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; "Home" is reserved.

  • desktop — Whether to show a persistent sidebar.

void NavigationShell.ArrangeCore(Rect rect, IMeasureContext context)

protected override void ArrangeCore(Rect rect, IMeasureContext context);

Override to arrange children within this view's final frame.

Size NavigationShell.MeasureCore(Size available, IMeasureContext context)

protected override Size MeasureCore(Size available, IMeasureContext context);

Override to compute the desired border-edge size.

void NavigationShell.Navigate(string id)

public void Navigate(string id);

Opens a destination. Desktop pages retain their state while switching.

void NavigationShell.RenderCore(IContext context)

protected override void RenderCore(IContext context);

Override to render this view and its children.