![](/img/trans.png)
[英]how can i take that page1.html paeg from mainpage.xaml to secondpage.xaml and show on webControl browser?
[英]How can I pass a ListView from MainPage to other xaml page?
我正在编写一个简单的Windows Phone应用(XAML和C#)。 在MainPage中,我有一个ListView控件,其中填充了需要传递给其他xaml页的字符串项。
因此,我可以以某种方式将整个ListView传递到另一页,还是需要先将ListView项目强制转换为List容器,然后再将List传递到其他xaml页面?
protected override void OnNavigatedTo(NavigationEventArgs e)
我可以使用此功能做勾吗?
从MainPage将字符串对象作为参数传递到您的下一页。
this.Frame.Navigate(typeof(NextPage), objString);
现在,在第二页上,您可以将对象作为列表获取
protected override void OnNavigatedTo(NavigationEventArgs e)
{
var ListItem = e.Parameter as List<string>;
SampleListView.ItemsSource = ListItem;
}
现在,您可以将对象绑定为ListView的ItemsSource。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.