I have a ListView created by XAML with some ContextActions and I wish clear it by code. Is it possible?
Thanks in advance.
The ListView has no ContextActions. You have to change it in the Cell. As the ListView also has no list of its own Cells, you have to write your own Cell and handle it there.
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.
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.
I clear the ContextActions on BindingContextChange of ViewCell.
Xamarin Inc., as a wholly-owned Microsoft subsidiary acting as a separate legal entity, adheres to the Microsoft Privacy Statement: Privacy & cookies