我在我的Silverlight應用程序中有多個頁面(派生自Page對象的類)。 我可以用下面的語句在app.xml中加載一個: this.RootVisual = new ZoomData();如何加載新頁面?
但是我應該怎麼做,當我有這個頁面加載,我想導航到另一個頁面?
我在我的Silverlight應用程序中有多個頁面(派生自Page對象的類)。 我可以用下面的語句在app.xml中加載一個: this.RootVisual = new ZoomData();如何加載新頁面?
但是我應該怎麼做,當我有這個頁面加載,我想導航到另一個頁面?
不錯,kudo的給你 – Michel 2010-05-26 11:25:59
看看使用「Silverlight導航應用程序」模板創建您的應用程序。
這提供了創建多頁面silverlight應用程序的基本框架。
對我來說有點太過分了,我只是創建了一個概念證明,我不想設置一個新的應用程序 – Michel 2010-05-25 09:33:32
@Michel:如果它的概念證明簡單的從模板中創建一個新的應用程序,然後運行它。嘿Presto它的作品。 – AnthonyWJones 2010-05-25 11:04:06
我結束了與此:
在application_startup
Grid root = new Grid();
this.RootVisual = root;
root.Children.Add(new ZoomData()); // This is your first page
在按鈕的單擊事件
Grid root = Application.Current.RootVisual as Grid;
root.Children.RemoveAt(0);
root.Children.Add(new ZoomData());
檢查此鏈接: http://forums.silverlight.net/forums/p/160051/359133.aspx – Malcolm 2010-05-25 10:30:09