locked
Navigating between windows (Gurdy) - 2/19/2007 5:29 AM PST RRS feed

  • Question

  • By: Gurdy

    Hi!
    
    Before the Blend beta, we used to navigate from scene to scene using the 
    following code. 
    NavigationService NS = NavigationService.GetNavigationService(this);
                NS.Navigate(new Uri("Window2.xaml", UriKind.Relative));
    This does not work for us now. Does anyone know what to replace it with?
    
    Mary
    Tuesday, February 19, 2008 8:15 PM

Answers

  • By: Unni Ravindranathan (MS)


    I think Brennon is right. You are trying to navigate to a Window, which is 
    not allowed. The difference between the old builds and new is that back 
    they, by default, when you created a new item, we used to create a "Scene" 
    which is basically an element derived from Grid. Now, by default, we create 
    a Window which cannot be nested inside other windows, navigated to, etc.
    
    Sample is attached.
    
    Thanks,
    -Unni
    
    "Gurdy" <Gurdy@discussions.microsoft.com> wrote in message 
    news:5D90945D-EAE4-4977-9A98-4A5986C8F29C@microsoft.com...
    > Hi Brennon,
    >
    > This crashes when I click the button to bring up the new page. Does it 
    > crash
    > for everyone else, too? Or is it just us. Is there any other way to 
    > navigate?
    > This seems like a fundamental problem. I suppose we could use layers and
    > assign them a ZIndex, but that doesn't seem like the best solution, 
    > although
    > maybe it is. Any thoughts?
    >
    > Thanks!
    > Mary
    >
    > "Brennon Williams" wrote:
    >
    >> Howdy,
    >>
    >> You cant navigate to a Window, you need to change the root element to 
    >> page
    >> and then it should still work... I've not tested this lately but as far 
    >> as I
    >> know there has been no change to the navigation service.
    >>
    >> Let me know how you go.
    >>
    >> Cheers
    >> -- 
    >> http://www.learnexpressionblend.com
    >> http://www.expressionblend.com
    >> http://www.resourcedictionary.com
    >> http://www.x-coders.com
    >>
    >>
    >> "Gurdy" wrote:
    >>
    >> > Hi!
    >> >
    >> > Before the Blend beta, we used to navigate from scene to scene using 
    >> > the
    >> > following code.
    >> > NavigationService NS = NavigationService.GetNavigationService(this);
    >> >             NS.Navigate(new Uri("Window2.xaml", UriKind.Relative));
    >> > This does not work for us now. Does anyone know what to replace it 
    >> > with?
    >> >
    >> > Mary 
    
    
    
    Tuesday, February 19, 2008 11:59 PM

All replies

  • By: Brennon Williams


    Howdy,
    
    You cant navigate to a Window, you need to change the root element to page 
    and then it should still work... I've not tested this lately but as far as I 
    know there has been no change to the navigation service.
    
    Let me know how you go.
    
    Cheers
    -- 
    http://www.learnexpressionblend.com
    http://www.expressionblend.com
    http://www.resourcedictionary.com
    http://www.x-coders.com
    
    
    "Gurdy" wrote:
    
    > Hi!
    > 
    > Before the Blend beta, we used to navigate from scene to scene using the 
    > following code. 
    > NavigationService NS = NavigationService.GetNavigationService(this);
    >             NS.Navigate(new Uri("Window2.xaml", UriKind.Relative));
    > This does not work for us now. Does anyone know what to replace it with?
    > 
    > Mary
    Tuesday, February 19, 2008 11:58 PM
  • By: Gurdy


    Hi Brennon,
    
    This crashes when I click the button to bring up the new page. Does it crash 
    for everyone else, too? Or is it just us. Is there any other way to navigate? 
    This seems like a fundamental problem. I suppose we could use layers and 
    assign them a ZIndex, but that doesn't seem like the best solution, although 
    maybe it is. Any thoughts?
    
    Thanks!
    Mary
    
    "Brennon Williams" wrote:
    
    > Howdy,
    > 
    > You cant navigate to a Window, you need to change the root element to page 
    > and then it should still work... I've not tested this lately but as far as I 
    > know there has been no change to the navigation service.
    > 
    > Let me know how you go.
    > 
    > Cheers
    > -- 
    > http://www.learnexpressionblend.com
    > http://www.expressionblend.com
    > http://www.resourcedictionary.com
    > http://www.x-coders.com
    > 
    > 
    > "Gurdy" wrote:
    > 
    > > Hi!
    > > 
    > > Before the Blend beta, we used to navigate from scene to scene using the 
    > > following code. 
    > > NavigationService NS = NavigationService.GetNavigationService(this);
    > >             NS.Navigate(new Uri("Window2.xaml", UriKind.Relative));
    > > This does not work for us now. Does anyone know what to replace it with?
    > > 
    > > Mary
    Tuesday, February 19, 2008 11:58 PM
  • By: Unni Ravindranathan (MS)


    I think Brennon is right. You are trying to navigate to a Window, which is 
    not allowed. The difference between the old builds and new is that back 
    they, by default, when you created a new item, we used to create a "Scene" 
    which is basically an element derived from Grid. Now, by default, we create 
    a Window which cannot be nested inside other windows, navigated to, etc.
    
    Sample is attached.
    
    Thanks,
    -Unni
    
    "Gurdy" <Gurdy@discussions.microsoft.com> wrote in message 
    news:5D90945D-EAE4-4977-9A98-4A5986C8F29C@microsoft.com...
    > Hi Brennon,
    >
    > This crashes when I click the button to bring up the new page. Does it 
    > crash
    > for everyone else, too? Or is it just us. Is there any other way to 
    > navigate?
    > This seems like a fundamental problem. I suppose we could use layers and
    > assign them a ZIndex, but that doesn't seem like the best solution, 
    > although
    > maybe it is. Any thoughts?
    >
    > Thanks!
    > Mary
    >
    > "Brennon Williams" wrote:
    >
    >> Howdy,
    >>
    >> You cant navigate to a Window, you need to change the root element to 
    >> page
    >> and then it should still work... I've not tested this lately but as far 
    >> as I
    >> know there has been no change to the navigation service.
    >>
    >> Let me know how you go.
    >>
    >> Cheers
    >> -- 
    >> http://www.learnexpressionblend.com
    >> http://www.expressionblend.com
    >> http://www.resourcedictionary.com
    >> http://www.x-coders.com
    >>
    >>
    >> "Gurdy" wrote:
    >>
    >> > Hi!
    >> >
    >> > Before the Blend beta, we used to navigate from scene to scene using 
    >> > the
    >> > following code.
    >> > NavigationService NS = NavigationService.GetNavigationService(this);
    >> >             NS.Navigate(new Uri("Window2.xaml", UriKind.Relative));
    >> > This does not work for us now. Does anyone know what to replace it 
    >> > with?
    >> >
    >> > Mary 
    
    
    
    Tuesday, February 19, 2008 11:59 PM
  • By: Gurdy


    Yes. I tried it again and it worked. My mistake was I tried to navigate from 
    a window to a page. But I needed to navigate from a page to a page. That 
    works much better!
    
    Thanks!
    
    Mary
    
    "Unni Ravindranathan (MS)" wrote:
    
    > I think Brennon is right. You are trying to navigate to a Window, which is 
    > not allowed. The difference between the old builds and new is that back 
    > they, by default, when you created a new item, we used to create a "Scene" 
    > which is basically an element derived from Grid. Now, by default, we create 
    > a Window which cannot be nested inside other windows, navigated to, etc.
    > 
    > Sample is attached.
    > 
    > Thanks,
    > -Unni
    > 
    > "Gurdy" <Gurdy@discussions.microsoft.com> wrote in message 
    > news:5D90945D-EAE4-4977-9A98-4A5986C8F29C@microsoft.com...
    > > Hi Brennon,
    > >
    > > This crashes when I click the button to bring up the new page. Does it 
    > > crash
    > > for everyone else, too? Or is it just us. Is there any other way to 
    > > navigate?
    > > This seems like a fundamental problem. I suppose we could use layers and
    > > assign them a ZIndex, but that doesn't seem like the best solution, 
    > > although
    > > maybe it is. Any thoughts?
    > >
    > > Thanks!
    > > Mary
    > >
    > > "Brennon Williams" wrote:
    > >
    > >> Howdy,
    > >>
    > >> You cant navigate to a Window, you need to change the root element to 
    > >> page
    > >> and then it should still work... I've not tested this lately but as far 
    > >> as I
    > >> know there has been no change to the navigation service.
    > >>
    > >> Let me know how you go.
    > >>
    > >> Cheers
    > >> -- 
    > >> http://www.learnexpressionblend.com
    > >> http://www.expressionblend.com
    > >> http://www.resourcedictionary.com
    > >> http://www.x-coders.com
    > >>
    > >>
    > >> "Gurdy" wrote:
    > >>
    > >> > Hi!
    > >> >
    > >> > Before the Blend beta, we used to navigate from scene to scene using 
    > >> > the
    > >> > following code.
    > >> > NavigationService NS = NavigationService.GetNavigationService(this);
    > >> >             NS.Navigate(new Uri("Window2.xaml", UriKind.Relative));
    > >> > This does not work for us now. Does anyone know what to replace it 
    > >> > with?
    > >> >
    > >> > Mary 
    > 
    > 
    > 
    Tuesday, February 19, 2008 11:59 PM
  • By: Brennon Williams


    Howdy,
    
    My oppologies for not being clear enough with the page/window area...
    
    Glad you got it working.
    
    Cheers
    -- 
    http://www.learnexpressionblend.com
    http://www.expressionblend.com
    http://www.resourcedictionary.com
    http://www.x-coders.com
    
    
    "Gurdy" wrote:
    
    > Yes. I tried it again and it worked. My mistake was I tried to navigate from 
    > a window to a page. But I needed to navigate from a page to a page. That 
    > works much better!
    > 
    > Thanks!
    > 
    > Mary
    > 
    > "Unni Ravindranathan (MS)" wrote:
    > 
    > > I think Brennon is right. You are trying to navigate to a Window, which is 
    > > not allowed. The difference between the old builds and new is that back 
    > > they, by default, when you created a new item, we used to create a "Scene" 
    > > which is basically an element derived from Grid. Now, by default, we create 
    > > a Window which cannot be nested inside other windows, navigated to, etc.
    > > 
    > > Sample is attached.
    > > 
    > > Thanks,
    > > -Unni
    > > 
    > > "Gurdy" <Gurdy@discussions.microsoft.com> wrote in message 
    > > news:5D90945D-EAE4-4977-9A98-4A5986C8F29C@microsoft.com...
    > > > Hi Brennon,
    > > >
    > > > This crashes when I click the button to bring up the new page. Does it 
    > > > crash
    > > > for everyone else, too? Or is it just us. Is there any other way to 
    > > > navigate?
    > > > This seems like a fundamental problem. I suppose we could use layers and
    > > > assign them a ZIndex, but that doesn't seem like the best solution, 
    > > > although
    > > > maybe it is. Any thoughts?
    > > >
    > > > Thanks!
    > > > Mary
    > > >
    > > > "Brennon Williams" wrote:
    > > >
    > > >> Howdy,
    > > >>
    > > >> You cant navigate to a Window, you need to change the root element to 
    > > >> page
    > > >> and then it should still work... I've not tested this lately but as far 
    > > >> as I
    > > >> know there has been no change to the navigation service.
    > > >>
    > > >> Let me know how you go.
    > > >>
    > > >> Cheers
    > > >> -- 
    > > >> http://www.learnexpressionblend.com
    > > >> http://www.expressionblend.com
    > > >> http://www.resourcedictionary.com
    > > >> http://www.x-coders.com
    > > >>
    > > >>
    > > >> "Gurdy" wrote:
    > > >>
    > > >> > Hi!
    > > >> >
    > > >> > Before the Blend beta, we used to navigate from scene to scene using 
    > > >> > the
    > > >> > following code.
    > > >> > NavigationService NS = NavigationService.GetNavigationService(this);
    > > >> >             NS.Navigate(new Uri("Window2.xaml", UriKind.Relative));
    > > >> > This does not work for us now. Does anyone know what to replace it 
    > > >> > with?
    > > >> >
    > > >> > Mary 
    > > 
    > > 
    > > 
    Wednesday, February 20, 2008 12:00 AM