views:

204

answers:

3

Hello,

I have been searching on how to navigate through the pages in silverlight 4 (navigation application) when I have implemented MVVM pattern. But nothing I found satisfied me.

I have a main page which has frame in it. In that frame I load home page which does simple URI mapping. But now I want to go to New Page on button's click event.

Can anyone please give me the solution? Its urgent.

Thanks.

+1  A: 

I used this:

this.NavigationService.Navigate(new Uri("/NewPage", UriKind.Relative));
Archie
A: 

Take a look at this article (http://csharperimage.jeremylikness.com/2009/11/dynamic-module-loading-with-silverlight.html) written by Jeremy Likness.

He is using Prism and the Navigation framework and its a good article to get you going with it. Its also not hard to take the sample he provides and apply some MVVM principals to it. I hope this helps.

dParker
A: 

This has to be written in code behind, how can we use ICommand to do this?
[quote] this.NavigationService.Navigate(new Uri("/NewPage", UriKind.Relative)); [/quote]

nvc