2011-12-04 7 views
-2

別のxamlウィンドウからtextBlockにアクセスするには? 私はメインページを持っており、イベントハンドラxmppClient_OnMessageがあります。 - あなたが別のウィンドウに移動した時間で、前のは、おそらく(別名メモリから削除)消えてしまいますSilverlight(Windows Phone)access textBlock

void xmppClient_OnMessage(object sender, MessageEventArgs e) 
     { 
      this.NavigationService.Navigate(new Uri("/message.xaml", UriKind.Relative)); 

      message.textBlock1.Text += e.Message.From + ": " + e.Message.Body; 
     } 

答えて

0

htmlのようにクエリパラメータを使用してデータを渡すことができます。

this.NavigationService.Navigate(new Uri("/message.xaml?messageid=1", UriKind.Relative)); 

、次のページに次のように

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) 
{ 
    if (this.NavigationContext.QueryString.ContainsKey("messageid")) 
    { 
     //your code here 
    } 

    base.OnNavigatedTo(e); 
} 
0

あなたがいない:私はこのような何かをしたいです。必要なすべてのデータをナビゲーション経由でクエリパラメータとして渡すか、メモリ内に静的オブジェクトを置くだけです。

+0

それをretrive、どのように教えてください? – Twice

+0

Mohitはあなたに – argh

関連する問題