Forms 4 CarouselView

NiallTNiallT Member ✭✭

Hi there,

I am trying to create something akin to the tabbed page but within an existing page, the current plan is to use the Forms 4 Carousel View and make changes to another control to indicate the current view.

I realise this is pre-release however I cannot seem to find a current position or selected item property to bind to in the Carousel View in order to link the two controls, does anyone know if this is possible? Other comments have suggested using a NuGet package implementation of the Carousel View.

Thanks in advance,

Niall

Best Answers

  • AndreiMisiukevich_AndreiMisiukevich_ US ✭✭✭✭
    Accepted Answer

Answers

  • AsurAsur USMember ✭✭✭

    How about binding the tapped event of the individual view . haven't dwell much into it just played around a bit with collection view but onclick tapped behaviour should be possible right is you are using a template ?

  • AndreiMisiukevich_AndreiMisiukevich_ USMember ✭✭✭✭
    Accepted Answer
  • NiallTNiallT Member ✭✭

    @Asur said:
    How about binding the tapped event of the individual view . haven't dwell much into it just played around a bit with collection view but onclick tapped behaviour should be possible right is you are using a template ?

    Thanks Asur, I had thought about hooking into a tap event however I also need the external control to change the current position in the carousel as such I think I would need a property to two way bind to?

    @AndreiMisiukevich_ said:
    Just leave it here

    Thanks Andrei, we have been trying to minimise use of packages however may well use this.

  • AsurAsur USMember ✭✭✭
    edited April 9

    @NiallT I assume you are using a Data template so binding to it should be possible and then through tap event you can capture which ever item is clicked on . If you require index that can be added as a field into the observable collection object for easy comparison
    you can use Tap gesture like this

    `<Label.GestureRecognizers>
                                            <TapGestureRecognizer Command ="{Binding Path = BindingContext.SaveFunc Source={x:Reference ViewModel}}" CommandParameter="{Binding .}">
                                                </TapGestureRecognizer>
                                        </Label.GestureRecognizers>`
    
  • NiallTNiallT Member ✭✭

    Thanks all,

    We have decided against using the Forms 4 CarouselView, not having the selected property to bind to looks like a deal breaker.

    Appreciate the assistance

  • MagendanzMagendanz USMember ✭✭

    There also seems to be no event for detecting change of the current selection. I've tried ScrollToRequested, but that isn't being triggered when the user is scrolling through the carousel...only when ScrollTo() is called.

    Also, ScrollTo() doesn't seem to be actually scrolling to the desired index or object. The event handler is being called, but no scrolling is actually occuring and the ScrollToEventArgs seems to contain only an index or an item, whatever was passed to ScrollTo(). It should contain both.

Sign In or Register to comment.