TimLariviere / Fabulous-new

Fabulous v2 - Work in progress
https://timothelariviere.com/Fabulous-new/
Other
41 stars 3 forks source link

RadioButton + Widget + Extensions #85

Closed edgarfgp closed 2 years ago

edgarfgp commented 2 years ago

This PR adds support for RadioButton based on : https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/radiobutton

Description :

We have now a way to use a Text and a Widget . This will help to complete the #82

module Content =

   type Value =
    | String of string
    | Widget of Widget

    let fromString value = String value

    let fromWidget<'msg, 'marker> (builder: WidgetBuilder<'msg, 'marker>) =
        Widget(builder.Compile())

Usage

From String


   RadioButton(false, Content.fromString "Cat", Stuff)

From widget

   RadioButton(true, Content.fromWidget (Image(Aspect.AspectFit, "Cross.png")), Stuff)
Screenshot 2022-02-23 at 09 25 01

Not Implemented