File

projects/wms-framework/src/lib/models/controls/ContextMenuService.ts

Description

Model class for ContextMenuService

Index

Properties

Properties

Manager
Type : ContextMenuManager
Decorators :
@Dependency(ContextMenuService.ManagerProperty)

Context Menu Manager property

Static ManagerProperty
Type : DependencyProperty
Default value : new DependencyProperty( 'Manager', null, XamContextCallBack )

ManagerProperty

import { DependencyProperty } from '../../basecomponentmodel/DependencyProperty';
import { Dependency } from '../../basecomponentmodel/Dependency';
import { ContextMenuManager } from './ContextMenuManager';
import {
  DependencyPropertyChangedEventArgs,
  FrameworkElement,
} from '../../basecomponentmodel';

/**
 * Model class for ContextMenuService
 *
 * @export
 * @class ContextMenuService
 * @extends {}
 * @wType Infragistics.Controls.Menus.ContextMenuService
 */
export class ContextMenuService {
  /**
   * ManagerProperty
   *
   * @static
   * @type {DependencyProperty}
   * @memberof XamMenuItemModel
   */
  public static ManagerProperty: DependencyProperty = new DependencyProperty(
    'Manager',
    null,
    XamContextCallBack
  );

  /**
   * Context Menu Manager property
   *
   * @type {ContextMenuManager}
   * @memberof ContextMenuService
   * @wIgnore
   */
  @Dependency(ContextMenuService.ManagerProperty)
  Manager: ContextMenuManager;
}

/**
 * Should trigger the action in the component
 * that will enable the CtxMenu to be dinamically displayed
 *
 * @export
 * @param {*} sender
 * @param {*} args
 */
export function XamContextCallBack(sender, args) {
  if (
    sender instanceof FrameworkElement &&
    args instanceof DependencyPropertyChangedEventArgs
  ) {
    const ctxMenu = args.NewValue as ContextMenuManager;
    sender.OpenCtxMenu(ctxMenu);
  }
}

result-matching ""

    No results matching ""