.Background
I want to dynamic create the page. Beacase I use the sliverlight to do user manage system, I login the system and then go to the home page, this moment I refresh the home page ,it go back the login page. I become so grief.
I know the root of problem , because the app.xaml.cs application_start block. when you refresh the page, it will run the application_start block again. I write the code in the application_start following here:
Grid g = new Grid();
this.RootVisual = g;
LoginPage p = new LoginPage();
g.Children.Add(p);
you can see , when this code run ,it will create login page again.
.Solution
I decide to use the cookie and parameter to dynamic create the page, I think this will fix this problem.