Table of Contents

Interface IIntentSerializer

Namespace
Nalu
Assembly
Nalu.Maui.Navigation.dll

Serializes captured intents into the navigation-state snapshot and back. Intents are plain objects serialized as-is (JSON by default): mark properties that cannot (or should not) serialize with JsonIgnoreAttribute and rehydrate them on restore via IIntentHydrator<TIntent>. The default implementation uses System.Text.Json reflection; supply a source-generated JsonSerializerContext via IntentSerializerContext (or replace this service in DI) for trimming/NativeAOT-safe apps.

public interface IIntentSerializer

Methods

Deserialize(Type, string)

Deserializes a wire payload back into the given registered intent type.

object Deserialize(Type intentType, string payload)

Parameters

intentType Type

The registered intent type resolved from the snapshot's stable type id.

payload string

The wire payload produced by Serialize(object).

Returns

object

Serialize(object)

Serializes the intent to its wire payload.

string Serialize(object intent)

Parameters

intent object

The intent instance; its runtime type is registered via AddIntent<T>(string?).

Returns

string