Event arguments for the PopulateMenu event.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.input.PopulateMenuEventArgs
Constructors
Initializes a new instance of the PopulateMenuEventArgs class.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context.
- queryLocation - Point
- The query location.
Properties
Gets the context for the current event.
Defined in
Gets or sets a value indicating whether this PopulateMenuEventArgs has been handled.
Remarks
If this event is marked as handled, the input mode will use the property showMenu to decide whether to show the context menu.
This property is automatically set to true
if a value is assigned to the property showMenu.
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.addPopulateMenuListener(async (sender, args) => {
await something()
args.handled = true // will be set *after* all other event listeners have been invoked, only
})
// correct:
mode.addPopulateMenuListener(async (sender, args) => {
args.handled = true // will be set immediately and 'mode' will see the change
await something()
})
Gets the queried location in world coordinates.
Gets or sets a value indicating whether to actually display the context menu.
Remarks
This will set the handled property to true
.
The default value of this property is true
.