Table of Contents

Class NavigationViewBuilder

Namespace
SharpConsoleUI.Builders
Assembly
SharpConsoleUI.dll

Fluent builder for NavigationView controls.

public sealed class NavigationViewBuilder : IControlBuilder<NavigationView>
Inheritance
NavigationViewBuilder
Implements
Inherited Members
Extension Methods

Methods

AddHeader(string, Color, Action<NavigationHeaderBuilder>)

Adds a header with the specified color and child items.

public NavigationViewBuilder AddHeader(string text, Color color, Action<NavigationHeaderBuilder> configure)

Parameters

text string
color Color
configure Action<NavigationHeaderBuilder>

Returns

NavigationViewBuilder

AddHeader(string, Action<NavigationHeaderBuilder>)

Adds a header with child items configured via the nested builder.

public NavigationViewBuilder AddHeader(string text, Action<NavigationHeaderBuilder> configure)

Parameters

text string
configure Action<NavigationHeaderBuilder>

Returns

NavigationViewBuilder

AddItem(NavigationItem, Action<ScrollablePanelControl>?)

Adds a navigation item with optional content factory.

public NavigationViewBuilder AddItem(NavigationItem item, Action<ScrollablePanelControl>? content = null)

Parameters

item NavigationItem
content Action<ScrollablePanelControl>

Returns

NavigationViewBuilder

AddItem(string, string?, string?, Action<ScrollablePanelControl>?)

Adds a navigation item with optional content factory.

public NavigationViewBuilder AddItem(string text, string? icon = null, string? subtitle = null, Action<ScrollablePanelControl>? content = null)

Parameters

text string
icon string
subtitle string
content Action<ScrollablePanelControl>

Returns

NavigationViewBuilder

Build()

Builds the NavigationView control.

public NavigationView Build()

Returns

NavigationView

Fill()

Makes the control fill the available vertical space.

public NavigationViewBuilder Fill()

Returns

NavigationViewBuilder

OnSelectedItemChanged(EventHandler<NavigationItemChangedEventArgs>)

Attaches a handler for the SelectedItemChanged event.

public NavigationViewBuilder OnSelectedItemChanged(EventHandler<NavigationItemChangedEventArgs> handler)

Parameters

handler EventHandler<NavigationItemChangedEventArgs>

Returns

NavigationViewBuilder

OnSelectedItemChanging(EventHandler<NavigationItemChangingEventArgs>)

Attaches a handler for the SelectedItemChanging event.

public NavigationViewBuilder OnSelectedItemChanging(EventHandler<NavigationItemChangingEventArgs> handler)

Parameters

handler EventHandler<NavigationItemChangingEventArgs>

Returns

NavigationViewBuilder

Visible(bool)

Sets the visibility.

public NavigationViewBuilder Visible(bool visible = true)

Parameters

visible bool

Returns

NavigationViewBuilder

WithAlignment(HorizontalAlignment)

Sets the horizontal alignment.

public NavigationViewBuilder WithAlignment(HorizontalAlignment alignment)

Parameters

alignment HorizontalAlignment

Returns

NavigationViewBuilder

WithAnimateTransitions(bool)

Sets whether width transitions are animated.

public NavigationViewBuilder WithAnimateTransitions(bool animate)

Parameters

animate bool

Returns

NavigationViewBuilder

WithCompactPaneWidth(int)

Sets the width of the navigation pane in Compact display mode.

public NavigationViewBuilder WithCompactPaneWidth(int width)

Parameters

width int

Returns

NavigationViewBuilder

WithCompactThreshold(int)

Sets the width threshold at or above which Auto mode resolves to Compact.

public NavigationViewBuilder WithCompactThreshold(int threshold)

Parameters

threshold int

Returns

NavigationViewBuilder

WithContentBackground(Color)

Sets the content panel background color.

public NavigationViewBuilder WithContentBackground(Color color)

Parameters

color Color

Returns

NavigationViewBuilder

WithContentBorder(BorderStyle)

Sets the content panel border style.

public NavigationViewBuilder WithContentBorder(BorderStyle style)

