Xui.ToolKit.UI.Mobile.Navigation
Assembly: Xui.ToolKit.UI · C# declarations · Assembly overview
Types
interface INavigationinterface INavigationAwareinterface IPageenum NavigationDirectionenum NavigationPhaseenum NavigationRolereadonly record struct NavigationStateChangeclass NavigationViewenum PageClipModereadonly record struct PagePresentation
interface INavigation
Commands and state exposed by a navigation host.
public interface INavigation
{
bool CanGoBack { get; }
bool IsTransitioning { get; }
void Push(View page);
void Pop();
}
bool INavigation.CanGoBack
bool CanGoBack { get; }
Gets whether the current page has a previous page.
bool INavigation.IsTransitioning
bool IsTransitioning { get; }
Gets whether a push, pop, or interactive pop is active.
void INavigation.Pop()
void Pop();
Pops the current page, if one exists beneath it.
void INavigation.Push(View page)
void Push(View page);
Pushes page above the current page.
interface INavigationAware
Implemented by pages that synchronize custom visuals with navigation progress.
public interface INavigationAware
{
void OnNavigationStateChanged(in NavigationStateChange change);
}
void INavigationAware.OnNavigationStateChanged(in NavigationStateChange change)
void OnNavigationStateChanged(in NavigationStateChange change);
Receives lifecycle and progress changes for this page.
interface IPage
Optional page metadata used by Xui.ToolKit.UI.Mobile.Navigation.NavigationView.
public interface IPage
{
PagePresentation Presentation { get; }
}
PagePresentation IPage.Presentation
PagePresentation Presentation { get; }
Gets the page's surface, clipping, and transition-shadow preferences.
enum NavigationDirection
Describes the direction of a navigation transition.
public enum NavigationDirection
{
None,
Forward,
Backward,
}
NavigationDirection.Backward
Backward
A pop toward a previous page.
NavigationDirection.Forward
Forward
A push toward a newer page.
NavigationDirection.None
None
No direction, used when a transition is not applicable.
enum NavigationPhase
Describes the lifecycle point of a navigation transition.
public enum NavigationPhase
{
WillAppear,
Appearing,
Appeared,
WillDisappear,
Disappearing,
Disappeared,
Cancelled,
}
NavigationPhase.Appeared
Appeared
The page is fully visible.
NavigationPhase.Appearing
Appearing
The page is becoming visible; use Xui.ToolKit.UI.Mobile.Navigation.NavigationStateChange.Progress.
NavigationPhase.Cancelled
Cancelled
An interactive transition was returned to its starting page.
NavigationPhase.Disappeared
Disappeared
The page is no longer visible.
NavigationPhase.Disappearing
Disappearing
The page is becoming hidden; use Xui.ToolKit.UI.Mobile.Navigation.NavigationStateChange.Progress.
NavigationPhase.WillAppear
WillAppear
The page is about to become visible.
NavigationPhase.WillDisappear
WillDisappear
The page is about to become hidden.
enum NavigationRole
Describes whether a page is entering or leaving a transition.
public enum NavigationRole
{
Incoming,
Outgoing,
}
NavigationRole.Incoming
Incoming
The page being revealed.
NavigationRole.Outgoing
Outgoing
The page being covered or removed.
readonly record struct NavigationStateChange
Allocation-free notification sent only to pages participating in a transition.
public readonly record struct NavigationStateChange(NavigationPhase Phase, NavigationDirection Direction, NavigationRole Role, nfloat Progress, bool IsInteractive);
NavigationStateChange.NavigationStateChange(NavigationPhase Phase, NavigationDirection Direction, NavigationRole Role, NFloat Progress, bool IsInteractive)
public NavigationStateChange(NavigationPhase Phase, NavigationDirection Direction, NavigationRole Role, nfloat Progress, bool IsInteractive);
Allocation-free notification sent only to pages participating in a transition.
NavigationDirection NavigationStateChange.Direction
public NavigationDirection Direction { get; init; }
bool NavigationStateChange.IsInteractive
public bool IsInteractive { get; init; }
NavigationPhase NavigationStateChange.Phase
public NavigationPhase Phase { get; init; }
NFloat NavigationStateChange.Progress
public nfloat Progress { get; init; }
NavigationRole NavigationStateChange.Role
public NavigationRole Role { get; init; }
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.
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);
}
NavigationView.NavigationView(View rootPage)
public NavigationView(View rootPage);
Creates a navigation stack with rootPage as its first page.
void NavigationView.AnimateCore(TimeSpan previous, TimeSpan current)
protected override void AnimateCore(TimeSpan previous, TimeSpan current);
Override to animate this view and its children.
void NavigationView.ArrangeCore(Rect rect, IMeasureContext context)
protected override void ArrangeCore(Rect rect, IMeasureContext context);
Override to arrange children within this view's final frame.
NFloat NavigationView.BackSwipeEdgeWidth
public nfloat BackSwipeEdgeWidth { get; set; }
Width of the leading-edge region that may start an interactive pop.
bool NavigationView.CanGoBack
public bool CanGoBack { get; }
Gets whether the current page has a previous page.
Color NavigationView.DefaultPageBackground
public Color DefaultPageBackground { get; set; }
Default opaque surface behind pages that do not provide a background.
bool NavigationView.DrawsOpaqueFullScreen
public bool DrawsOpaqueFullScreen { get; }
Whether the current state paints the whole display area opaquely.
bool NavigationView.IsTransitioning
public bool IsTransitioning { get; }
Gets whether a push, pop, or interactive pop is active.
Size NavigationView.MeasureCore(Size available, IMeasureContext context)
protected override Size MeasureCore(Size available, IMeasureContext context);
Override to compute the desired border-edge size.
void NavigationView.OnActivate()
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.
void NavigationView.OnPointerEvent(ref PointerEventRef e, EventPhase phase)
public override void OnPointerEvent(ref PointerEventRef e, EventPhase phase);
Called during event dispatch to handle a pointer event in a specific event phase.
View? NavigationView.OverlayContent
public View? OverlayContent { get; set; }
Optional content rendered above the page stack and docked at the navigation viewport's top-right corner.
void NavigationView.Pop()
public void Pop();
Pops the current page, if one exists beneath it.
void NavigationView.Push(View page)
public void Push(View page);
Pushes page above the current page.
void NavigationView.RenderCore(IContext context)
protected override void RenderCore(IContext context);
Override to render this view and its children.
TimeSpan NavigationView.TransitionDuration
public TimeSpan TransitionDuration { get; set; }
Duration of non-interactive pushes and pops.
CubicBezier NavigationView.TransitionEasing
public Easing.CubicBezier TransitionEasing { get; set; }
Fast decelerating curve used by UIKit-style navigation transitions.
bool NavigationView.UsesBackgroundTransitionShade
public bool UsesBackgroundTransitionShade { get; set; }
Gets or sets whether the back page is darkened during navigation transitions.
bool NavigationView.UsesRoundedPageTransitionShadow
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.
enum PageClipMode
Controls the clipping applied by Xui.ToolKit.UI.Mobile.Navigation.NavigationView to a page.
public enum PageClipMode
{
Device,
Bounds,
None,
}
PageClipMode.Bounds
Bounds
Clips to the square navigation bounds.
PageClipMode.Device
Device
Clips to the display bounds and physical screen corner radius.
PageClipMode.None
None
Does not apply a navigation clip.
readonly record struct PagePresentation
Presentation preferences supplied by a page to its navigation host.
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; }
}
PagePresentation.PagePresentation()
public PagePresentation();
Creates the default opaque, device-clipped page presentation with its transition shadow enabled.
PagePresentation.PagePresentation(Color? background, PageClipMode clip, bool usesTransitionShadow)
public PagePresentation(Color? background, PageClipMode clip, bool usesTransitionShadow);
Creates a page presentation with explicit surface, clipping, and shadow preferences.
Color? PagePresentation.Background
public Color? Background { get; init; }
Gets the page background, or null to use the navigation default.
PageClipMode PagePresentation.Clip
public PageClipMode Clip { get; init; }
Gets the clipping applied to the page.
bool PagePresentation.UsesTransitionShadow
public bool UsesTransitionShadow { get; init; }
Gets whether the transition shadow is drawn for this page.