If the new page is a blank page when you add it into your project.
We usually do like this:
this.Frame.Navigate(typeof(NewsPage), itemId);
On the opening page, we need to implement onNavigateTo() method to do the corresponding jobs. Most cases, it is crucial to use the parameter that is passing in, i.e. itemId. here is an example of how to do it.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
Story article = e.Parameter as Story;
BitmapImage bmpimg= getCoverImage(article);
if (null == bmpimg)
{
// todo: show empty image...
}
else
{
picture.Source = getCoverImage(article);
}
}
or if it is a detail page when adding it,
put the code in LoadState(){}
沒有留言:
張貼留言