IViewDefinitions.RegisterGetStyleCallback(IElementDef, Func <IEditorElement, IModel, IStyleProperty, object>, StyleAttributes) Method
Namespace: NextDesign.Core
Description
Specify the style attribute and register the style value acquisition callback function 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 this method.
- 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 |
getter | Func <IEditorElement, IModel, IStyleProperty, object> | Callback function for getting style value Callback function specification object get_styleFunction (IEditorElement element, IModel model) , IStyleProperty target) -Arguments --element: IEditorElement ・ ・ ・ The editor element to which the style is applied is passed --model: IModel ・ ・ ・ Tile application target The model referenced by the editor element is passed --target: IStyleProperty ・ ・ ・ Target style attribute information is passed -Return value --object ・ ・ ・ Handled as a result of Get Returns an object --The callback function must be an object that matches the type of the specified target style attribute --The exception is especially if it returns an object that does not match the type. It is automatically converted to the value of IStyleProperty.CurrentValue -Handling of exceptions -If the implementation of the callback function throws an exception, the exception is caught and the callback is called. As a result, the value of IStyleProperty.CurrentValue is used |
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 |