using System; using System.Threading.Tasks; namespace Artemis.UI.Shared.Routing; /// /// Represents an object that contains information about the current navigation action. /// public class NavigationArguments { internal NavigationArguments(IRouter router, RouterNavigationOptions options, string path, object[] routeParameters) { Router = router; Options = options; Path = path; RouteParameters = routeParameters; SegmentParameters = Array.Empty(); } /// /// Gets the router in which the navigation is taking place. /// public IRouter Router { get; } /// /// Gets the options that are being used for this navigation. /// public RouterNavigationOptions Options { get; } /// /// Gets the path of the route that is being navigated to. /// public string Path { get; } /// /// GEts an array of all parameters provided to this route. /// public object[] RouteParameters { get; } /// /// Gets an array of parameters provided to this screen's segment of the route. /// public object[] SegmentParameters { get; internal set; } internal bool Cancelled { get; private set; } /// /// Cancels further processing of the current navigation. /// /// It not necessary to cancel the navigation in order to navigate to another route, the current navigation will be cancelled by the router. public void Cancel() { Cancelled = true; } }