New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xamarin.Forms does not have a view lifecycle/activation hook, someone should PR it into Xamarin.Forms #1133
Comments
There is an activity Rx lifecycle hook in Java from Trello https://github.com/trello/RxLifecycle and something similar from Airbnb https://github.com/airbnb/RxGroups. Frameworks like https://github.com/bluelinelabs/Conductor use the activity lifecycle callback. Such as https://github.com/bluelinelabs/Conductor/blob/557e4c2122a145c44be7a3a51945174c02489b8c/conductor/src/main/java/com/bluelinelabs/conductor/internal/LifecycleHandler.java |
This is a big issue. Pages have OnAppearing, but Views don't. How are we supposed to know when the control put on screen? |
@MelbourneDeveloper btw, the only recourse I have found is to forward life cycle events from the host page to any views within it that need to activate/deactivate. It's a bit annoying, but it works. Of course, we want to improve the story a lot moving forward, hence the XF proposal. |
I'm going to use the OnParentSet method which sucks but will probably do the job until this is fixed. |
Microsoft announced at build they are adding these hooks into XF. |
@PureWeen What's the status on this one? |
Unfortunately we weren't able to get this into 4.0 because the implementation wasn't quite right I have parts of that work accomplished here for shell This takes a couple steps forward with setting up Appearing to actually represent Appearing opposed to Appeared. Once that's in I'm hoping to propagate that down to the View level then work on appeared. Out of curiosity would you make use of an Appeared event at all? It seems like for MVVM Appearing is most important. |
As Xamarin is no longer supported I am closing this issue |
Xamarin Forms still does not have a view lifecycle/activation hook, someone should PR it into Xamarin.Forms now that it is open source. Kent has the details and can act as a mentor for anyone whom wishes to help make this happen.
If you want to make self-contained reactive views with RxUI prior to the XF issue being addressed, you're not _completely_ dead in the water - see https://gist.github.com/kentcb/d8f310a4db40cc6833c5df48fa2de31a (for v7 upwards)
The text was updated successfully, but these errors were encountered: