I have a page with 4 TextBoxes. Each time pressing on the TextBox I use the NavigationService to navigate to the new page in order to make a comfortable input through Itembox. I use NavigationContext in order to send the selection from the Itembox. But each time navigating back to the first page, constructor of the page gets called and I see empty TextBoxes instead of filled ones.
How can I avoid this?
Do you actively navigate “back” to your main page using
NavigationService.Navigate()? Don’t do this, just useNavigationService.GoBack()or let the user use the Back button.You can transfer the value via
PhoneApplicationService.Current.State. Add this to your page where the user enters the value into the Itembox:This saves the value when the user goes back to the main page. And to your main page code add:
This tries to get the value and sets it to the
TextBox.