Skip to content

RoutingState.CanNavigateBack property

Defined in

Type: RoutingState Namespace: ReactiveUI.Reactive Assembly: ReactiveUI.Reactive.dll

Applies to

net10.0, net10.0-ios26.0, net10.0-android36.0, net10.0-maccatalyst26.0, net10.0-tvos26.0, net10.0-macos26.0, net9.0, net8.0, net462, net481

Attributes: [IgnoreDataMember] [JsonIgnore]

public IObservable<bool> CanNavigateBack { get; protected set; }

View source

Summary: Gets an observable that reports whether there is a view model to go back to, which is true while the stack holds at least two view models. It emits the current answer when you subscribe, then again each time the answer changes. NavigateBack uses it to decide when it can execute.

Returns: IObservable

Examples

<![CDATA[
 using var subscription = screen.Router.CanNavigateBack
 .Subscribe(canGoBack => backButton.IsEnabled = canGoBack);
 ]]>