I usually keep the view and the view model separate, such that the VM has no 
knowledge of the view.
From the view model I might issue a call to navigate to a name, such as "Home".
The navigation service will be responsible for working out what view / VM  to 
build/resolve from that name, and where to load that view (ie in a region, in 
the shell, in a popup, etc).
The nav service tends to change quite drastically between applications though, 
and depends if you're using prism or other presentation style frameworks.

Of course if you just roll with Magellan you don't need to think about all 
this. :)
I need to spend more time with it, but it's not the first item on my to do 
list...

Steven Nagy
Readify | Senior Consultant, Technical Specialist (Azure), Mentor | MVP Windows 
Azure
M: +61 404 044 513 | E: [email protected]<sip:[email protected]> | 
B: azure.snagy.name<http://azure.snagy.name/>
[cid:[email protected]]

P Please consider your environmental responsibility before printing this e-mail.


From: [email protected] [mailto:[email protected]] On 
Behalf Of Winston Pang
Sent: Wednesday, 3 November 2010 6:03 PM
To: ozDotNet; ozWPF
Subject: MVVM in a navigational paradigm

Hey guys,

I'm trying to apply MVVM in the WPF navigation model.

I was just doing some thoughts around it

Apart from the rule that the view model shouldn't know about the view, how 
would a particular view spawn another view, and push it to the navigation 
service for example? I've been playing around with some ideas of holding a 
mapping between the View and ViewModel in a global list in App. Then have App 
register against the messenger/mediator to respond to any other view model's 
wanting to spawn a new view and navigating it to it. I'm not sure if I'm on the 
right track.

Would love to see how some other people have done it on here?


Thanks.


--Winston

<<inline: image001.png>>

_______________________________________________
ozwpf mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf

Reply via email to