Note that there are some explanatory texts on larger screens.

plurals
  1. POWindows Phone 8 - Navigation Error
    primarykey
    data
    text
    <p>I have a file in <code>IsolatedStorage</code>. If the file exists, I want to redirect to the login page or Create Account page.</p> <p>If the file doesnt exist, the app goes to the Create page, a password is created and saved, and the app redirects to the Login page. However, if the file in IsolatedStorage exists, it won't direct.</p> <pre><code>private void fileExists() { IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication(); if (store.FileExists("passwordFile")) { //NavigationService.Navigate(new Uri("/Login.xaml", UriKind.Relative)); MessageBox.Show("Should be redirecting here"); } else { MessageBox.Show("Welcome. Please create an account. Ensure that you remember your password!"); } } </code></pre> <p>The actual message does show so it's being called and if a file does not exist, the else is executed so my logic is sound.</p> <p>The <code>FileExists()</code> function is called here.</p> <pre><code>public MainPage() { InitializeComponent(); fileExists(); } </code></pre> <p>The other redirect happens here</p> <pre><code>if ((password1.Password == password2.Password) &amp; (password1.Password.Trim().Length &gt; 0 || password2.Password.Trim().Length &gt; 0)) { byte[] PasswordByte = Encoding.UTF8.GetBytes(password1.Password); byte[] ProtectedPassword = ProtectedData.Protect(PasswordByte, null); this.WritePasswordToFile(ProtectedPassword); NavigationService.Navigate(new Uri("/Login.xaml", UriKind.Relative)); } </code></pre> <p>The error is a <code>System.NullReferenceException</code> but was not handled in user code.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload