views:

34

answers:

2

There are two pages in my silverlight project: MainPage-default page and SecondViewPage an added Silverlight page. To navigate from one to another, I've overridden the Application_Startup(...)

{
this.RootVisual = mainUI;
mainUI.Children.Add(new MainPage());
}

created a

public static void GotoPage(UserControl nextPage)
        {
            App app = (App)Application.Current;
            app.mainUI.Children.Clear();
            //show next page
            app.mainUI.Children.Add(nextPage);
        }

Then openning the SecondViewPage is simple like:

App.GotoPage(new SecondViewPage());

But what I realy want is to open the second view page in a separage browser window because the removing childer and adding new makes navigation totally outside of the browser (the "back" button is not keeping the prvious page link).

Thanks for suggestions. V

A: 

You seem to not be using any navigation features provided by Silverlight 4.

I recommend you try generating a test project using the "Business Application" template and see how multipage navigation can work. It has full support for browser back and forward and will save you a lot of work.

Enough already
Same as in Anthony's response, I don't want to paint my next page into a frame not to loose "full screen" and page real estate. Just open a new browser window and load my page fully. Thanks,V
val
A: 

This is exactly the sort of problem that the navigation framework is designed to solve.

I recommend you clear half an hour and watch this Silverlight TV Video on Channel 9.

Edit

If you must launch a separate window you the navigation framework would still be useful however you would use a standard window navigation. Like this:-

HtmlPage.Window.Navigate(new Uri("ThisHostPage.aspx#SecondView" UriKind.Relative), "_blank");
AnthonyWJones
Thanks Anthony, but the navigation is not what is needed. It will still paint my second page into the frame of the "switch board". But I need to open a separate browser and load my "second page" into. V
val
@val: See Updated answer.
AnthonyWJones
yep, that looks cool, thank you Anthony
val