IRoutableViewModel interface¶
Defined in
Namespace: ReactiveUI Assembly: ReactiveUI.dll Full name: ReactiveUI.IRoutableViewModel Modifiers: public abstract
Summary¶
Defines the minimum contract for view models that participate in RoutingState navigation.
Applies to
net11.0, net11.0-ios27.2, net11.0-tvos27.2, net11.0-macos27.2, net11.0-android37.0, net11.0-maccatalyst27.2, net10.0, net10.0-tvos26.0, net10.0-ios26.0, net10.0-maccatalyst26.0, net10.0-android36.0, net10.0-macos26.0, net48, net47, net472, net471, net481
Class hierarchy
classDiagram
class IRoutableViewModel
class IReactiveObject {
<<interface>>
}
IReactiveObject <|.. IRoutableViewModel
class INotifyPropertyChanged {
<<interface>>
}
INotifyPropertyChanged <|.. IRoutableViewModel
class INotifyPropertyChanging {
<<interface>>
}
INotifyPropertyChanging <|.. IRoutableViewModel
class IEnableLogger {
<<interface>>
}
IEnableLogger <|.. IRoutableViewModel
Implements: IReactiveObject, INotifyPropertyChanged (opens in a new tab), INotifyPropertyChanging (opens in a new tab), IEnableLogger
Remarks¶
Routable view models expose a user-readable UrlPathSegment used for diagnostics / navigation breadcrumbs and keep a reference to the owning IScreen so that downstream navigation commands can be issued.
Examples¶
<![CDATA[
public class SettingsViewModel : ReactiveObject, IRoutableViewModel
{
public SettingsViewModel(IScreen hostScreen) => HostScreen = hostScreen;
public string? UrlPathSegment => "settings";
public IScreen HostScreen { get; }
}
]]>
Properties¶
| Name | Summary |
|---|---|
| UrlPathSegment | Gets a string token representing the current view model, such as "login" or "user". |
| HostScreen | Gets the [IScreen](# instance that hosts this view model. Use this reference to access the shared [RoutingState](# when chaining navigation from child... |