Forum Xamarin.Forms

How to make ViewCell.ContextActions conditional

VinupriyaVinupriya USUniversity

I have ViewCell.ContaxtActions in my Listview, which has List of MenuItems like below

                      <MenuItem Clicked="OnEdit"          Text="{model:Translate Generic_Edit}"             />                         
                      <MenuItem Clicked="OnMulticalculus" Text="{model:Translate Generic_MultiCalculus}"    />

I would like to make menuitems visible on condition. For example, for certain condition, only edit menu should be visible and other menu should be invisible.

Can anyone help to make conditional Context menu in listview?



  • steveingelssteveingels USMember

    I'd really like to know as well.

  • JimTyminskiJimTyminski USUniversity ✭✭


  • Interested too...

  • Xami3Xami3 PKMember, University ✭✭✭
    edited June 2017

    @Vinupriya @PatriceBoissonneault @steveingels i have a requirement, that user can only delete/edit his comment while he can not perform actions on other people comment. so i have a solution for it.

    i will create two list item templates, in one template i will add actions while in other i will not. and then via a template selector i will apply the item template to different items. this way i don't have to go into any more complexity

  • javanthemanjavantheman Member ✭✭

    Ever figure this out?

Sign In or Register to comment.