尝试这个:
this.DefaultViewModel["Group"] = group;
this.DefaultViewModel["Items"] = group.Items;
/// <summary>
/// Invoked when an item is clicked.
/// </summary>
/// <param name="sender">The GridView (or ListView when the application is snapped)
/// displaying the item clicked.</param>
/// <param name="e">Event data that describes the item clicked.</param>
void ItemView_ItemClick(object sender, ItemClickEventArgs e)
{
// Navigate to the appropriate destination page, configuring the new page
// by passing required information as a navigation parameter
var itemId = ((ItemBase)e.ClickedItem).UniqueId;
this.Frame.Navigate(typeof(ItemDetailPage), itemId);
}
您需要确保您的点击事件处理程序已连接。为此,请添加:
ItemClick="ItemView_ItemClick"
对于任何包含您的项目的列表控件。