Attach behavior to widget via config

How to attach behavior to widget via app configuration ?