当前位置:编程学习 > wap >>

ListBox页面绑定。

当点击ListBox控件列表项目中的某一项的标题时,跳转到该条信息的详细页面,同时传递参数。

请问这样的功能怎么实现,是不是用"SelectionChanged"事件,关键是怎样将参数传递到详细页面,同时怎样获取参数???

 private void listCollection_SelectionChanged(object sender, SelectionChangedEventArgs e)
  {
  var collectionItem = listCollection.SelectedItem as CollectionItem;
  if (collectionItem != null)
  {
  txtTitle.Text = collectionItem.Title;
  txtUrl.Text = collectionItem.Url;
  这里可不可以把“txtTitle.Text”和“txtUrl.text”这两个值传递到页面详细,然后再吧这里个数据在页面详细页面显示出来。。。。
  }
  } 
 
 
--------------------编程问答-------------------- 可以。

NavigationService.Navigate(new Uri("/YourPage.xaml?msg=" +  strText, UriKind.Relative));

strText就是要传递的参数,这里你需要处理,将两个参数放到strText中,中间加个'|'或者其它的分隔符。 --------------------编程问答--------------------
引用 1 楼 jiangyongtao 的回复:
可以。

C# code

NavigationService.Navigate(new Uri("/YourPage.xaml?msg=" +  strText, UriKind.Relative));


strText就是要传递的参数,这里你需要处理,将两个参数放到strText中,中间加个'|'或者其它的分隔符。

Mark,借过LZ,正好我也用到...

NavigationService.Navigate(new Uri("/YourPage.xaml?msg=" +  strTexta+"&&"+str, UriKind.Relative));

" "啥意思?用Request获取???


这样吗?像网页一样行吗???



--------------------编程问答-------------------- 建议Google 搜下 《Windows Phone 7知识锦》 里面很多博文,也有问题的答案
补充:移动开发 ,  Windows Phone
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,