Bind custom controls to data
Bind custom controls to serialized properties to synchronize values between the control and the property.
阅读时间1 分钟最后更新于 1 个月前
You bind custom controls to serialized properties to synchronize values between the control and the property. You can create a bindable custom control derived from the generic base class instead of . This provides the following advantages:
BaseFieldBindableElement- Implements the interface for the generic parameter type that you specify.
INotifyValueChanged - Makes the control focusable by default.
- Provides a horizontal layout with a label element on the left and input on the right.

FloatField is a built-in UI Toolkit control which inherits from BaseField.<br/>A. The label element.<br/>B. The input element.
To bind custom controls to data:
- Implement the interface and listen for
INotifyValueChangeds as needed.ChangeEvent - Inherit from the class or implement the
BindableElementinterface.IBindable
Refer to SerializedObject data binding for more details.
For a bindable custom control example, refer to Create a bindable custom control.