Forum Xamarin.Forms

ListView Items lifecycle

Can someone explain lifecycle of list items - Here is a problem that's confusing me:
OnDissapearing is called before view is shown? I'm starting new page with listview inside, and OnDissapearing of viewCell (which is on that page) is called. When I'm navigating outside of page that contains listView, onDissaparing of listView items is not getting called. I've subclassed view cell and put breakpoints in on appearing and on dissapearing methods in order to get how lifecycle is working.
I would like to unsubscribe list item views from messaging center, so if there's better way for achieving that other then in OnDissapearing, any help is appreciated


  • EricMaupinEricMaupin USXamarin Team Xamurai

    Appearing/Disappearing for Cells is only within the context of the ListView they're contained in.

    Which platform do you see that OnDisappearing happens first?

  • SmartNetSmartNet USMember

    Android. OnDisappering is not happening first, it happens right after onAppearing, but both listView and page which contains listview are still on screen.
    Actually I'm trying to do it differently now -> I've subscribed ViewModel to messages, and by changing property my data is displayed correctly. Can i catch when ViewModel object is collected by garbage collector?

  • voidvoid DKBeta ✭✭✭

    Using 1.31 pre 1, my iOS app does seem to be calling the disappear event for a viewcell. Ever.

Sign In or Register to comment.