Language

IModalNavigationHost Interface

Definition

Exposes the cross-platform modal navigation state that a IModalNavigationPlatform needs in order to present and dismiss modal pages.

public interface class IModalNavigationHost
public interface IModalNavigationHost
type IModalNavigationHost = interface
Public Interface IModalNavigationHost

Remarks

The framework implements this interface and supplies an instance to CreateModalNavigationPlatform(IModalNavigationHost). One host exists per Window, so an implementation must never be shared between windows.

The framework owns the cross-platform modal stack, the page lifecycle events (Appearing/Disappearing, NavigatedTo/NavigatedFrom), the ModalPushing/ModalPopped events and the reconciliation loop that keeps the platform stack in sync with the requested stack. A platform implementation is only responsible for the visual presentation of a single push or pop.

Every member except RequestSync() must be read on the UI thread.

Properties

Name Description
CurrentPage

Gets the page the user is expected to be looking at once the cross-platform modal stack is fully applied. This is the topmost requested modal, or the window's page when no modal is requested, with Shell unwrapped to its current page.

CurrentPlatformPage

Gets the page that is currently hosting content on the platform: the topmost entry of PlatformModalStack, or the window's page when no modal has been presented.

IsBatchPopping

Gets a hint indicating that several modals are being dismissed as a single batch, for example during a Shell pop-to-root.

IsBatchPushing

Gets a hint indicating that several modals are being presented as a single batch, for example while a Shell applies a navigation state that contains multiple modals.

IsWindowReady

Gets a value indicating whether the framework side of the window is ready for modal presentation: the window and its page both have handlers.

MauiContext

Gets the IMauiContext scoped to Window.

PlatformModalStack

Gets the modal pages that the platform has actually presented, in push order. The last entry is the modal currently on screen.

Window

Gets the window that owns this modal navigation host.

Methods

Name Description
RequestSync()

Asks the framework to re-run the reconciliation loop that compares the requested modal stack with PlatformModalStack and issues any push or pop that is still outstanding.

Applies to