Skip to main content

Definition

Assembly: CloudNimble.BlazorEssentials.dll Namespace: CloudNimble.BlazorEssentials.Navigation Inheritance: CloudNimble.BlazorEssentials.InterfaceElement

Syntax

CloudNimble.BlazorEssentials.Navigation.NavigationItem

Summary

Defines an app navigation structure suitable for binding to navigation menus.

Constructors

.ctor

Syntax

public NavigationItem()

.ctor

Creates a new instance with the minimum-required items to render a Blazor NavLink.

Syntax

public NavigationItem(string text, string icon, string url)

Parameters

NameTypeDescription
textstringA string representing the text that will be displayed in the NavBar.
iconstringA string representing the CSS class(es) for the icon that can be displayed next to the InterfaceElement.DisplayText.
urlstringA string corresponding to the route for this NavigationItem.

.ctor

Syntax

public NavigationItem(string text, string icon, string url, string category)

Parameters

NameTypeDescription
textstringA string representing the text that will be displayed in the NavBar.
iconstringA string representing the CSS class(es) for the icon that can be displayed next to the InterfaceElement.DisplayText.
urlstringA string corresponding to the route for this NavigationItem.
categorystringA string representing the parent category for this NavigationItem. Can be useful for grouping
NavigationItemNavigationItems</see> into caregories for display.

.ctor

Syntax

public NavigationItem(string text, string icon, string url, string category, bool isVisible)

Parameters

NameTypeDescription
textstringA string representing the text that will be displayed in the NavBar.
iconstringA string representing the CSS class(es) for the icon that can be displayed next to the InterfaceElement.DisplayText.
urlstringA string corresponding to the route for this NavigationItem.
categorystringA string representing the parent category for this NavigationItem. Can be useful for grouping
NavigationItemNavigationItems</see> into caregories for display.
isVisibleboolSpecifies whether or not this NavigationItem is visible on the NavBar.

.ctor

Syntax

public NavigationItem(string text, string icon, string category, bool isVisible, System.Collections.Generic.List<CloudNimble.BlazorEssentials.Navigation.NavigationItem> children)

Parameters

