Interface IComponentPageFactory
- Namespace
- Nalu
- Assembly
- Nalu.Maui.Navigation.dll
Bridges component-based UI frameworks (MauiReactor, Comet, …) into Nalu navigation:
turns a component instance into the native Page it renders.
Register an implementation via UseComponentPageFactory<TFactory>() to enable
AddPage<TPage>() with non-Page types —
the MauiReactor guide in the conceptual docs carries a ready-to-paste implementation.
public interface IComponentPageFactory
Remarks
The factory runs inside the page's own navigation DI scope: the component instance is resolved from that scope (constructor injection works) and handed over as-is. The returned handle owns the mounted component tree — Nalu disposes it when the page leaves the navigation stack, BEFORE the page's service scope is disposed.
Methods
CreatePage(object)
Mounts component and returns a handle to the native page it renders.
Must complete synchronously: the page is pushed (and its presentation mode read)
immediately after this call returns.
IComponentPageHandle CreatePage(object component)
Parameters
componentobjectThe component instance, resolved from the page's navigation scope.
Returns
Exceptions
- InvalidOperationException
The component does not render a Page.