IViewDefinitions.RegisterGetCompartmentItemTextStyleCallback(IElementDef, string, Func <INode, int, string, IModel, IStyleProperty, object>, StyleAttributes) Method
Namespace: NextDesign.Core
Description
Specify the style attribute and register the style value acquisition callback function of the specified compartment item 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
- The trigger for calling the registered callback function is as follows. ・ Compartment items are displayed ・ The field value of the model referenced by the compartment item has been changed.
argument
| Name | Type | Description |
|---|---|---|
| elementDef | IElementDef | Editor Element Definition |
| areaPath | string | Compartment partition path |
| getter | Func <INode, int, string, IModel, IStyleProperty, object> | Callback function for getting style value Callback function specification object object get_ItemTextStyleFunction ( INode node, int areaIndex, string areaPath, IModel itemModel, IStyleProperty target) -Arguments --node: INode ・ ・ ・ The shape that owns the compartment item to be styled is passed. --areaIndex: int ・ ・ ・ The partition index to which the style-applied compartment item belongs is passed. --areaPath: string ・ ・ ・ Set to the partition definition to which the style-applied compartment item belongs. The path string (field name) that exists is passed. --itemModel: IModel ・ ・ ・ The model referenced by the compartment item to which the style 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 --Callback function matches the specified target style attribute type Must be an object that does --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 --If the callback function implementation throws an exception, the exception is caught and the value of IStyleProperty.CurrentValue is used as the result of the callback call. |
| properties | StyleAttributes | Style attributes (If multiple style attribute names are specified, callback registration is performed for each) |
Return value
- void
Exception
| Name | Exception Class | Description |
|---|---|---|
| Duplicate key | ExtensionDuplicationException | If the callback registration key is duplicated |