Better support for Behaviors
TimLariviere opened this issue · comments
Timothé Larivière commented
Fabulous does not natively let us extend an element with Xamarin.Forms.Behavior
s.
The only way, today, is to get access to the underlying Xamarin.Forms control through created
and set the behavior directly there.
It would be nice to have a better integration for this.
Use case
See #827 (comment) for an example.
Proposal
type EntryBehavior() =
inherit Xamarin.Forms.Behavior()
(...)
type View with
static member EntryBehavior() =
let create () = new EntryBehavior()
(...)
View.Entry(
text = entryText,
behaviors = [
View.EntryBehavior() // behavior used here
]
)
Timothé Larivière commented
v2 now supports extension methods very easily. Closing this issue