Skip to content

BolMenuViewModel

View model handed to the side and top menu views. It carries the loaded menu, the current page, and the navigation state so the views render the menu and post item clicks.

Purpose

  • Package the menu data and the current page for the menu view components.

Context

  • Namespace: BolMiddleware.Models.MenuModels
  • Assembly/package: BolMiddleware

Public members

Member Signature Purpose
Constructor BolMenuViewModel(BusinessOnlineMenu menu, string currentPage) Captures the menu and the page being displayed.
Menu BusinessOnlineMenu Menu Menu data to render.
CurrentPage string CurrentPage Page id used to highlight the active item.
NavItem BolNavItemViewModel NavItem Item model passed to the menu item partial.
IsMenuExpanded bool IsMenuExpanded Whether the side menu renders expanded.
IsExternalUser bool IsExternalUser Whether the viewer is external, which changes available links.

Behavioral notes

  • Marked [BindProperties], so posted values can bind to its properties.

Constraints and usage notes

  • Created by the menu view components, not by consumers.

Sources

  • src/BolMiddleware/Models/MenuModels/BolMenuViewModel.cs