Skip to main content

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.
  1. Callback function value for style value acquisition
  2. Style values ​​set in the view instance
  3. 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

NameTypeDescription
elementDefIElementDefEditor element definition
getterFunc<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
propertiesStyleAttributesStyle attributes
(If multiple style attribute names are specified, callbacks are registered for each)

Return value

  • void

Exception

NameException classDescription
Duplicate keyExtensionDuplicationExceptionIf the callback registration key is duplicated