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));
Related
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.
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*/));
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().
I have a silverlight navigation application, and I thought it would be no problem to add a page that's not part of the "navigation" app. What I would like to do is move the user from the application to a new "fullscreen" page where there's only a text covering the page saying, thanks for using....... click here to login again, and that will take the user back to my already implemented login page.
The question is how can I implement a page that's not part of the user, then I guess all I need to do is navigationservice.navigate(..)
Thanks
I believe that if you add the new page as a "Silverlight User Control" instead of a "Silverlight Page" from the Visual Studio Silverlight templates you will get the results you are looking for.
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 ?