回答

2

您可以像使用

NavigationService.Navigate(new Uri("/MainPage.xaml?value=Hello%20World", UriKind.Relative); 

和值可以傳遞給爲

string value = this.NavigationContext.QueryString["value"]; 
2

除了在頁面URI字符串傳遞,並與NavigationContext檢索它們的查詢字符串值,有ISN沒有任何開箱即用的選擇!

但是,您可以隨時在App類中聲明所有頁面都可用的公共屬性!

4

你可以做一個單身人士;)。 下面是一個例子:

public class MySingleton 
    { 
      private static MySingleton _mInstance; 

      public static MySingleton Instance 
      { 
       get { return _mInstance ?? (_mInstance = new MySingleton()); } 
      } 

     /// <summary> 
     /// You can send values through this string. 
     /// </summary> 
     public string SomeString { get; set; } 
    } 

編輯:要將值分配給它,你可以做這樣的事情:

MySingleton.Instance.SomeString = "Text"; 
2

你可以通過使用IsolatedStorageSetting值,你已經使用isolatedStorage時要小心,您必須手動清除它,否則它將不會被清除,除非您這樣做或卸載應用程序/關閉仿真器,IsolatedStorage Documentation

2
  <Button Content="Next page" Grid.Column="1" Height="23" Tag="/NextPage.xaml" HorizontalAlignment="Right" Margin="0,6,12,0" Name="btnViewQuestion" VerticalAlignment="Top" Width="100" />