Interface IScreen
- Namespace
- ReactiveUI
- Assembly
- ReactiveUI.dll
Represents any object capable of hosting its own navigation stack via RoutingState.
public interface IScreen
- Extension Methods
Examples
public class AppViewModel : ReactiveObject, IScreen
{
public RoutingState Router { get; } = new();
public ReactiveCommand<Unit, IRoutableViewModel> ShowSettings { get; }
public AppViewModel()
{
ShowSettings = ReactiveCommand.CreateFromObservable(
() => Router.Navigate.Execute(new SettingsViewModel(this)));
}
}
Remarks
Most applications expose a single implementation of IScreen (for example a shell or app view model) that owns the global router. Individual view models can accept an IScreen via constructor injection so they can request navigation without directly referencing UI types.
Properties
Router
Gets the router associated with this screen. The router coordinates navigation requests for all child view models attached to the screen.
RoutingState Router { get; }