c# - Windows Phone 8.1 check if password set else load new page -


I have a similar situation in which I have a login page which is my MainPage.xaml file but I have a And the page is called SetPassword.xaml which I want to load if the user has not yet set a password. Basically this is the first time that the app loads after installing it.

I've spent a few hours trying out many different solutions (from which I linked), but I am not getting anywhere and it seems that many solutions are either WP7 or WP8 And something like that has been resolved for the new WP8.1.

This is a basic check using Windows. Storage that I see if a password has been set or not.

  Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; Windows.Storage.StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; If (local settings.value ["myPassword"] == faucet) {Debug.WriteLine ("password is not set"); This.Frame.Navigate (typePassword); } else {Debug.WriteLine ("The password is set, continues in normal form"); }   

If I add it to the public manpage () class then I have no problem coming back to the app "password is not set in debug messages" but this.frame.Navigate (typePassword) Navigation has never loaded the SetupWord view.

I also have the same result in OnNavigatedTo in this method.

In my App.xaml file I also tried several ways, again, with the same result. I can get debug messages but do not look for navigation. I saw implementing a method on application_Launching as well as implementing the RootFrame.Navigating + = RootFrameOnNavigating conditional navigation, but clearly I'm missing out on something is.

Hope you can be able to work on my navigation based on conditional price?

The solution was simple to navigate, I could do it according to my question in the app or the men page, But the navigation was not working, because I was trying to navigate on SetPassword.xaml which is a & lt; ContentDialog & gt; Instead of a & lt; Page & gt; I feel really embarrassed that I did not even check it, but hopefully if it happens to someone else, then they can check that they are actually a Trying to navigate the page and there is no other type of element.

Edit:

In my profile in the AP.fml file, I see how I can now check and redirect my value Based on a different page.

  Protected override zero online (LaunchActiveEventAgages E) {frame rootfrem = window. Present. Content in the form of frames; If (rootframe == empty) {rootfrem = new frame (); RootFrame.CacheSize = 1; Window.Current.Content = rootFrame; // Here are the following checks to see that the value of the password is set and if it is not, it redirects to save the password - and it loads the main page. Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage ApplicationData.Current.LocalSettings; Windows.Storage.StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder; If (local settings.value ["myPassword"] == faucet) {rootFrame.Navigate (typePassword); } Else {rootFrame.Navigate (typeof (menopause)); }} If (rootfraame.Resource == zero) {ifFrame (rootFrame.ContentTransitions! = NULL} {this.transitions = new TransitionCollection (); Foreach (rootframe in root C.contact transitions) {this transition.ed (C );}} RootFrame.ContentTransitions = null; rootFrame.Navigated + = this.RootFrame_FirstNavigated; if (! Rootframe.Navigate (typef (menopause), e.b. body) (new exception throw ("failed to create initial page"); }} Window. Activate ();}    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -