Using OnNavigatedFrom method
OnNavigateFrom is called when we call the NavigationService.Navigate method. It has a NavigationEventArgs object as a parameter that returns the destination page with its Content property with which we can access a property of the destination page "DestinationPage.xaml.cs"
First, in the destination page "DestinationPage.xaml.cs", declare a property "SomeProperty":
public ComplexObject SomeProperty { get; set; }
Now, in "MainPage.xaml.cs", override the OnNavigatedFrom method:
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
// NavigationEventArgs returns destination page "DestinationPage"
DestinationPage dPage = e.Content as DestinationPage;
if (dPage != null)
{
// Change property of destination page
dPage.SomeProperty = new ComplexObject();
}
}
Now, get the SomeProperty value in "DestinationPage.xaml.cs":
private void DestinationPage_Loaded(object sender, RoutedEventArgs e)
{
// This will display a the Name of you object (assuming it has a Name property)
MessageBox.Show(this.SomeProperty.Name);
}