2012-04-24 146 views
0

我是silverlight的新手。我想從登錄頁面到silverlight中的另一個頁面4.如何在silverlighr中執行此操作4.什麼是C#中的代碼?從Silverlight 4中的一個xaml頁面導航到另一個xaml頁面?

我已經寫上登錄按鈕點擊

NavigationService n = NavigationService.GetNavigationService(sender as Button); 

n.Navigate(new Uri("SelectionPage.xaml", UriKind.Relative)); 

但我發現了以下錯誤:

System.Windows.Navigation.NavigationService' does not contain a definition 
for 'GetNavigationService' 

我使用System.windows.navigation命名空間。

+0

是您的項目一個Silverlight導航應用程序? – riffnl 2012-04-24 10:56:42

回答

3

嘗試

this.NavigationService.Navigate(new Uri("SelectionPage.xaml", UriKind.Relative));

0

我用你的代碼中定義下面的方式但它仍然不是調用頁面 this.NavigationService.Navigate(new Uri("Parchase_order_main.xaml", UriKind.Relative));

相關問題