I'm new with xamarin.forms. I don't know how to handle buttons in listview. I want to create 2 button with + and - function. The entry will be default = 0. When i click + button, entry will be ++ and -- when i click - button. Any one please tell me what i should do. Here is my code:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="QRScanner.Menu">
<ListView x:Name="MyListView"
ItemsSource="{Binding Items}"
ItemTapped="Handle_ItemTapped"
CachingStrategy="RecycleElement">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell
Height="100"
>
<AbsoluteLayout>
<StackLayout
AbsoluteLayout.LayoutBounds="0,0,0.65,1"
AbsoluteLayout.LayoutFlags="All"
Orientation="Horizontal">
<Image
HorizontalOptions="StartAndExpand"
WidthRequest="70"
HeightRequest="70"
VerticalOptions="CenterAndExpand"
Source="{Binding imgUrl}"
/>
<Label Text="{Binding name}"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
/>
<Label
HorizontalOptions="EndAndExpand"
Text="{Binding price}"
VerticalOptions="CenterAndExpand"/>
</StackLayout>
<StackLayout
AbsoluteLayout.LayoutBounds="1,0,0.35,1"
AbsoluteLayout.LayoutFlags="All"
Orientation="Horizontal"
>
<Button
VerticalOptions="Center"
HeightRequest="30"
WidthRequest="30"
Clicked="Button_Clicked"
Text="-"
x:Name="btnMinus"
FontSize="12"
BackgroundColor="White"
TextColor="Green"
BorderColor="Green"/>
<Entry
Keyboard="Numberic"
x:Name="edt_quantity"
Text="{Binding quantity}"
FontSize="12"/>
<Button
x:Name="btnAdd"
VerticalOptions="Center"
WidthRequest="30"
HeightRequest="30"
Clicked="Button_Clicked_1"
Text="+"
FontSize="12"
BackgroundColor="White"
TextColor="Green"
BorderColor="Green"
/>
</StackLayout>
</AbsoluteLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
I want to get data from api, customers can select number from menu, after that send it to the server. Like booking app.