Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for Behaviors #832

Closed
TimLariviere opened this issue Jan 8, 2021 · 1 comment
Closed

Better support for Behaviors #832

TimLariviere opened this issue Jan 8, 2021 · 1 comment
Labels
s/ready This issue is ready to be implemented t/enhancement New feature or request
Milestone

Comments

@TimLariviere
Copy link
Member

Fabulous does not natively let us extend an element with Xamarin.Forms.Behaviors.
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
    ]
)
@TimLariviere TimLariviere added this to the vNext (2.0) milestone Jan 8, 2021
@TimLariviere TimLariviere added s/ready This issue is ready to be implemented t/enhancement New feature or request labels Jan 8, 2021
@TimLariviere
Copy link
Member Author

v2 now supports extension methods very easily. Closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s/ready This issue is ready to be implemented t/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant