Cardview: tapped item nested

Created on 24 Dec 2020  路  11Comments  路  Source: AndreiMisiukevich/CardView

hi
i use nested i want to tapp item
how can do it?
i use collectionview instead of main carouselview .
i want tapped items but not worked
can u help me?

question

Most helpful comment

Just move TapGestureRecognizer to NestedItemTemplate

Every item will handle taps (the same as the entire view handles taps)

image

All 11 comments

Hi, how about adding TapGestureRecognizer or TouchEffect from XamarinCommunityToolkit?

i use tapgesture for carouselview template but not worked.
and use selectionchange for collectionview not worked

Can you build a small sample?


VerticalOptions="Center"
Padding="0"
HasShadow="True"
CornerRadius="10"
AbsoluteLayout.LayoutFlags="All"
AbsoluteLayout.LayoutBounds="0, 0, 1, 1">

                    <Image Source="{Binding ImageLink}"   
                       Aspect="AspectFill" 
                            AbsoluteLayout.LayoutFlags="All"
                   AbsoluteLayout.LayoutBounds="0, 0, 1, 1"/>

                    <Label Text="{Binding Titr}"
                   TextColor="#81ffff"
                       BackgroundColor="#66000000"
                   FontFamily="entfont"
                       Margin="0,5,10,5" 
                            AbsoluteLayout.LayoutFlags="All"
                   AbsoluteLayout.LayoutBounds="0,1, 1,0.4"
                   FontSize="24"/>
                </AbsoluteLayout>
            </Frame>
            <Line Y1="0"
                  X2="80"
                  Y2="0"
                  X1="0"
                  HorizontalOptions="Center"
                  Stroke="#e40081"
                  StrokeThickness="9"
                  VerticalOptions="StartAndExpand" 
                  Margin="0,0,0,0"
                    AbsoluteLayout.LayoutFlags="All"
                   AbsoluteLayout.LayoutBounds="0, 1, 1, 0.25"/>

        </AbsoluteLayout>
    </DataTemplate>
    <DataTemplate x:Key="TopItemTemplate">
        <Grid RowSpacing="0" IsClippedToBounds="True" Padding="0" >
                <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"/>
                    <ColumnDefinition Width="1*"/>
                </Grid.ColumnDefinitions>
            <Label Text=" viewall &gt;"
                       Grid.Column="0"
                   TextColor="#e40081"
                   FontFamily="entfont"
                   FontSize="20"
                       VerticalTextAlignment="Center"
                       HorizontalTextAlignment="Center" 
                       Margin="10,30,0,0"
                       Grid.Row="0"
                       HorizontalOptions="Start" >
            </Label>
                <Label Text="{Binding NameGroup}"
                       VerticalTextAlignment="Center"
                       HorizontalTextAlignment="Center" 
                       Margin="0,30,10,0"
                   Padding="0"
                       Grid.Column="1"
                       Grid.Row="0"
                   HorizontalOptions="End" 

                   FontAttributes="Bold" 
                   FontFamily="entfont"
                   FontSize="20"
                   TextColor="Black"  />       

        <cv:CoverFlowView Grid.RowSpan="2"
                          Grid.ColumnSpan="2"
                          Padding="0" IsClippedToBounds="True"
                              PositionShiftValue="135"
                          HeightRequest="280"
                          Margin="0,0,0,-60"                              
                              IsCyclical="True"   
                                ItemTemplate="{StaticResource NestedItemTemplate}"
                                ItemsSource="{Binding Items}"
                              IsRightToLeftFlowDirectionEnabled="True"
                              SelectedIndex="{Binding Id}"
                              IsHorizontalOrientation="True">

                <x:Arguments>
                    <proc:CoverFlowProcessor ScaleFactor="0.75" OpacityFactor="0.25" />
                </x:Arguments>
            </cv:CoverFlowView>
        </Grid>
    </DataTemplate>

SelectionChanged="collvideo_SelectionChanged"
Margin="5,20,5,0"
x:Name="collvideo"
SelectionMode="Single">



in cs
ViewModel = new NestedViewModel();
collvideo.ItemsSource = ViewModel.Items;

and i get data all data dynamically

That's why I asked to build a sample (A small project that I can run and see the problem)

That's why I asked to build a sample (A small project that I can run and see the problem)

ok

Just move TapGestureRecognizer to NestedItemTemplate

Every item will handle taps (the same as the entire view handles taps)

image

Just move TapGestureRecognizer to NestedItemTemplate

Every item will handle taps (the same as the entire view handles taps)

image

thx so much

Was this page helpful?
0 / 5 - 0 ratings

Related issues

morhung picture morhung  路  7Comments

troyvnit picture troyvnit  路  8Comments

jolugarbe picture jolugarbe  路  8Comments

toshitani23 picture toshitani23  路  6Comments

PauchardThomas picture PauchardThomas  路  7Comments