Forum Xamarin.Forms


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Xamarin Forms ListView onpressing event

AliErenAliEren BEMember ✭✭

I want to change the Image by changing the IconToShow propery with binding (programmatically), when the item is pressing.

How can I trigger an OnPressed event ??

<ListView x:Name="listView" ItemSelected="OnItemSelected" ItemsSource="{Binding MainMenuList}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" IsVisible="{Binding MenuStyle, Converter={StaticResource not}" SeparatorColor="Blue">
                                <RowDefinition Height="50" />
                                <ColumnDefinition Width="10" />
                                <ColumnDefinition Width="30" />
                                <ColumnDefinition Width="10" />
                                <ColumnDefinition Width="Auto" />
                            <Image Source="{Binding IconToShow}" Grid.Row="0" Grid.Column="1"/>
                            <Label Text="{Binding Title}" Grid.Row="0" Grid.Column="3"/>

Best Answers


  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    Add a TapGestureRecognizer to your icon and set the IconToShow property on Tapped event

  • AliErenAliEren BEMember ✭✭
    edited July 2016

    MR.Gestures is a licensed package ??

    That doesn't exactly do what I want, it raises an event when you stop pressing and I must have an event that can be raised when I'm pressing.

  • NMackayNMackay GBInsider, University admin


    Yes but it costs 10 euros per app to licence. You'll spend a lot more in man hours trying to figure how to do it with custom renderers. I'm not a sales agent for @MichaelRumpler either before you ask :wink:

Sign In or Register to comment.