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.