Event argument that can be used to query the IHandle that is closest to the given location in world coordinate space.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.input.QueryClosestHandleEventArgs
See Also
Constructors
Initializes a new instance of the QueryClosestHandleEventArgs class.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context of the query.
- queryLocation - Point
- The query location.
Properties
Gets the context for the current event.
Defined in
Gets or sets a value indicating whether this QueryClosestHandleEventArgs instance has been handled.
Remarks
If this property is set to true
, the content of the handle property will be used as currentHandle. Otherwise, the input mode will continue determining the closest handle at the current queryLocation.
Handlers which handle this QueryClosestHandleEventArgs should always test first, whether this property is set to true
and, if so, exit without doing anything.
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.addQueryClosestHandleListener(async (sender, args) => {
await something()
args.handled = true // will be set *after* all other event listeners have been invoked, only
})
// correct:
mode.addQueryClosestHandleListener(async (sender, args) => {
args.handled = true // will be set immediately and 'mode' will see the change
await something()
})
Gets the query location in world coordinates.