2011-11-08 7 views
1

오늘 저는 Windows Phone 용 개발 방법을 배우기 시작했으며 질문이 있습니다.WP7에서 화면을 전환하는 방법은 무엇입니까?

주 화면 (MainPage.xaml)과 두 번째 화면 (TaskPage.xaml)이 있습니다. 이 화면을 탐색하고 싶습니다. 내가 에뮬레이터에서 그것을 실행

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

하지만, 비주얼 스튜디오 라인에 MainPage.g.i.is에서 오류를 반환 :

내가 쓴

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

를 무슨 잘못? 나쁜 영어와 죄송합니다 답변을 주셔서 감사합니다. 당신이 frame.Source을 변경하고 현재 코드에서

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

: 같은 NavigationService의

답변

관련 문제