Maybe at this time you already solved your problem, but in case you are still struggling, i am happy to share a sample here with the basic ingredients you need to achieve your goal.
First of all, as already other user mentioned, you need to know that in Xamarin.Forms views support what is called GestureRecognizers
.
Following the docu:
You can add gesture recognizers to a view...
Adding items to this collection will associate gesture events with
this element. This is not nessesary for elements which natively
support input, such as a Button.
So, although you are right that in order to fire an event you can use a Button
, you should know that most views admit gesture recognizers, so you can fire also events on tapping a StackLayout
, or an Image
, etc.
The following is a simple example that tries to mimic one of the pictures you shared.
Note: if you want to copy-paste the following code, recall that Image.Source in XAML is set to "pizza.jpg", an image that you have to add yourself to the different platforms projects. In Android project add the image to Resources.drawable
XAML
<?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="MyApp.Page1"
BackgroundColor="Black">
<Frame BorderColor="White"
BackgroundColor="Transparent"
CornerRadius="10"
Margin="20"
Padding="10"
HorizontalOptions="CenterAndExpand"
VerticalOptions="CenterAndExpand">
<StackLayout BackgroundColor="Transparent"
Spacing="10">
<Image Source="pizza.jpg"
WidthRequest="200"
HeightRequest="200"/>
<Label Text="Bambini"
TextColor="White"
FontAttributes="Bold"
BackgroundColor="Transparent"
FontSize="Medium"
HorizontalOptions="CenterAndExpand"/>
<!--The following stack is not visible by default-->
<StackLayout x:Name="priceStack"
BackgroundColor="Transparent"
Orientation="Horizontal"
IsVisible="False"
Spacing="5">
<StackLayout BackgroundColor="White"
HorizontalOptions="FillAndExpand">
<Label Text="P"
FontSize="Medium"
HorizontalTextAlignment="Center"
FontAttributes="Bold"/>
<Label Text="$8.20"
FontSize="Medium"
HorizontalTextAlignment="Center"/>
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped_1"/>
</StackLayout.GestureRecognizers>
</StackLayout>
<StackLayout BackgroundColor="White"
HorizontalOptions="FillAndExpand">
<Label Text="M"
FontSize="Medium"
HorizontalTextAlignment="Center"
FontAttributes="Bold"/>
<Label Text="$9.90"
FontSize="Medium"
HorizontalTextAlignment="Center"/>
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped_1"/>
</StackLayout.GestureRecognizers>
</StackLayout>
<StackLayout BackgroundColor="White"
HorizontalOptions="FillAndExpand">
<Label Text="G"
FontSize="Medium"
HorizontalTextAlignment="Center"
FontAttributes="Bold"/>
<Label Text="$18.20"
FontSize="Medium"
HorizontalTextAlignment="Center"/>
<StackLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped_1"/>
</StackLayout.GestureRecognizers>
</StackLayout>
</StackLayout>
</StackLayout>
<Frame.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
</Frame>
</ContentPage>
Code behind
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace MyApp
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Page1 : ContentPage
{
public Page1 ()
{
InitializeComponent ();
}
private void TapGestureRecognizer_Tapped(object sender, EventArgs e)
{
priceStack.IsVisible = !priceStack.IsVisible;
}
private async void TapGestureRecognizer_Tapped_1(object sender, EventArgs e)
{
await App.Current.MainPage.DisplayAlert("Confirmation", "Should we send the order?", "Yes", "Cancel");
}
}
}
Result
The app starts and you are displayed the menu:

If you tap on the item, the prices appear:

Finally, if you tap on a price, you get a confirmation dialog:

Last, but not least
Take a look at the amazing Xamarin.Forms docu, and do not forget to read the enjoyable book of Ch. Petzold (just two examples of the plenty of resources to learn Xamarin.Forms!).
I hope you can take something out of this :)