Search code examples
xamarinxamarin.formscarouselmobile-developmenttabbedpage

Xamarin Forms: Values vanished/refreshed on swiping more than four content pages inside carousel page or tabbed page


I am working on a xamarin forms project which have a carousel page container, and content pages as its children are created dynamically on different condition checks. (Minimum 8 children in my case)

Let's take the mentioned minimum case. I enter some values in entry/picker controls in the 1st child and then navigate/swipe pages till 5th child. When I came back to the first child page, the values I entered/selected are now vanished/refreshed.

I have noticed that carousel page saves only 3 pages data in it. i.e. (Left Page, Current Page and the Right Page). And Tabbed page saves 4 pages data.

I want the values to stay in the child page where I entered whether I navigate to the last most page or in the middle and navigate back to that page.

I have googled via the letters as "Carousel page/ Tabbed page Saved states" etc. but unable to find something useful.

So, I need to know the property name/ method name etc. by which xamarin forms setting the limit of carousel page as 3 and tabbed page as 4.

Waiting for your response.

Thanks.


Solution

  • OK I found that I was using a Custom Picker Control and the value refreshing issue is with it. I just forget to set the selectedIndex of the picker on OnElementChanged event.