C

PopulateItemContextMenuEventArgs<TModelItem>

A specialized subclass of PopulateContextMenuEventArgs that carries the item for which the context menu should be populated.

Members

Show:

Constructors

Initializes a new instance of the PopulateItemContextMenuEventArgs<TModelItem> class.

Parameters

context: IInputModeContext
The context to populate the menu for.
queryLocation: Point
The query location.
item: TModelItem
The item for which the context menu should be populated, may be null.

Properties

Gets the context for the current event.
readonlyfinal

Property Value

The context.
Gets or sets the context menu content to use.

The content can be either a string, any HTML element or a Promise providing the same.

Setting this property will set the handled and showMenu property to true.

If this property is not specified, no context menu will appear.

final

Property Value

The context menu content or null if no context menu should be displayed.

See Also

Developer's Guide
Gets or sets a value indicating whether this PopulateContextMenuEventArgs has been handled.

If this event is marked as handled, the input mode will use the property contextMenu to decide whether to show the context menu.

This property is automatically set to true if a value is assigned to the property contextMenu.

Note that this property needs to be set before the function synchronously returns. This means that setting the value in an async function after the first await or in an asynchronous callback, it cannot not be seen by the emitter of the event and the sender will consider the event as not being handled.

// wrong:
mode.addEventListener('populate-menu', async (evt) => {
  await something()
  evt.handled = true // will be set *after* all other event listeners have been invoked, only
})

// correct:
mode.addEventListener('populate-menu', async (evt) => {
  evt.handled = true // will be set immediately and 'mode' will see the change
  await something()
})
final

Property Value

true if handled; false otherwise.
Gets the item for which the context menu is queried.
readonlyfinal

Property Value

The item, which may be null.
Gets the queried location in world coordinates.
readonlyfinal

Property Value

The queried location.
Gets or sets a value indicating whether to actually display the context menu.

This may be useful, when the application or a framework should render the actual context menu but the event handling is done by the ContextMenuInputMode.

This will set the handled property to true.

The default value of this property is true.

final

Property Value

true if the menu should be shown; false otherwise.