Event arguments for the LabelAdding and LabelEditing events, as well as the IEditLabelHelper interface.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.input.LabelEditingEventArgs
See Also
Constructors
Initializes a new instance of the LabelEditingEventArgs class with the given context, owner, and label.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The input mode context to use.
- owner - ILabelOwner
- The ILabelOwner whose label should be edited.
- label - ILabel
- The ILabel that should be edited.
Properties
Gets or sets a value indicating whether the action (adding or editing a label) should be canceled.
Gets the context for the current event.
Defined in
Gets or sets a value indicating whether this event has been handled.
Remarks
A handled instance of LabelEditingEventArgs will not be passed to further event handlers or an IEditLabelHelper instance.
Setting any of the other properties implicitly also sets this to true
.
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.addLabelAddingListener(async (sender, args) => {
await something()
args.handled = true // will be set *after* all other event listeners have been invoked, only
})
// correct:
mode.addLabelAddingListener(async (sender, args) => {
args.handled = true // will be set immediately and 'mode' will see the change
await something()
})
Gets or sets the label to edit.
Remarks
This can be set to an exiting label to edit a specific one, or set to null
to add a new label instead (e.g. for ILabelOwners that have no label yet).
If this property is explicitly set to null
, the properties style, preferredSize, layoutParameter, and tag are used for the newly-added label, just like with LabelEditingEventArgs.
Setting this property implicitly also sets handled to true
.
Note that this property may be initialized to null
by calling code. However, in order to trigger automatically adding a new label, you need to set the property value explicitly to null
even in that case.
See Also
Gets or sets the layoutParameter of the label to add.
Gets or sets the owner of the label.
Remarks
This property can be null
if there is no owner known, e.g. if the event is raised for non-ILabelOwners. Otherwise it is initially set to the item for which the event is raised.
Setting this property implicitly also sets handled to true
.
Gets or sets the preferredSize of the label to add.
Remarks
true
.Gets or sets the style of the label to add.
Gets or sets the configurator for the TextEditorInputMode for editing the provided label instance.
Remarks
true
.Signature Details
function(context: IInputModeContext, mode: TextEditorInputMode, label: ILabel)
Parameters
- context - IInputModeContext
- The context in which the label is being edited or created.
- mode - TextEditorInputMode
- The mode that will be used for editing the label's text.
- label - ILabel
- The label that will be edited or created.