Bug 30425 - ContextAction in ViewCell called multiple times on Android
Summary: ContextAction in ViewCell called multiple times on Android
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 1.4.2
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-05-26 05:34 UTC by Marco
Modified: 2016-04-08 19:59 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Marco 2015-05-26 05:34:35 UTC

I have a ContextAction inside a ViewCell:

public MyCell()
deleteAction = new MenuItem { Text = "Delete", IsDestructive = true }; // red background
            deleteAction.SetBinding(MenuItem.CommandParameterProperty, new Binding("."));
            deleteAction.Clicked += (sender, e) =>
                    var mi = ((MenuItem)sender);
                    Debug.WriteLine("Delete Context Action clicked: " + mi.CommandParameter);
                    DbModel.Vets vp = (DbModel.Vets)mi.CommandParameter;
                    MessagingCenter.Send<ViewCell, int>(this, "DeleteVet", vp.idLocal);
                    Debug.WriteLine("MSG DELETE VET CALLED " + vp.idLocal);
the problem is that the context action is called multiple times.

It seems to me that each time i load the page where is the listView the contextaction is called once more.

On iOS all is perfect.
Comment 1 Eric Maupin 2015-05-26 18:39:11 UTC
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue we would very much appreciate it. We monitor recently touched NEEDS INFO bugs so we’ll notice you attached the reproduction we’ll take it from there. 

Warm regards,
Xamarin Forms Team
Comment 2 Jason Smith [MSFT] 2016-04-08 19:59:27 UTC
Thank you for your bug report. As we have not received the information requested, we cannot properly triage your bug and are marking it resolved.

Warm regards,
Xamarin Forms Team