I wish I could reply to vjsrinath's response above; it is IMO the best way to do this. Many thanks!!
It is probably the closest thing I've seen to how the iOS model works, where from first page you called performSegue (== NavigateTo). Then you get a callback called prepareForSegue, which allows you to set up variables in the destination page, set the delegate (usually to self), that sort of thing.
For complex object passing, it beats the pants off passing params in the URL.
As an explicit example, say I want to pass the version string of my app into an About box which is in a separate project:
In the calling class:
private void About_Click(object sender, EventArgs e)
{
NavigationService.Navigate(new Uri("/Library;component/Pages/About.xaml", UriKind.Relative));
}
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
if (e.Content is About)
{
About page = e.Content as About;
if (page != null)
{
page.VersionString = App.VersionText;
}
}
base.OnNavigatedFrom(e);
}
In the About class:
public partial class About : PhoneApplicationPage
{
public string VersionString { get; set; }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
versionTextBlock.Text = VersionString;
}
}
This is a very simple example of course, but the property you're passing through could be any object, making this very powerful. Of course it can include callbacks such as "saveButtonPressed" etc so the save handling can be done in the calling class, not the presented view, which is pretty crummy for code tidiness. e.g.,
page.OnSaveButtonPressed = this.SaveButtonPressedHandler; // Pass object to save as parameter