Skip to main content

ViewRoute struct

Namespace: Arlecchino.Navigation · Assembly: Arlecchino

Where to navigate: a name in a struct, compared ordinally. Routes are strings rather than an enum because the framework has to name a screen without seeing the application's types — the generated ViewKind lives in your assembly, not in Arlecchino.

public readonly struct ViewRoute : IEquatable<ViewRoute>

Implements IEquatable<T><ViewRoute>

Constructors

MemberSummary
ViewRoute(string)Where to navigate: a name in a struct, compared ordinally. Routes are strings rather than an enum because the framework has to name a screen without seeing the application's types — the generated ViewKind lives in your assembly, not in Arlecchino.

Properties

MemberSummary
IsNoneWhether this is the empty route.
NameName of the route.
NoneThe empty route: returned from a handler to stay where you are.

Methods

MemberSummary
Deconstruct(out string)
Equals(ViewRoute)Compares routes by name, case-sensitively.
GetHashCode()Hash of the route name.
ToString()The route name, or None for the empty route.

Constructors in detail

ViewRoute(string)

public ViewRoute(string Name);

Where to navigate: a name in a struct, compared ordinally. Routes are strings rather than an enum because the framework has to name a screen without seeing the application's types — the generated ViewKind lives in your assembly, not in Arlecchino.

Parameters

NameTypeDescription
NamestringName of the route.

Properties in detail

IsNone

public bool IsNone { get; }

Whether this is the empty route.

Type bool

Name

public string Name { get; init; }

Name of the route.

Type string

None

public static ViewRoute None { get; }

The empty route: returned from a handler to stay where you are.

Type ViewRoute

Methods in detail

Deconstruct(out string)

public void Deconstruct(out string Name);

Parameters

NameTypeDescription
Namestring

Equals(ViewRoute)

public bool Equals(ViewRoute other);

Compares routes by name, case-sensitively.

Parameters

NameTypeDescription
otherViewRouteThe route to compare with.

Returns booltrue when both name the same screen.

GetHashCode()

public override int GetHashCode();

Hash of the route name.

Returns int — The hash code.

ToString()

public override string ToString();

The route name, or None for the empty route.

Returns string — Readable form of the route.