Navigate to another page and then resume app - c#

I'm developing a UWP app for both mobile and PCs.
I need to ask for a passcode every time the app start, also when resumed after suspension.
When the app is resumed I navigate to a pin check page, then, if the passcode is correct I navigate to the page which was shown before suspending.
The problem is that I have a page with a textbox and other control, how can I resume the text in TextBox?
When I resume the app without using pin page, I have no problem because the content of the page is totally resumed.
Thanks

The problem is that I have a page with a textbox and other control, how can I resume the text in TextBox?
You can use UIElement.CacheMode property and Frame.CacheSize property to cache the content of the page. You can refer to my another case UWP page state manage.
Or if you're using some templates for example template 10 to develop your app, you can use its own cache method, you can refer to Docs | Navigation Cache.

Related

How to dismiss splitView in windows 10 universal app?

I have a login page from which I go to another page with a splitview menu. In this menu there is an option for log out from the app. In this case, I want to go to the login page again, but I don't know how to charge that page in the full page (only charge the page in the content frame but the split view is still there). How can I clear/dismiss it?
Thanks!
I don't know your implementation but this should work on any page:
this.Frame.Navigate(typeof(YourLoginPageType));
or this should work everywhere
Frame rootFrame = (Frame)Window.Current.Content;
rootFrame.Navigate(typeof(YourLoginPageType));

Universal Windows 8.1 App Page Change

I am trying to change pages when a text block is selected but I don't know how to get my app to go to the next page.
Figured out the answer to my question. In order to navigate between pages, you need to make the following call when the event you want the transition to happens:
this.Frame.Navigate(typeof(/*name of page you want to transition to*/));

Universal volume control navigation WP8

How do we control the navigation to a page from UVC? I want it to navigate to the "Now playing page" in the app when tapped, both when the app is closed and app is in the background. "BackgroundAudioPlayer" is used for playing the songs.
The only solution I came to is - writing the current song to the Now playing item in Music & video hub as mentioned in this post - Detect application launch from Universal Volume Control
The value given into the MediaHistoryItem.PlayerContext will be obtained as the NavigationContext.QueryString in the OnNavigatedTo event. Using this value, navigate to the required page.

Navigate back to MainPage Visual Studio 2013

I have a windows phone app that navigates between pages and I use
NavigationService.GoBack();
to go back to the Mainpage. All good and works great.
The app is a simple 2 page app and works great under IOS, Android and Windows Phone, but I need to find the correct way to go back to the MainPage in Windows Store Apps using VS2013EX.
I tried
Frame.GoBack();
but it does not work well due to the fact that my second page is a WebView and if I navigate to another page on the webview, the Frame.GoBack() does not remove the second page but just goes back to the other web page. Its almost like Frame.GoBack() is just the webView's go back method.
I tried this code:
this.Frame.Navigate(typeof(MainPage));
This does bring me back to the MainPage, but I don't think its correct as should I not be removing the current page from the Stack????
Try this: add an event handler for OnNavigatedFrom in which do the (WebviewName).NavigateToString("") and use this.Frame.GoBack().

How to display EULA in WP7 application?

As stated by Microsoft, it's not possible to programatically navigate from the main page. I have a EULA page that I need to show if the user is using the app for the first time. My plan was to determine on the main page if the app has been used before. If not, I had planned to navigate to the EULA page, but this is not possible. How can I get around this navigation limitation?
The issue with a dedicated EULA page that is automatically pushed on the back stack is that the application won't quit when the user presses the Back key when in the EULA page.
You should instead use a Popup control that you show and hide when appropriate.
See Peter Torr's post on how to exit an application for more details and background.
It should be possible to navigate from the main page easily using:
if (!eulaAgreed)
NavigationService.Navigate(new Uri("/EULAPage.xaml", UriKind.Relative));
Probably best to put this code in OnNavigatedTo of your main page or even later in the page cycle using Dispatcher.BeginInvoke(...). Putting it before that (i.e. in the constructor or Loaded) may not work.
What do you think happens to the Navigation stack?
Would the users be able to access the EULA page again? maybe by clicking back from the MainPage ?

Categories