C

LabelEditingEventArgs

Event arguments for the query-label-adding and query-label-editing events, as well as the IEditLabelHelper interface.

Remarks

Supports defining a label or a label owner as well as label properties, e.g. style.

See Also

Developer's Guide

Members

Show:

Constructors

Initializes a new instance of the LabelEditingEventArgs class with the given context, owner, and label.

Parameters

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.
readonlyfinal

Property Value

The context.
Gets or sets a value indicating whether this event has been handled.

A handled instance of LabelEditingEventArgs will not be passed to further event handlers or an IEditLabelHelper instance.

Setting a value to label, owner, or cancel 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.editLabelInputMode.addEventListener(
  'query-label-adding',
  async (evt) => {
    await something()
    evt.handled = true // will be set *after* all other event listeners have been invoked, only
  },
)

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

See Also

Developer's Guide
Gets or sets the label to edit.

This can be set to an existing 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.

final

See Also

Developer's Guide
Gets or sets the layoutParameter of the label to add.
Gets or sets the owner of the label.

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.

final
Gets or sets the preferredSize of the label to add.
conversionfinal
Gets or sets the style of the label to add.
Gets or sets the tag of the label to add.
Gets or sets the text to set for the label.
Gets or sets the configurator for the TextEditorInputMode for editing the provided label instance.
If this handler is set, it will be called during adding or editing labels after a suitable text box placement for the currently edited label is set on TextEditorInputMode. It is called after EditLabelInputMode's textEditorInputModeConfigurator is called. Therefore, this handler can change position and other settings specifically for one label.
final

See Also

Developer's Guide