IViewDefinitions.RegisterGetTextStyleCallback(IElementDef, TextTypes, Func <IShape, TextTypes, string, IModel, IStyleProperty, object>) Method
Namespace: NextDesign.Core
Description
Registers the style value acquisition callback function of the specified text of the editor element generated from the specified editor element definition.
- It is recommended to call it when the extension is activated.
- Style values are acquired in the following order of priority.
- Callback function value for style value acquisition
- Style value set in the view instance
- Style value defined in the view definition
- If you want to change the text color of the title text, redefine the text color in the callback function of RegisterGetStyleCallback.
- The trigger for calling the registered callback function is as follows. ・ The editor element is displayed
- The field value of the model referenced by the editor element has changed.
argument
| Name | Type | Description |
|---|---|---|
| elementDef | IElementDef | Editor Element Definition |
| type | TextTypes | Text Types |
| getter | Func <IShape, TextTypes, string, IModel, IStyleProperty, object> | Callback function for getting style value Callback function specification object get_TextStyleFunction (IShape) shape, TextTypes type, string textPath, IModel model, IStyleProperty target) -Arguments --shape: IShape ・ ・ ・ The shape that owns the label/text to be styled is passed. --type: TextTypes ・ ・ ・ Target text type (enumeration) is passed --textPath: string ・ ・ ・ Path character string (field name) mapped in the text view definition is passed. --model: IModel ・ ・ ・ The model referenced by the editor element to which the tile is applied is passed --target: IStyleProperty ・ ・ ・ Target style attribute information is passed --Return value --object ・ ・ ・ Returns the object to be handled as a result of Get --The callback function must be an object that matches the specified target style attribute type /> --If you return an object that does not match the type, it will not be an exception and will be automatically converted to the value of IStyleProperty.CurrentValue. -Handling of exceptions -In the implementation of the callback function If you throw an exception, the exception is caught and the value of IStyleProperty.CurrentValue is used as the result of the callback call. |
Return value
- void
Exception
| Name | Exception Class | Description |
|---|---|---|
| Duplicate key | ExtensionDuplicationException | If the callback registration key is duplicated |
Annotation
If the number of labels is 11 or more, the style value acquisition callback function cannot be applied to the 11th and subsequent labels.