[Enhancement] Renderer need some override method for native platform like android lifetime manage #103
Unanswered
jingliancui
asked this question in
General
Replies: 1 comment 1 reply
-
How might this work with #28 Slim Renderer Architecture @Clancey @PureWeen? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Something 3rd party library like the Amap (a map product in china),It include the navi view feature with lifetime managed.After finished the binding work.It can be use in the Xamarin.Forms project using the renderer feature,or use it in the Xamarin.Android project.
In the Xamarin.Android, the navi view's lifetime managed can be invoke by the OnResume(),OnPause() etc... which are override method in the Activity.
But the Xamarin.Forms' side,It's only has one MainActivity to manage these lifetime methods,then on renderer side,I must get the native control from the member of the MainActivity.
Sample code here:
https://github.com/jingliancui/XamarinFormsAMapSDKSample/blob/master/Android/Newest/SampleApp/SampleApp/SampleApp.Android/Renderers/AMapNaviViewRenderer.cs#L35
https://github.com/jingliancui/XamarinFormsAMapSDKSample/blob/master/Android/Newest/SampleApp/SampleApp/SampleApp.Android/MainActivity.cs#L120
API Changes
Add OnResume(),OnPause(),OnDestroy() ... etc which are lifetime managed methods to Renderer base class .
Intended Use Case
Add OnResume(),OnPause(),OnDestroy() ... etc which are lifetime managed methods to Renderer base class .
Beta Was this translation helpful? Give feedback.
All reactions