public sealed record NavigationRequestOptions : IEquatable<NavigationRequestOptions> Options of one navigation request.
Parameters
ExpectedCurrentThe entry that must be current when the request is admitted and when it commits; otherwise the request is rejected with
NavigationRejection.NotCurrent.
Constructors
NavigationRequestOptions
public NavigationRequestOptions(NavigationEntryId? ExpectedCurrent = null) Options of one navigation request.
Parameters
ExpectedCurrentThe entry that must be current when the request is admitted and when it commits; otherwise the request is rejected with
NavigationRejection.NotCurrent.
Properties
Admission
public NavigationAdmission? Admission { get; init; } Gets the admission policy of this request, overriding the region's NavigationRegionOptions.Admission, or null to use the region's. Pass NavigationAdmission.Supersede for a request that must never be rejected as NavigationRejection.Busy, such as the clear of a window close.
ExpectedCurrent
public NavigationEntryId? ExpectedCurrent { get; init; } The entry that must be current when the request is admitted and when it commits; otherwise the request is rejected with NavigationRejection.NotCurrent.
Requester
public NavigationEntryId? Requester { get; init; } Gets the entry on whose behalf the request is made, or null. When set, the request is rejected with NavigationRejection.NotCurrent, and Rejected.By set to this entry, unless the entry and every entry that owns its region, up to a region the navigator's content does not own, are current when the request is admitted and when it commits, and each of those regions that is in a NavigationSelection is its selected region.
Remarks
Use it for navigation that work of an entry starts late, such as an operation that completes and then opens a page in a parent or sibling region: when the entry was retained or retired in the meantime, the request does nothing. NavigationRequestOptions.ExpectedCurrent checks only the current entry of the region the request is made to; an entry that navigates its own region uses NavigationEntryContext.BackAsync or NavigationEntryContext.CompleteAsync, which already expect it to be current. An unknown entry, or one that finished retiring, is not current. A page in a tab that is not selected can still navigate its own region that way, but a request it makes as requester to the page that shows the tabs, or to a sibling region, is rejected.
RetainView
public bool? RetainView { get; init; } Gets whether a presentation that can keep views keeps the view of the entry this request creates while that entry is retained, and shows it again when the entry becomes current again, or null, the default, to follow the presentation's own setting. It applies to the entry of a Push, Replace or Reset, including NavigationRegion.PushForResult; requests that create no entry ignore it. The entry reports it as NavigationEntry.RetainView.
Remarks
It overrides the presentation's setting for one entry in either direction: true keeps the view of an entry whose presentation doesn't keep views, such as a long form or a list with a scroll position in a region whose other pages are cheap to rebuild; false rebuilds the view of an entry whose presentation keeps views. NavigationHost in Runic.Navigation.Wpf reads it in place of RetainViews; presentations that don't keep views, such as Runic Views pages, ignore it.
It never changes the entry's lifetime: the entry is retained or retires as without the option, and a kept view is dropped when its entry leaves the region's stack, also while the content's disposal waits for operations declared RunicOperationRetirement.Cancel or Drain (INavigationPresentation.ForgetAsync).