Page navigation in silverlight 4 using the MVVM template

I have a navigation application developed in Silverlight 4. It has a main page containing a frame. I am loading somepartr view in this frame, and I know that I can use the NavigationService to go to another page that will be loaded into the same frame.

But my question is, how can this be done using MVVM? To get the frame, do I need to transfer the link to the page?

In addition, according to my knowledge, one glance does not know about any other ideas. So what is the best way to inform them of each other? I heard about the controller and the intermediary, but how do I implement them to get the frame of the main page?

It would be very helpful if someone could give me an example or perhaps a sample code for this.

Thanks in advance.

+4
source share
2 answers

When I tried this before, I had a VM fire with the Navigate event when I wanted to change the view. The main view with the frame then made a call to the navigation service to go to the corresponding page. However, I remember that it was not perfect.

It is possible that navigation is not suitable for MVVM.

+1
source

This Nikhil article seems appropriate for your question http://www.nikhilk.net/Entry.aspx?id=232 .

He talks about using the MVC pattern when working with Silverlight navigation. Nikhil also talks about his framework that he created to promote the development of Silverlight.

0
source

Source: https://habr.com/ru/post/1311066/


All Articles