Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Is there an event I can handle just prior to Context Actions being displayed?

$
0
0

I currently have a ListView, for which each item in the ListView has a set of Context Actions. Which Context Actions are enabled or disabled at any point (which will hopefully be changed to which are present or not present shortly) changes depending on some state from outside the ListView. At the moment, I am using a Command handler and CanExecute to have each of the Context Actions update when the external state changes. This is horribly inefficient and I am currently investigating a memory leak relating to this on iOS.

My thinking is that it would be better if rather than having Context Actions updating on all of the list items, it would make far more sense to identify which item is being asked to display Context Actions and only then add the Context Actions to that item, removing them again when the Context Actions are no longer displayed. To do this I would need to react to an event saying that the Context Actions are about to be displayed, and another event saying that they are no longer being displayed. It wouldn't be ItemSelected or ItemTapped, nor ItemAppearing/ItemDisappearing. Does anybody know how I can be notified when Context Actions want to be displayed (even though they haven't been added yet), and again when they are being removed from the display?

Many thanks,

John H.


Viewing all articles
Browse latest Browse all 89864

Trending Articles