[Enhancement] Add better life cycle events #2210
Some lifecycle events are currently unavailable, and others are inconsistently supported across platforms Xamarin.Forms supported. To get to them today developers need to write custom page renderers in the platform projects and surface them in Xamarin.Forms. It's a pain, and we can do better!
Example or Ordering Issue
Currently, where MainPage is a TabbedPage you get this:
The comment here I think most closely indicates what we want
I've defined these all on VisualElement as they will now just be symmetrical for View and Page
Things to consider
User can subscribe to additional Page and View life cycle events.
Events are consistently fired across all platforms.
Developer rejoicing is heard in the streets.
The text was updated successfully, but these errors were encountered:
Yea @danielmeza we're looking at adding a loaded/unloaded and thinking of attaching those to when a renderer is assigned to a control like Stonis has here https://www.ston.is/xamarin-forms-secrets-renderer-property/
This was one of the things we didn't quite get right with the first implementation of life cycle events. There are a lot of different life cycle points and we're still figuring out what to expose when
The link you have there exposes an event when a control is attached and detached to the visual tree which doesn't really map to our currently logical concept for Appearing because there are cases where something might be part of the visual tree but still "Disappeared"
I'm curious how different the timing on the events is with https://www.ston.is/xamarin-forms-secrets-renderer-property/ vs https://www.pshul.com/2018/03/27/xamarin-forms-add-views-lifecycle-events/
@PureWeen thanks for sharing Stonis approach for listening when an element is attached to the VisaulTree. This is really helpful for something I am working on
Is there another issue logged to track work or expectations for the missing event of when a page is fully rendererd aka OnPageLoaded (or first paint)? I couldn't find one when I was searching.