views:

113

answers:

3

Hi,

i have multiple Pages (classes which derive from the Page object) in my silverlight app. I can load one in the app.xml with this statement: this.RootVisual = new ZoomData ();

But what should i do when i have this page loaded, and i want to navigate to another page?

A: 

Look into creating your app using the "Silverlight Navigation Application" template.

This provides the basic framework to create multi-page silverlight applications.

AnthonyWJones
that's a little too much for me, i'm just creating a proof of concept and i don't want to setup a new app
Michel
@Michel: If its a proof of concept the simple create a new app from the template then run it. Hey Presto it works.
AnthonyWJones
A: 

i ended up with this:

In the application_startup

Grid root = new Grid();
this.RootVisual = root;
root.Children.Add(new ZoomData()); // This is your first page

in the click event of a button

Grid root = Application.Current.RootVisual as Grid;
root.Children.RemoveAt(0);
root.Children.Add(new ZoomData());
Michel
+1  A: 

Try this article : How to Create a Silverlight Paging System to Load new Pages

nice, kudo's for you
Michel