我想在翻转视图控件中显示网格视图选定项。该控件被放置在另一个页面中。请告诉我如何得到这个?
我尝试了以下代码:上一页网格视图项目单击事件:
private void PhotoGrid_ItemClick(object sender, ItemClickEventArgs e)
{
var itemid = ((flipimage)e.ClickedItem);
flipimage s = new flipimage() { ImageUrl = itemid.ImageUrl, Title = itemid.Title };
this.Frame.Navigate(typeof(FlipPage), s);
}
第二页:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
//XDocument xdoc = XDocument.Load("XMLFile1.xml");
//IEnumerable<flipimage> images = from img in xdoc.Descendants("Image") select new flipimage(img.Element("ImageTitle").Value, img.Element("ImageUrl").Value);
flipimage s = (flipimage)e.Parameter;
string url = s.ImageUrl;
flipviewcontrol.Items.Add(url);
//flipviewcontrol.DataContext = images;
}
<FlipView HorizontalAlignment="Left" VerticalAlignment="Top" x:Name="flipviewcontrol" ItemsSource="{Binding}">
<FlipView.ItemTemplate>
<DataTemplate>
<Image HorizontalAlignment="Left" Source="{Binding ImageUrl}" Height="762" VerticalAlignment="Top" Width="1360" x:Name="imagecontrol"/>
</DataTemplate>
</FlipView.ItemTemplate>
</FlipView>
请告诉我如何在 Windows 8 的翻页视图中显示前一页图像?