Members
Constructors
Initializes a new instance of the PopulateContextMenuEventArgs class.
Parameters
- context: IInputModeContext
- The context.
- queryLocation: Point
- The query location.
Properties
Gets the context for the current event.
Property Value
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()
})Property Value
true if handled; false otherwise.Gets the queried location in world coordinates.
Property Value
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.
Property Value
true if the menu should be shown; false otherwise.