File

projects/wms-framework/src/lib/regionsframework/commands/ButtonBaseClickCommandBehavior.ts

Description

The button base click command behavior

Extends

CommandBehaviorBase

Index

Properties
Methods

Constructor

constructor(buttonObject: ButtonBaseModel)
Parameters :
Name Type Optional
buttonObject ButtonBaseModel No

Properties

command
Type : ICommand
Inherited from CommandBehaviorBase
commandParameter
Type : any
Inherited from CommandBehaviorBase

Methods

OnClick
OnClick(object: any, e: any)

Handler for click associated to the target object

Parameters :
Name Type Optional
object any No
e any No
Returns : void
Private CommandCanExecuteChanged
CommandCanExecuteChanged(object: any, e: any)
Inherited from CommandBehaviorBase

Handler for the command CanExecuteChanged event

Parameters :
Name Type Optional
object any No
e any No
Returns : void
Protected ExecuteCommand
ExecuteCommand()
Inherited from CommandBehaviorBase

Executes the command

Returns : void
UpdateEnabledState
UpdateEnabledState()
Inherited from CommandBehaviorBase

Updates the enable state of the target object

Returns : void
import { ButtonBaseModel } from '../../models/controls/ButtonBaseModel';
import { CommandBehaviorBase } from './CommandBehaviorBase';

/**
 * The button base click command behavior
 *
 * @export
 * @class ButtonBaseClickCommandBehavior
 * @extends {CommandBehaviorBase<ButtonBaseModel>}
 * @wType Microsoft.Practices.Prism.Commands.ButtonBaseClickCommandBehavior
 */
export class ButtonBaseClickCommandBehavior extends CommandBehaviorBase<ButtonBaseModel> {
  constructor(buttonObject: ButtonBaseModel) {
    super(buttonObject);
    if (buttonObject) {
      buttonObject.Click.addHandler(this.OnClick, this);
    }
  }

  /**
   * Handler for click associated to the target object
   *
   * @param {*} object
   * @param {*} e
   * @memberof ButtonBaseClickCommandBehavior
   * @wIgnore
   */
  OnClick(object: any, e: any) {
    this.ExecuteCommand();
  }
}

result-matching ""

    No results matching ""