Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Semi-complex CarouselView doesn't load binded data consistently.

$
0
0

I'm using CarouselView and I have a problem with bound data not showing up consistently in the .
I can swipe through and back; eventually the data gets loaded while still on the current page. Any pointers to help me on this?

<ListView Grid.Row="1" x:Name="EdgeList" 
                          ItemsSource="{Binding SlatListViewItems, Mode=TwoWay}"
                          CachingStrategy="RecycleElement" 
                          HasUnevenRows="true" 
                          RowHeight="-1">
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <ViewCell>
                                <ViewCell.View>
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="*"/>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="3*"/>
                                            <ColumnDefinition Width="8*"/>
                                        </Grid.ColumnDefinitions>

                                        <StackLayout Grid.Row="0" Grid.Column="0" VerticalOptions="CenterAndExpand">
                                            <c:CLabel Text="{Binding SlatModel}" HorizontalOptions="CenterAndExpand"/>
                                            <Image Source="{Binding Path}" HorizontalOptions="CenterAndExpand"/>
                                        </StackLayout>

                                        <StackLayout Grid.Row="0" Grid.Column="1" >
                                            <cv:CarouselViewControl VerticalOptions="FillAndExpand" 
                                                                    HorizontalOptions="FillAndExpand"
                                                                    Orientation="Horizontal"
                                                                    ItemsSource="{Binding SlatCompatible}">
                                                <cv:CarouselViewControl.ItemTemplate>
                                                    <DataTemplate>
                                                        <StackLayout Orientation="Horizontal" BackgroundColor="White">
                                                            <StackLayout.GestureRecognizers>
                                                                <TapGestureRecognizer Command="{Binding Path=BindingContext.SelectSlatCommand, Source={x:Reference SlatXaml}}" CommandParameter="{Binding .}"/>
                                                            </StackLayout.GestureRecognizers>
                                                            <StackLayout BackgroundColor="White">
                                                                <Image Source="{Binding Path}" Aspect="AspectFit"/>
                                                            </StackLayout>
                                                            <StackLayout Padding="0,20,0,0" VerticalOptions="CenterAndExpand" HorizontalOptions="CenterAndExpand">

                                    <!--   THESE DATABINDINGS ON LOAD INCONSISTENTLY -->                                                                

                                            <Label Text="{Binding Company}"/>
                                                                                <Label Text="{Binding Dimensions}"/>
                                                                                <Label Text="{Binding Compatible}"/>

                                    <!--  ^^^ THESE DATABINDINGS ON LOAD INCONSISTENTLY ^^^ -->    
                                                            </StackLayout>
                                                        </StackLayout>
                                                    </DataTemplate>
                                                </cv:CarouselViewControl.ItemTemplate>
                                            </cv:CarouselViewControl>
                                        </StackLayout>                                    
                                    </Grid>
                                </ViewCell.View>
                            </ViewCell>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>