locked
Make a stacklayout tappable with prism...on masterdetail page.. RRS feed

  • Question

  • User361057 posted

    Is their a way in prism to make the stacklayout 'clickable/tappable' as a menu item?

    <MasterDetailPage.Master>
        <ContentPage Title="Panel">
            <StackLayout  VerticalOptions="FillAndExpand"  Orientation="Vertical">
                <StackLayout ONCLICK="???????" BackgroundColor="#e74c3c"   HeightRequest="75">
                    <Label Text="Some Text title" FontSize="20" VerticalOptions="CenterAndExpand" TextColor="White" HorizontalOptions="Center"/>
                </StackLayout>
                <StackLayout   VerticalOptions="FillAndExpand"  Orientation="Horizontal"  Padding="4,4,0,4"  Spacing="4">
                    <Image Source="zspotter.png"  WidthRequest="12"   HeightRequest="12"   VerticalOptions="Center" />
                    <Label  Text="Dashboard" FontSize="Medium" VerticalOptions="Center"  TextColor="Black"/>
                </StackLayout>
            </StackLayout>
        </ContentPage>
    </MasterDetailPage.Master>
    <MasterDetailPage.Detail>
        <NavigationPage>
            <x:Arguments>
                <local:Clients />
            </x:Arguments>
        </NavigationPage>
    </MasterDetailPage.Detail>
    

    Wednesday, May 16, 2018 3:39 PM

Answers

  • User88712 posted

    For tapping you can use GestureRecognizers + TapGestureRecognizer, read here

    <StackLayout>
        <StackLayout.GestureRecognizers>
            <TapGestureRecognizer Command="{Binding YourCommand}" Tapped="OnTapp" />
        </StackLayout.GestureRecognizers>
    </StackLayout>
    
    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, May 17, 2018 7:48 AM