Parameters

style BorderStyle

Returns

NavigationViewBuilder

WithContentBorderColor(Color)

Sets the content panel border color.

public NavigationViewBuilder WithContentBorderColor(Color color)

Parameters

color Color

Returns

NavigationViewBuilder

WithContentHeader(bool)

Sets whether to show the content header.

public NavigationViewBuilder WithContentHeader(bool show)

Parameters

show bool

Returns

NavigationViewBuilder

WithContentPadding(int, int, int, int)

Sets the content panel padding.

public NavigationViewBuilder WithContentPadding(int left, int top, int right, int bottom)

Parameters

left int
top int
right int
bottom int

Returns

NavigationViewBuilder

WithContentToolbar(Action<ToolbarControl>)

Configures the content toolbar in the header area.

public NavigationViewBuilder WithContentToolbar(Action<ToolbarControl> configure)

Parameters

configure Action<ToolbarControl>

Returns

NavigationViewBuilder

WithExpandedThreshold(int)

Sets the width threshold at or above which Auto mode resolves to Expanded.

public NavigationViewBuilder WithExpandedThreshold(int threshold)

Parameters

threshold int

Returns

NavigationViewBuilder

WithMargin(Margin)

Sets the margin.

public NavigationViewBuilder WithMargin(Margin margin)

Parameters

margin Margin

Returns

NavigationViewBuilder

WithMargin(int, int, int, int)

Sets the margin.

public NavigationViewBuilder WithMargin(int left, int top, int right, int bottom)

Parameters

left int
top int
right int
bottom int

Returns

NavigationViewBuilder

WithName(string)

Sets the control name.

public NavigationViewBuilder WithName(string name)

Parameters

name string

Returns

NavigationViewBuilder

WithNavWidth(int)

Sets the width of the navigation pane.

public NavigationViewBuilder WithNavWidth(int width)

Parameters

width int

Returns

NavigationViewBuilder

WithPaneDisplayMode(NavigationViewDisplayMode)

Sets the pane display mode.

public NavigationViewBuilder WithPaneDisplayMode(NavigationViewDisplayMode mode)

Parameters

mode NavigationViewDisplayMode

Returns

NavigationViewBuilder

WithPaneHeader(string)

Sets the pane header markup text.

public NavigationViewBuilder WithPaneHeader(string markup)

Parameters

markup string

Returns

NavigationViewBuilder

WithSelectedColors(Color, Color)

Sets the colors for the selected navigation item.

public NavigationViewBuilder WithSelectedColors(Color foreground, Color background)

Parameters

foreground Color
background Color

Returns

NavigationViewBuilder

WithSelectedIndex(int)

Sets the initially selected item index.

public NavigationViewBuilder WithSelectedIndex(int index)

Parameters

index int

Returns

NavigationViewBuilder

WithSelectionIndicator(char)

Sets the selection indicator character.

public NavigationViewBuilder WithSelectionIndicator(char indicator)

Parameters

indicator char

Returns

NavigationViewBuilder

WithStickyPosition(StickyPosition)

Sets the sticky position.

public NavigationViewBuilder WithStickyPosition(StickyPosition position)

Parameters

position StickyPosition

Returns

NavigationViewBuilder

WithTag(object)

Sets a tag object.

public NavigationViewBuilder WithTag(object tag)

Parameters

tag object

Returns

NavigationViewBuilder

WithVerticalAlignment(VerticalAlignment)

Sets the vertical alignment.

public NavigationViewBuilder WithVerticalAlignment(VerticalAlignment alignment)

Parameters

alignment VerticalAlignment

Returns

NavigationViewBuilder

WithWidth(int)

Sets the width.

public NavigationViewBuilder WithWidth(int width)

Parameters

width int

Returns

NavigationViewBuilder

Operators

implicit operator NavigationView(NavigationViewBuilder)

Implicit conversion to NavigationView.

public static implicit operator NavigationView(NavigationViewBuilder builder)

Parameters

builder NavigationViewBuilder

Returns

NavigationView