Table of Contents

Class NavigationConfigurator

Namespace
Nalu
Assembly
Nalu.Maui.Navigation.dll

Provides a fluent API for configuring Nalu navigation.

public class NavigationConfigurator : INavigationConfiguration
Inheritance
NavigationConfigurator
Implements
Inherited Members

Properties

BackImage

Gets the image used to display a navigation back button on nested pages.

public ImageSource? BackImage { get; }

Property Value

ImageSource

LeakDetectorState

Gets the navigation leak detector state.

public NavigationLeakDetectorState LeakDetectorState { get; }

Property Value

NavigationLeakDetectorState

Mapping

Gets a dictionary which maps a page model type to corresponding page type.

public IReadOnlyDictionary<Type, Type> Mapping { get; }

Property Value

IReadOnlyDictionary<Type, Type>

MenuImage

Gets the image used to display a navigation menu button on root pages.

public ImageSource? MenuImage { get; }

Property Value

ImageSource

NavigationIntentBehavior

Gets the navigation intent behavior.

public NavigationIntentBehavior NavigationIntentBehavior { get; }

Property Value

NavigationIntentBehavior

Methods

AddPage(Type, Type)

Registers pageType as the view for pageModelType. Adds pageType and pageModelType as scoped services.

public NavigationConfigurator AddPage(Type pageModelType, Type pageType)

Parameters

pageModelType Type

Type of the page model.

pageType Type

Type of the page.

Returns

NavigationConfigurator

AddPage(Type, Type, Type)

Registers pageType as the view for pageModelType. Adds pageType and pageModelType as scoped services.

public NavigationConfigurator AddPage(Type pageModelType, Type pageModelImplementationType, Type pageType)

Parameters

pageModelType Type

Type of the page model interface.

pageModelImplementationType Type

Type of the page model implementation.

pageType Type

Type of the page.

Returns

NavigationConfigurator

AddPage<TPageModel, TPage>()

Registers TPage as the view for TPageModel. Adds TPage and TPageModel as scoped services.

public NavigationConfigurator AddPage<TPageModel, TPage>() where TPageModel : class, INotifyPropertyChanged where TPage : ContentPage

Returns

NavigationConfigurator

Type Parameters

TPageModel

Type of the page model.

TPage

Type of the page.

AddPage<TPageModel, TPageModelImplementation, TPage>()

Registers TPage as the view for TPageModel. Adds TPage and TPageModel as scoped services.

public NavigationConfigurator AddPage<TPageModel, TPageModelImplementation, TPage>() where TPageModel : class, INotifyPropertyChanged where TPageModelImplementation : TPageModel where TPage : ContentPage

Returns

NavigationConfigurator

Type Parameters

TPageModel

Type of the page model.

TPageModelImplementation

Type of the page model implementation.

TPage

Type of the page.

AddPages(Func<string, string>, params Assembly[])

Registers all ContentPages matching a page model via provided <code class="paramref">pageToModelNameConvention</code> naming convention and adds them all as scoped services.

public NavigationConfigurator AddPages(Func<string, string> pageToModelNameConvention, params Assembly[] otherAssemblies)

Parameters

pageToModelNameConvention Func<string, string>

Given a page class name returns the corresponding page model class name.

otherAssemblies Assembly[]

Assemblies to look for pages and page models.

Returns

NavigationConfigurator

Remarks

If corresponding interface is found IMyPageModel the view model will be registered through the interface.

AddPages(params Assembly[])

Registers all ContentPages matching a page model via default naming convention MyPage => MyPageModel naming convention and adds them all as scoped services.

public NavigationConfigurator AddPages(params Assembly[] otherAssemblies)

Parameters

otherAssemblies Assembly[]

Assemblies to look for pages and page models.

Returns

NavigationConfigurator

WithBackImage(ImageSource)

Sets back navigation image.

public NavigationConfigurator WithBackImage(ImageSource imageSource)

Parameters

imageSource ImageSource

Image to use for back navigation button.

Returns

NavigationConfigurator

WithLeakDetectorState(NavigationLeakDetectorState)

Sets the navigation leak detector state.

public NavigationConfigurator WithLeakDetectorState(NavigationLeakDetectorState state)

Parameters

state NavigationLeakDetectorState

Whether the leak detector should be enabled or not.

Returns

NavigationConfigurator

WithMenuImage(ImageSource)

Sets back navigation image.

public NavigationConfigurator WithMenuImage(ImageSource imageSource)

Parameters

imageSource ImageSource

Image to use for back navigation button.

Returns

NavigationConfigurator

WithNavigationIntentBehavior(NavigationIntentBehavior)

Defines how lifecycle events should be handled when an intent is detected.

public NavigationConfigurator WithNavigationIntentBehavior(NavigationIntentBehavior behavior)

Parameters

behavior NavigationIntentBehavior

The behavior to use.

Returns

NavigationConfigurator