Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Is there any way to clear ListView's ContextActions by code?

I have a ListView created by XAML with some ContextActions and I wish clear it by code. Is it possible?
Thanks in advance.

Best Answer


  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    Make your custom Cell with a property like ShowContextActions. Bind that property to some property in your ViewModel. In your Cell you can just do ContextActions.Clear() when ShowContextActions was set to false.

  • FersoftInformticaFersoftInformtica ESMember ✭✭

    Hello Michael:
    Thanks for your answer.
    But how I access to ContextActions from ListView object? I have accessible ListView by x:Name property but I don't know how access to ContextActions from code behind.

  • FersoftInformticaFersoftInformtica ESMember ✭✭

    Thanks Michael:
    I clear the ContextActions on BindingContextChange of ViewCell.

Sign In or Register to comment.