Table of Contents

Class MudPageContentNavigation

Namespace
MudBlazor
Assembly
MudBlazor.dll

A drawer used to navigate sections on a page.

public class MudPageContentNavigation : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IAsyncDisposable, IMudStateHasChanged
Inheritance
MudPageContentNavigation
Implements
Inherited Members
Extension Methods

Constructors

MudPageContentNavigation()

public MudPageContentNavigation()

Properties

ActivateFirstSectionAsDefault

If this option is true the first added section will become active when there is no other indication of an active session. Default value is false

[Parameter]
public bool ActivateFirstSectionAsDefault { get; set; }

Property Value

bool

ActiveSection

The currently active session. null if there is no section selected

public MudPageContentSection? ActiveSection { get; }

Property Value

MudPageContentSection

ExpandBehaviour

If there are multiple levels, this property controls they visibility of them.

[Parameter]
public ContentNavigationExpandBehaviour ExpandBehaviour { get; set; }

Property Value

ContentNavigationExpandBehaviour

Headline

The text displayed about the section links. Defaults to "Contents"

[Parameter]
public string Headline { get; set; }

Property Value

string

HierarchyMapper

If there are multiple levels, this can specified to make a mapping between a level class like "second-level" and the level in the hierarchy

[Parameter]
public IDictionary<string, int> HierarchyMapper { get; set; }

Property Value

IDictionary<string, int>

ScrollContainerSelector

The CSS selector used to identify the scroll container

[Parameter]
public string ScrollContainerSelector { get; set; }

Property Value

string

SectionClassSelector

The class name (without .) to identify the HTML elements that should be observed for viewport changes

[Parameter]
public string SectionClassSelector { get; set; }

Property Value

string

Sections

The displayed section within the MudPageContentNavigation

public IEnumerable<MudPageContentSection> Sections { get; }

Property Value

IEnumerable<MudPageContentSection>

Methods

AddSection(MudPageContentSection, bool)

Add a section to the content navigation

public void AddSection(MudPageContentSection section, bool forceUpdate)

Parameters

section MudPageContentSection

The section that needs to be added

forceUpdate bool

If true, StateHasChanged is called, forcing a re-render of the component

AddSection(string, string, bool)

Add a section to the content navigation

public void AddSection(string sectionName, string sectionId, bool forceUpdate)

Parameters

sectionName string

name of the section will be displayed in the navigation

sectionId string

id of the section. It will be appending to the current url, if the section becomes active

forceUpdate bool

If true, StateHasChanged is called, forcing a re-render of the component

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

DisposeAsync()

public ValueTask DisposeAsync()

Returns

ValueTask

OnAfterRenderAsync(bool)

protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender bool

Returns

Task

OnInitialized()

protected override void OnInitialized()

ScrollToSection(Uri)

Scrolls to a section based on the fragment of the uri. If there is no fragment, no scroll will occurred

public Task ScrollToSection(Uri uri)

Parameters

uri Uri

The uri containing the fragment to scroll

Returns

Task

A task that completes when the viewport has scrolled