public sealed record NavigationSelectionPath : IEquatable<NavigationSelectionPath> A selection of a NavigationPath, such as document tabs: each region of it by position, and the selected one. Restoring it creates regions beyond the selection's current ones with NavigationSelectionOptions.RestoreRegion.
Parameters
RegionsThe selection's regions, in presentation order.
SelectedIndexThe index of the selected region, or -1 when the selection was empty. The JSON property is
selected.
Constructors
NavigationSelectionPath
public NavigationSelectionPath(IReadOnlyList<NavigationRegionPath> Regions, int SelectedIndex) A selection of a NavigationPath, such as document tabs: each region of it by position, and the selected one. Restoring it creates regions beyond the selection's current ones with NavigationSelectionOptions.RestoreRegion.
Parameters
RegionsThe selection's regions, in presentation order.
SelectedIndexThe index of the selected region, or -1 when the selection was empty. The JSON property is
selected.
Properties
Regions
public IReadOnlyList<NavigationRegionPath> Regions { get; init; } The selection's regions, in presentation order.
SelectedIndex
public int SelectedIndex { get; init; } The index of the selected region, or -1 when the selection was empty. The JSON property is selected.
Methods
FromJson
public static NavigationSelectionPath FromJson(string json) Reads a selection that NavigationSelectionPath.ToJson wrote. Unknown properties are ignored.
Exceptions
FormatExceptionThe text is not one navigation selection, has a newer
version, or exceeds the bounds ofNavigationPath.FromJson.
ToJson
public string ToJson() Writes the selection as JSON, as an element of selections in NavigationPath.ToJson: {"version":1,"regions":[],"selections":[{"selected":0,"regions":[{"entries":[…]}]}]}.
Remarks
Use it to store one selection, such as a tab strip, without the rest of the navigator; restore it with NavigationSelection.RestoreAsync.