¿Cómo hacer la transición entre pantallas en WP7?

Today I started learning how to develop for Windows Phone, and I have a question.

I have a main screen (MainPage.xaml) and a second screen (TaskPage.xaml). I want to navigate between these screens.

Escribí:

        var frame = Application.Current.RootVisual as PhoneApplicationFrame;
        frame.Source = new Uri("/TaskPage.xaml", UriKind.Relative);

I ran it in the emulator, but visual studio return an error in MainPage.g.i.is in line:

   System.Windows.Application.LoadComponent(this, new System.Uri("/Appname;component/MainPage.xaml", System.UriKind.Relative));

Whats wrong? Sorry for bad english and thanks for answers.

preguntado el 08 de noviembre de 11 a las 17:11

1 Respuestas

Try making use of the NavigationService such as:

NavigationService.Navigate(new Uri("/TaskPage.xaml", UriKind.Relative));

In your current code where you were changing the frame.Source. For a bigger picture on navigation in WP7 give this a read through : WP7 Navigation Step by Step

respondido 08 nov., 11:21

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.