Options
All
  • Public
  • Public/Protected
  • All
Menu

A general purpose, reusable and loosely coupled view model representing a menu item within a menu view model.

Hierarchy

  • MenuItemViewModel

Index

Constructors

constructor

  • Initializes a new instance of the MenuItemViewModel class.

    Parameters

    • menuVm: MenuViewModel

      The {@link geocortex.essentialsHtmlViewer.mapping.infrastructure.menus.MenuViewModel} that this MenuItemViewModel is a memeber of.

    • menuItem: MenuItemModel

      The {@link geocortex.essentialsHtmlViewer.mapping.infrastructure.menus.MenuItemModel} for this MenuItemViewModel.

    • Optional resolveCanExecute: boolean

    Returns MenuItemViewModel

Properties

Protected _canExecuteChangedBindingTokens

_canExecuteChangedBindingTokens: object[]

Protected _contextPropertyBindingTokens

_contextPropertyBindingTokens: object

Type declaration

  • [contextPropertyKey: string]: string

app

canExecute

canExecute: Observable<boolean>

Whether or not this menu item is executable or not. Factors in simple as well as batch menu items.

description

description: Observable<string>

Short Description of this menu item.

iconUri

iconUri: Observable<string>

URI of the icon associated to this menu item (if any).

menuItem

menuItem: MenuItemModel

The MenuItemModel object for this menu item.

menuViewModel

menuViewModel: MenuViewModel

The main menu view model which contains this menu item.

text

text: Observable<string>

The name of this menu item.

Methods

Protected _setupBindings

  • _setupBindings(): void
  • Sets up the canExecute changed bindings for both simple and batch menu items so the menu can update it's state automatically

    Returns void

computeCanExecute

  • computeCanExecute(): boolean
  • Returns the canExecute status of the related menuItem in real time.

    Returns boolean

    A boolean which returns true if the menu item backing this menu item view model can be executed.

destroy

  • destroy(): void
  • Unsubscribes from subscriptions and bindings tracked by this MenuItemViewModel

    Returns void

execute

  • execute(): void
  • Execute this menu item if it can be executed. Could be a simple menu item or multiple batch menu items.

    Returns void

executeOnFocus

  • executeOnFocus(): void
  • Execute the onFocus for this menu item if it can be executed.

    Returns void

refreshCanExecute

  • refreshCanExecute(): void
  • Re-computes and resets the canExecute observable for this MenuItemViewModel.

    Returns void

Static Protected _computeCommandParameter

  • Static function that omputes a command parameter to pass to a menu item.

    Parameters

    • menuItemVm: MenuItemViewModel

      The {@link geocortex.essentialsHtmlViewer.mapping.infrastructure.menus.MenuItemViewModel} that's requesting the parameter to be resolved.

    • parameter: any

      The parameter to resolve against the menu context.

    Returns any

    An object or string representing the resolved command parameter.