The source of the problem is usually the fact that the filename of the page is misspelled or that the page you are navigating to has invalid XAML code. You can try to comment some code on the XAML page to see if the navigation is performed correctly if less content is displayed.
You can also investigate the NavigationFailedEventArgs
object passed to the error handler and read the e.Exception.Message
property, which should contain additional details about the exception thrown.
In case the QueryString's property can be unset, you will have to check for this situation:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
string filename = "";
if ( NavigationContext.QueryString.TryGetValue("note", out filename ) && !string.IsNullOrEmpty(filename))
{
using (var store = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication())
using (var stream = new IsolatedStorageFileStream(filename, FileMode.Open, FileAccess.ReadWrite, store))
{
StreamReader reader = new StreamReader(stream);
this.NoteTextBox.Text = reader.ReadToEnd();
this.FilenameTextBox.Text = filename; reader.Close();
}
}
}