2
votes

I have a button and a tapped event:

private void btnSetLocationName_Click_1(object sender, RoutedEventArgs e)
    {
        ApplicationModel.LocationName = locationName.Text;
        Frame.Navigate(typeof(GroupsPage));
    }

I want to just navigate to another page. Unfortunately, Frame.Navigate does not work. I have also tried to make sure it runs in the GUI thread: await this.Dispatcher.RunAsync(CoreDispatcherPriority.High, () => Frame.Navigate(typeof(GroupsPage)));

However, it should do, as the click handler for the button runs in the GUI thread.

The following error occurs: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

1
Have you tried navigating to a simple blank page? Perhaps there is an exception thrown when trying to instantiate the GroupsPage? also, is the GroupsPage.xaml defined in the same assembly? - Krishna
Are you using the RTM version of Windows 8? - JP Alioto
Hi there, yep, GroupsPage is in the main assembly and also, I have tried creating a separate Blank Page (which not inherit from LayoutAwarePage) however, it gets passed InitializeComponent, but then it fails. It is Windows 8 RTM. - krisdyson

1 Answers

6
votes

OK, after commenting out bits of code until it worked, it turns out I had an empty OnNavigatedTo override:

protected override void OnNavigatedTo(NavigationEventArgs e)
{
    //base.OnNavigatedTo(e);
}

If you uncomment base.OnNavigatedTo it now works.

I think what threw me was that the error occurred when navigating FROM a page with this empty override. Also, the cryptic error message didn't help much.