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

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.

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.

Related

How to make the next page from continuation of data when using repeater on wix?

I have a website on wix with data connected to repeaters on the page. however my data is too big to show on the same page. How do I break the continuation and start it from the next page.
You can set the number of items to show at once in the dataset settings. Then you can add buttons (and set the click action) or a pagination bar (and connect to the dataset) to page through the items or show more items.

navigate back and display the previous page without reloading the previous page variables and designs?

I have one issue in my program, i have three pages in my program, Main page, first page and second page. I'm able to navigate from the main page to the first page and from the first page to the second page. I have a stack panel in the first page. It consists of children which are dynamically created from the db. This page contains a OnNavigateTo method, for bringing the elements from the main page and displaying it, And i wrote my codings in this method to add dynamically children to the stackpanel. when navigating back from the second page to the first page, the compiler will goes to the OnNavigateTo method and regenerate the children of the stackpanel once again.
My problem is:
i want to show the previously displayed first page with all the data, when the back button is pressed. I doesn't want the page to regenerate again. I want the static page which i have previously when i go back from the second page to the first page.
How to do it? please help me with some piece of code... Thank You..
Do the logic in the constructor, because it doesn't get called when navigating back (unless the app has been tombstoned). OnNavigatedTo gets called every time no matter how you navigate to the page.
Read this for more info:
WP7 Development Tip of the Day: Page Startup: The Constructor

Maintain Scroll Position BETWEEN TWO PAGES ASP.NET

I want to maintain the Scroll Position between two pages. I have a Page A which has many reports, when user clicks a report, user will be redirected to Page B where the report will be opened to make the changes. After submitting changes, user will be redirected to Page A. Here the problem is, showing the top of the page but I want to show the page at the previous position.
I have tried using this.MaintainScrollPositionOnPostBack = true; but this is working only on the same page but not between the different pages.
I really need to fix this, please give me your thoughts...
The simplest thing to do is probably give every link/report on page A an anchor.
So, for each report you would hide an id attribute somewhere - say the title, so it would be something like <h3 id="report42">Report 42</h3>. Then when you go back from page B, instead of going to www.example.com/pageA.html, you go to www.example.com/pageA.html#report42. This will open the page with the scrollbar at wherever the report42 id is found.

Monotouch UIScrollView and ModalView question

In my program I have the main window in the background which has a smaller, UIScrollView on it. I have buttons on each page of the scroll view which I want to bring up a modal view that can be dissmissed. It works fine for the first page, however, when I click the button on the second page of the scroll view the modal view that is brought up is on top of the first page instead of the second and the second page is completely blank. When I close the modal view, the first page has been replaced with the second page and the second page is still left blank... The code I am using is:
MVC = new NewsModalViewController(this);
MVC.ModalTransitionStyle = UIModalTransitionStyle.CoverVertical;
MVC.ModalPresentationStyle = UIModalPresentationStyle.CurrentContext;
I've been trying to play around with the frames but having no luck...
Any insights?
Cheers
I would rewrite the subpages to fire an event that the parent view listens to. Then, display the modal from the parent view (you can actually create the modal in the child view and pass it up on the event). This eliminates any problems with the modal being applied to the wrong context.
There may be another explanation, but this is the method I've implemented on a couple applications and has served me well. It appears that modals are best displayed only from the highest level view in the stack.

SL3 dataform validation indicators don't show in tab pages

I have a Prism/SL3 application with a tab control and each page of the tab control is a "Region" that has its own view and viewModel. when I want to validate the main page, I call dataForm.ValidateItem(), then I go to all the child views and do the same. the problem is, only the pages which user has clicked on them (on the tab page), get instantiated and the pages that are never shown, don't have their view instantiated, thus I can't validate them.
any help?
I created a psuedo work around for this. It's very hacky, but it does work. My example involved walking the visual tree (up and down) to find respective controls that are invalid and then "expanding" the selected item. I have used an accordian in my example, but have also tested this with tab:
http://thoughtjelly.wordpress.com/2009/09/24/walking-the-xaml-visualtree-to-find-a-parent-of-type-t/
HTH,
Mark
EDIT: Link updated.

Resources