TimLariviere / Fabulous-new

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

Add ViewRef to support IndicatorView <-> CarouselView binding #87

Closed TimLariviere closed 2 years ago

TimLariviere commented 2 years ago

I had to remove all Position / PositionChanged because CarouselView is incredibly buggy if we try to interfere in the position.

Usage

let indicatorViewRef = ViewRef<IndicatorView>()

let view model =
    VStack() {
        (CarouselView(model.Items) (fun item ->
            Label(item)
        )).indicatorView(indicatorViewRef)

        IndicatorView(indicatorViewRef)
            .indicatorColor(Color.Red)
            .selectedIndicatorColor(Color.Blue)
    }
TimLariviere commented 2 years ago

I think the Position/PositionChanged can be readded if I figure out what's the actual issue, but for now I'll merge it like that