Share via

CarouselView

Eduardo Gomez 4,316 Reputation points
2022-09-18T14:37:59.75+00:00

Hello

I need to do this, but I don't really understand what I have to achieve

  • Use the /Challenges/PagedCollectionPage.xaml for your implementation
  • Implement carousel paging for a 2-column page, but where each element stacks like in the FlexLayoutPage example
  • Use the CarView as the item template
  • All items in a column should be visible (no vertical scrolling necessary)
  • If you collapse a column, the items should shift as in the FlexLayoutPage example.
  • No rules for how you achieve this (there is no single right answer):

I made the second one but I need help with this one

codehttps://www.dropbox.com/s/a5tpqv64somev9h/xamurai.zip?dl=0I am stuck in

I manage to do everything else

Developer technologies | .NET | Xamarin

Answer accepted by question author

Anonymous
2022-09-22T02:35:34.107+00:00

Hello,

The FlexLayoutPage is in the pages folder, that is the example, and I have to implement this in the PagedCollectionPage.xaml in the pages folder

Please copy the Following code to your PagedCollectionPage.xaml, I notice you have set the BindingContext = new SampleViewModel(); in the PagedCollectionPage.xaml.cs.

   <ContentPage.Content>  
           <Grid>  
               <ScrollView Orientation="Horizontal">  
                   <FlexLayout  
                       AlignContent="Start"  
                       AlignItems="Center"  
                       BindableLayout.ItemsSource="{Binding Cars}"  
                       Direction="Column"  
                       JustifyContent="Start"  
                       Wrap="Wrap">  
                       <BindableLayout.ItemTemplate>  
                           <DataTemplate>  
                               <local:CarView>  
                                   <local:CarView.WidthRequest>  
                                       <OnIdiom x:TypeArguments="x:Double"  
                                                Phone="200"  
                                                Tablet="400" />  
                                   </local:CarView.WidthRequest>  
                               </local:CarView>  
                           </DataTemplate>  
                       </BindableLayout.ItemTemplate>  
                   </FlexLayout>  
               </ScrollView>  
           </Grid>  
       </ContentPage.Content>  

Best Regards,

Leon Lu


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.