NameTypeDescription
textstringA string representing the text that will be displayed in the NavBar.
iconstringA string representing the CSS class(es) for the icon that can be displayed next to the InterfaceElement.DisplayText.
categorystringA string representing the parent category for this NavigationItem. Can be useful for grouping
NavigationItemNavigationItems</see> into caregories for display.
isVisibleboolSpecifies whether or not this NavigationItem is visible on the NavBar.
childrenSystem.Collections.Generic.List<CloudNimble.BlazorEssentials.Navigation.NavigationItem>A List`1 containing nodes to render underneath this one.

.ctor

Syntax

public NavigationItem(string text, string icon, string url, string category, bool isVisible, string pageTitle, string pageIcon)

Parameters

NameTypeDescription
textstringA string representing the text that will be displayed in the NavBar.
iconstringA string representing the CSS class(es) for the icon that can be displayed next to the InterfaceElement.DisplayText.
urlstringA string corresponding to the route for this NavigationItem.
categorystringA string representing the parent category for this NavigationItem. Can be useful for grouping
NavigationItemNavigationItems</see> into caregories for display.
isVisibleboolSpecifies whether or not this NavigationItem is visible on the NavBar.
pageTitlestringA string representing the text that can be displayed as a page header.
pageIconstringA string representing the CSS class(es) for the icon that can be displayed next to the NavigationItem.PageTitle in a page header.

.ctor

Syntax

public NavigationItem(string text, string icon, string url, string category, bool isVisible, string pageTitle, string pageIcon, string roles, bool allowAnonymous = false)

Parameters

NameTypeDescription
textstringA string representing the text that will be displayed in the NavBar.
iconstringA string representing the CSS class(es) for the icon that can be displayed next to the InterfaceElement.DisplayText.
urlstringA string corresponding to the route for this NavigationItem.
categorystringA string representing the parent category for this NavigationItem. Can be useful for grouping
NavigationItemNavigationItems</see> into caregories for display.
isVisibleboolSpecifies whether or not this NavigationItem is visible on the NavBar.
pageTitlestringA string representing the text that can be displayed as a page header.
pageIconstringA string representing the CSS class(es) for the icon that can be displayed next to the NavigationItem.PageTitle in a page header.
rolesstring-
allowAnonymousbool-

.ctor Inherited

Inherited from CloudNimble.BlazorEssentials.InterfaceElement

Syntax

public InterfaceElement()

.ctor Inherited

Inherited from CloudNimble.BlazorEssentials.InterfaceElement

Syntax

public InterfaceElement(string displayText, string iconClass, string cssClass = null)

Parameters

NameTypeDescription
displayTextstring-
iconClassstring-
cssClassstring-

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

AccessibilityText

Test to be used for screen readers when this item is rendered.

Syntax

public string AccessibilityText { get; set; }

Property Value

Type: string

AllowAnonymous

A Boolean specifying whether or not this NavigationItem is visible when a user is not logged in.

Syntax

public bool AllowAnonymous { get; }

Property Value

Type: bool

Category

A string representing the parent category for this NavigationItem. Can be left blank, but useful for grouping NavigationItemNavigationItems</see> into caregories for display.

Syntax

public string Category { get; set; }

Property Value

Type: string

Children

Syntax

public System.Collections.Generic.List<CloudNimble.BlazorEssentials.Navigation.NavigationItem> Children { get; set; }

Property Value

Type: System.Collections.Generic.List<CloudNimble.BlazorEssentials.Navigation.NavigationItem>

CssClass Inherited

Inherited from CloudNimble.BlazorEssentials.InterfaceElement
A string representing the CSS classes that will be applied to the element.

Syntax

public string CssClass { get; set; }

Property Value

Type: string

DisplayText Inherited

Inherited from CloudNimble.BlazorEssentials.InterfaceElement
A string representing the text that will be displayed inside the element.

Syntax

public string DisplayText { get; set; }

Property Value

Type: string

IconClass Inherited

Inherited from CloudNimble.BlazorEssentials.InterfaceElement
A string representing the CSS class for the icon that will be rendered immediately before the InterfaceElement.DisplayText.

Syntax

public string IconClass { get; set; }

Property Value

Type: string

IsVisible

Specifies whether or not this NavigationItem is visible on the NavBar. Defaults to True.

Syntax

public bool IsVisible { get; set; }

Property Value

Type: bool

PageIcon

A string representing the CSS class(es) for the icon that can be displayed next to the NavigationItem.PageTitle in a page header.

Syntax

public string PageIcon { get; set; }

Property Value

Type: string

PageTitle

A string representing the text that can be displayed as a page header.

Syntax

public string PageTitle { get; set; }

Property Value

Type: string

Parameters

Allows you to set parameters specific to the page that you do NOT want to pass through the Routing system.

Syntax

public dynamic Parameters { get; set; }

Property Value

Type: dynamic

Remarks

Accessible through AppStateBase.CurrentNavItem.

Roles

A HashSet`1 of roles that this NavigationItem is visible to.

Syntax

public System.Collections.Generic.HashSet<string> Roles { get; private set; }

Property Value

Type: System.Collections.Generic.HashSet<string>

Url

A string corresponding to the route for this NavigationItem.

Syntax

public string Url { get; set; }

Property Value

Type: string

Methods

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

IsVisibleToUser

Returns a boolean indicating whether or not the NavItem is available to any of the Roles the claimsPrincipal is in.

Syntax

public bool IsVisibleToUser(System.Security.Claims.ClaimsPrincipal claimsPrincipal)

Parameters

NameTypeDescription
claimsPrincipalSystem.Security.Claims.ClaimsPrincipal-

Returns

Type: bool

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?