Is it possible to instantiate a PhoneApplicationPage
from another project (in the same solution, but this shouldn't be important, should it?) and show it?
Well, I know that it is possible to instantiate another page with:
MyPageInProjectB bPage= new MyPageInProjectB ();
but how do I show it?
I want to do the following: I have two projects, and I want to show a page of one project within the other project and passing data between them. So I thought this would be perfect:
public partial class MyPageInProjectA : PhoneApplicationPage
{
private MyPageInProjectB bPage;
public MyPageInProjectA()
{
InitializeComponent();
MyComplexObject objectIWantToPassToOtherPage = new MyComplexObject ();
bPage= new MyPageInProjectB (objectIWantToPassToOtherPage);
}
private void ShowBPageButton_Click(object sender, EventArgs e)
{
// this is now what I want to do, but what doesn't work
bPage.Show();
}
}
Or is there another way to pass complex data between those pages?
I don't want to use query strings, because it happens sometimes, that the (De-)Serializer has problems with MyComplexObject
.
I read how to navigate between both pages in this thread: How to redirect to a page which exists in specif project to another page in other project in the same solution? but I want to pass a complex object from one page to another. How can I do that?