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
ActiveSection
The currently active session. null if there is no section selected
public MudPageContentSection? ActiveSection { get; }
Property Value
ExpandBehaviour
If there are multiple levels, this property controls they visibility of them.
[Parameter]
public ContentNavigationExpandBehaviour ExpandBehaviour { get; set; }
Property Value
Headline
The text displayed about the section links. Defaults to "Contents"
[Parameter]
public string Headline { get; set; }
Property Value
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
ScrollContainerSelector
The CSS selector used to identify the scroll container
[Parameter]
public string ScrollContainerSelector { get; set; }
Property Value
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
Sections
The displayed section within the MudPageContentNavigation
public IEnumerable<MudPageContentSection> Sections { get; }
Property Value
Methods
AddSection(MudPageContentSection, bool)
Add a section to the content navigation
public void AddSection(MudPageContentSection section, bool forceUpdate)
Parameters
section
MudPageContentSectionThe section that needs to be added
forceUpdate
boolIf 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
stringname of the section will be displayed in the navigation
sectionId
stringid of the section. It will be appending to the current url, if the section becomes active
forceUpdate
boolIf 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
OnAfterRenderAsync(bool)
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRender
bool
Returns
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
UriThe uri containing the fragment to scroll
Returns
- Task
A task that completes when the viewport has scrolled