0
メニューがあるListViewを使用しているXamarin Formsを使用してアプリケーションを作成しようとしていますが、各ディッシュの近くにはステッパーと価格があります。XamarinフォームListViewステッパーバインド
最終的に、ユーザーがどの食事をどのくらい食べたいかを決めると、合計価格がカウントされますが、どうすればいいか分かりません。
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Eba_face.MenuPage"
Title="Menu">
<Grid VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<ListView x:Name="listview"
HasUnevenRows="True"
VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal" Padding="5">
<StackLayout Orientation="Vertical">
<Image x:Name="image" Source="{Binding Image}" WidthRequest="75" HeightRequest="75"/>
<Label Text="{Binding Name}" FontAttributes="Bold"/>
</StackLayout>
<StackLayout Orientation="Vertical">
<Label Text="{Binding Weight, StringFormat='Weight {0}'}"/>
<Label Text="{Binding Price}" TextColor="Gray"/>
</StackLayout>
<StackLayout HorizontalOptions="EndAndExpand">
<Stepper x:Name="stepper" ValueChanged="Handle_StepperValueChanged"/>
<Label Text="{Binding Source={x:Reference stepper}, Path=Value}" HorizontalOptions="Center"/>
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<StackLayout Orientation="Vertical" VerticalOptions="End" HorizontalOptions="Center">
<Label x:Name="totalPriceLabel" Text="Total Price:" HorizontalOptions="Center"/>
<Button Text="Proceed to finish the order" />
</StackLayout>
</Grid>
</ContentPage>