[Closed] Behaviors extension to VisualElementExtensions #28
Closed
bijington
started this conversation in
New Feature Discussions
Replies: 3 comments 1 reply
-
We can have both, that way if the dev just wants to add one behavior they will not pay for the array allocation. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks Shaun + Pedro! I think this is ready to be promoted to a Proposal! |
Beta Was this translation helpful? Give feedback.
1 reply
-
Closed and answered |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to propose that we add a
WithBehavior(this VisualElement visualElement, Behavior behavior)
extension that will add the suppliedbehavior
tovisualElement.Behaviors
.It would then allow us to simplify this:
down to this:
Or better yet as @pictos has suggested we could make the method accept
params
and the developer could hook up multiple behaviors (e.g.WithBehaviors(params Behavior[] behaviors)
)Beta Was this translation helpful? Give feedback.
All reactions