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

Touch event in ViewCell using xaml

$
0
0

How can I detect the touch in an item of my list while displaying it using a viewCell?
When using an ImagenCell I wrote something like this

 <ImageCell
                            Text ="{Binding Text}"
                            Detail ="{Binding Detail}"
                            ImageSource="{Binding ImageSource}"
                            Command="{Binding GoToCommand}"
                            CommandParameter="{Binding Parameter}"
                        />

My custom viewCell looks like this

        <ListView x:Name="NewsListView">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                        <ViewCell.View >
                            <StackLayout Orientation="Vertical" Padding="0,0,0,30" >  
                                <StackLayout Orientation="Horizontal" >
                                    <BoxView Color="Red"></BoxView>
                                    <Label Text="{Binding Text}"   Font="Bold,26" ></Label>
                                </StackLayout> 
                                 <StackLayout Orientation="Horizontal" >
                                    <BoxView Color="Blue"></BoxView>
                                    <Label Text="{Binding Detail}"   Font="26" ></Label>
                                </StackLayout>
                            </StackLayout>
                        </ViewCell.View>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

Viewing all articles
Browse latest Browse all 58056

Trending Articles