开发者

How do I load a new Page?

i have multiple Pages (cla开发者_C百科sses 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?


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

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


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());
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