Class AutoNavigationIntentAttribute
- Namespace
- Nalu
- Assembly
- Nalu.Maui.Navigation.dll
Tunes how the Nalu navigation source generator registers an intent type for
navigation-state restore (the generated AddIntents()). The attribute only governs
the automatic restore registration — an intent works as a navigation intent with or
without it.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct)]
public sealed class AutoNavigationIntentAttribute : Attribute
- Inheritance
-
AutoNavigationIntentAttribute
- Inherited Members
Remarks
Without the attribute an intent discovered through IEnteringAware<TIntent> / IAppearingAware<TIntent> implementations is registered as restorable under its short type name. Intents implementing Nalu.IAwaitableIntentController (e.g. deriving from AwaitableIntent) are never registered: their completion source cannot survive an app restart.
Constructors
AutoNavigationIntentAttribute(string?)
Tunes how the Nalu navigation source generator registers an intent type for
navigation-state restore (the generated AddIntents()). The attribute only governs
the automatic restore registration — an intent works as a navigation intent with or
without it.
public AutoNavigationIntentAttribute(string? typeId = null)
Parameters
typeIdstringOptional stable snapshot type id used instead of the type's short name — the generated registration passes it as the
typeIdof AddIntent<T>(string?): renames only invalidate old snapshots, they never deserialize the wrong thing. Required (enforced by a generator diagnostic) when two restorable intents share the same short name.
Remarks
Without the attribute an intent discovered through IEnteringAware<TIntent> / IAppearingAware<TIntent> implementations is registered as restorable under its short type name. Intents implementing Nalu.IAwaitableIntentController (e.g. deriving from AwaitableIntent) are never registered: their completion source cannot survive an app restart.
Properties
Enabled
Whether the automatic restore registration is enabled for this intent. Defaults to true. When false the intent is not restorable: a page reached with it ends the restorable stack (it and the pages above it are not restored) — the pre-existing behavior for unregistered intents.
public bool Enabled { get; set; }
Property Value
Id
Gets the stable snapshot type id; null uses the type's short name.
(Named Id because TypeId already exists.)
public string? Id { get; }