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