IViewDefinitions.RegisterGetStyleCallback(IElementDef,Func<IEditorElement, IModel, IStyleProperty, object>,StyleAttributes) method
Namespace: NextDesign.Core
Description
Registers a style value retrieval callback function for editor elements generated from the specified editor element definition by specifying style attributes.
- It is recommended to call this when activating the extension.
・Style values are obtained in the following order of priority.
- Callback function value for style value acquisition
- Style values set in the view instance
- Style values defined in the view definition
- If you want to change the font color of the title text, redefine the font color in the callback function of this method.
- The registered callback function is called as follows.
・Editor element is displayed
・The field value of the model referenced by the editor element has been changed
argument
Name | Type | Description |
---|---|---|
elementDef | IElementDef | Editor element definition |
getter | Func<IEditorElement, IModel, IStyleProperty, object> | Callback function for style value acquisition Callback function specification object get_styleFunction(IEditorElement element, IModel model, IStyleProperty target) - Argument - element: IEditorElement ... The editor element to which the style is applied is passed - model: IModel ... The tile is to be applied to The model referenced by the editor element is passed - target: IStyleProperty ...Target style attribute information is passed - Return value - object ... As a result of Get Returns the object to work with - The callback function must be an object that matches the type of the specified target style attribute - If it returns an object that does not match the type, it will It will be automatically converted to the value of IStyleProperty.CurrentValue - Exception handling - If the callback function implementation throws an exception, the exception will be caught and The value of IStyleProperty.CurrentValue is used as the call result |
properties | StyleAttributes | Style attributes (If multiple style attribute names are specified, callbacks are registered for each) |
Return value
- void
Exception
Name | Exception class | Description |
---|---|---|
Duplicate key | ExtensionDuplicationException | If the callback registration key is duplicated |