Hello,
I derived my class from ListViewTemplateCell and tried to overwrite OnAppearing/OnDisappearing to be notified when an item is actually visible.
But those callbacks are never hit. I also tried the Appearing-EventHandler, but this is not called either.
Seems like a bug?
8 Answers, 1 is accepted
Could you please share with us your exact setup? How is your custom cell used and created? Is it visualized on the screen?
We are looking forward to hearing from you.
Regards,
Pavel R. Pavlov
Telerik by Progress
Hi Pavel,
thanks for getting back to me.
Well, i pushed an example on github: https://github.com/esskar/TelerikListViewPoc
It should demonstrate all problems i have with the list view on iOS. Please find the class BookListCell, it overwrite the OnAppearing/OnDisappearing functions, but they are never called.
Thanks.
Sascha
Thank you for providing us with repro project. Indeed the events are not triggered. This behavior is already logged in our backlog system. This means it will be reevaluated and fixed in our future releases. Till then users are able to be notified when a cell is visualized using a different mechanism.
Users are allowed to create custom DataSource. In iOS the DataSource is responsible for managing the cells. For example you can override the InitCell() method and get the index of the item being visualized.
You can take a look at the attached project to get a better knowledge.
I hope this information helps. Let us know if you need any further assistance.
Regards,
Pavel R. Pavlov
Telerik by Progress
Indeed, this approach will not notify you when the cell disappears. We have already logged an item in our backlog system to reiterate over the cells. We will definitely improve their implementation in our future releases.
Regards,
Pavel R. Pavlov
Telerik by Progress
Back in February of 2017, it was mentioned that the implementation of this was definitely going to be improved. Has that happened? OnAppearing and OnDisappearing are still not called.
To echo Sascha's concerns, the project provided by Pavel gives a workaround for OnAppearing, but I do not see any workaround for OnDisappearing even though Pavel says there is. Maybe I am just missing something. If so, could I please get some clarification?
Let me get straight to your question.
Since my last reply, we have not changed the behavior of the ListViewTemplateCell. The demand for this particular case did not receive any further attention and more pressing tasks took their place in our roadmap instead.
At this time, we are not sure about the future of the entire cell concept inside the XamarinForms components. The newest items control of XamarinForms, the CollectionView, does not take advantage of cells. This is why we cannot commit to fixing code that entirely relies on logic that might get obsolete in the near future. We prefer to first see the course of action of the XamarinForms platform regarding the cells and then commit to fixing existing code or writing new one.
As for the alternative for the OnDissapearing notification in the current version of the RadListView, there is none. I have made a typo in the earlier reply which misleads the reader. After posting this reply I will edit the older one to fix the mistake I made. Please accept my apology for making such a typo.
Regards,
Pavel R. Pavlov
Progress Telerik
Thank you for the timely response, Pavel!
While unfortunate, that does help our decision making process.