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
intentTypeTypeThe registered intent type resolved from the snapshot's stable type id.
payloadstringThe wire payload produced by Serialize(object).
Returns
Serialize(object)
Serializes the intent to its wire payload.
string Serialize(object intent)
Parameters
intentobjectThe intent instance; its runtime type is registered via AddIntent<T>(string?).