Class NavBarBindingExtension
- Namespace
- Nalu
- Assembly
- Nalu.Maui.Scaffold.dll
Binds to the ambient ScaffoldNavBarContext from anywhere inside the scaffold's
element tree — custom bars, and page-parented content hosted in the bar (e.g. a
TitleViewProperty view, whose own binding context is the page model):
IsVisible="{nalu:NavBarBinding CanNavigateBack}".
[ContentProperty("Path")]
[RequireService(new Type[] { typeof(IProvideValueTarget) })]
public sealed class NavBarBindingExtension : IMarkupExtension<BindingBase>, IMarkupExtension
- Inheritance
-
NavBarBindingExtension
- Implements
- Inherited Members
Remarks
Resolves the context of the page the target belongs to — page content through its page, bar
content (and a hosted title view) through the bar it is mounted in — so during a transition
each of the two live pages reads its OWN state. Resolution happens when the target is
parented, so declaring the binding before the element is in the tree is fine.
Paths naming a ScaffoldNavBarContext property compile to a typed binding;
deeper paths (e.g. CurrentPage.BindingContext.SomeCommand) are evaluated by
reflection, with the reflected surface preserved under trimming.
Properties
Converter
Gets or sets the converter.
public IValueConverter? Converter { get; set; }
Property Value
ConverterParameter
Gets or sets the converter parameter.
public object? ConverterParameter { get; set; }
Property Value
Mode
Gets or sets the binding mode.
public BindingMode Mode { get; set; }
Property Value
Path
Gets or sets the path within the ScaffoldNavBarContext ('.', the default, binds the context itself).
public string Path { get; set; }
Property Value
StringFormat
Gets or sets the string format.
public string? StringFormat { get; set; }
Property Value
Methods
ProvideValue(IServiceProvider)
public BindingBase ProvideValue(IServiceProvider serviceProvider)
Parameters
serviceProviderIServiceProvider