Table of Contents

Class ScaffoldNavBarView

Namespace
Nalu
Assembly
Nalu.Maui.Scaffold.dll

The default Nalu navigation bar component, created automatically as the NavBarTemplateProperty default at the scaffold level. Slots, in order: start-drawer button, back button, title (or the page's TitleViewProperty content), the page's ToolbarItems (as many primary items as fit, the rest and the secondary ones behind an overflow menu — see ScaffoldToolbarItemsView; the title is KeepTitleWhole above MinimumTitleWidth), end-drawer button, close button — all driven by the ScaffoldNavBarContext binding context. Style it or replace it entirely with any custom view.

public sealed class ScaffoldNavBarView : Grid, INotifyPropertyChanged, IEffectControlProvider, IToolTipElement, IContextFlyoutElement, IAnimatable, IViewController, IVisualElementController, IElementController, IGestureController, IGestureRecognizers, IPropertyMapperView, IHotReloadableView, IReplaceableView, IBindableLayout, IVisualTreeElement, IGridLayout, ILayout, IView, IElement, ITransform, IContainer, IList<IView>, ICollection<IView>, IEnumerable<IView>, IEnumerable, ISafeAreaView, IPadding, ICrossPlatformLayout
Inheritance
ScaffoldNavBarView
Implements
Inherited Members
Extension Methods

Remarks

The component spans the whole top strip and opts into the safe area itself, so its content sits below the status inset while the bar contributes its footprint to the page. The strip BACKGROUND is not the bar's concern: it belongs to the chrome and is driven by the effective the attached nav bar appearance properties (attached via Scaffold.NavBarBackground) — the same is true for any custom bar.

It owns ONLY the strip metrics (height, padding, spacing, the title's reservation). Title and button appearance belong to the primitives — ScaffoldNavBarTitle, ScaffoldBackButton, ScaffoldCloseButton, ScaffoldFlyoutButton — which are public and styled directly, so the SAME style applies whether they sit in this bar or in a custom one:

<Style TargetType="nalu:ScaffoldNavBarTitle">
    <Setter Property="FontFamily" Value="SemiBold" />
</Style>
<Style TargetType="nalu:ScaffoldNavBarButtonBase" ApplyToDerivedTypes="True">
    <Setter Property="IconColor" Value="{StaticResource Accent}" />
</Style>

Constructors

ScaffoldNavBarView()

Initializes the default nav bar.

public ScaffoldNavBarView()

Fields

BarHeightProperty

Bindable property for BarHeight.

public static readonly BindableProperty BarHeightProperty

Field Value

BindableProperty

BarPaddingProperty

Bindable property for BarPadding.

public static readonly BindableProperty BarPaddingProperty

Field Value

BindableProperty

KeepTitleWholeProperty

Bindable property for KeepTitleWhole.

public static readonly BindableProperty KeepTitleWholeProperty

Field Value

BindableProperty

MinimumTitleWidthProperty

Bindable property for MinimumTitleWidth.

public static readonly BindableProperty MinimumTitleWidthProperty

Field Value

BindableProperty

SpacingProperty

Bindable property for Spacing.

public static readonly BindableProperty SpacingProperty

Field Value

BindableProperty

Properties

BarHeight

Gets or sets the bar content height (excluding the status-bar inset).

public double BarHeight { get; set; }

Property Value

double

BarPadding

Gets or sets the padding around the bar content.

public Thickness BarPadding { get; set; }

Property Value

Thickness

KeepTitleWhole

Gets or sets whether the title (or title view) reserves its natural width before the page's toolbar items are offered the rest of the row (true by default): items fold into the overflow menu, the title is never truncated by them. False reduces the reservation to MinimumTitleWidth — the native trade-off, where items win and the title truncates. Native bars let a long item list eat the title; this bar doesn't.

public bool KeepTitleWhole { get; set; }

Property Value

bool

MinimumTitleWidth

Gets or sets the width the title keeps whatever the page's toolbar items ask for (96 by default) — the floor of the reservation (see KeepTitleWhole): the items strip is offered the rest of the row and folds what doesn't fit into its overflow menu. Lower it (a style, or a page-level template) for a bar that favors items.

public double MinimumTitleWidth { get; set; }

Property Value

double

Spacing

Gets or sets the gap around the title column. The icon buttons themselves sit flush (zero spacing): their 44dp tap targets' inner whitespace provides the optical rhythm around the 24dp glyphs.

public double Spacing { get; set; }

Property Value

double