Message Based Navigation for WP7 MVVM Apps
- Posted: Apr 26, 2011 at 6:00 AM
- 1,965 Views
- 2 Comments
Download
How do I download the videos?
- To download, right click the file type you would like and pick “Save target as…” or “Save link as…”
Why should I download videos from Channel9?
- It's an easy way to save the videos you like locally.
- You can save the videos in order to watch them offline.
- If all you want is to hear the audio, you can download the MP3!
Which version should I choose?
- If you want to view the video on your PC, Xbox or Media Center, download the High Quality WMV file (this is the highest quality version we have available).
- If you'd like a lower bitrate version, to reduce the download time or cost, then choose the Medium Quality WMV file.
- If you have a Zune, WP7, iPhone, iPad, or iPod device, choose the low or medium MP4 file.
- If you just want to hear the audio of the video, choose the MP3 file.
Right click “Save as…”
- High Quality WMV (PC, Xbox, MCE)
- MP3 (Audio only)
- Mid Quality WMV (Lo-band, Mobile)
- High Quality MP4 (iPad, PC)
- MP4 (iPod, Zune HD)
Do you have an MVVM-based Windows Phone 7 application and you don't like having to hook into the RootFrame to navigate between pages? Do you wish you could just "ask" to navigate to a new view from your view model? One possible solution can be found in this screencast.
Using an message bus to process navigation messages, view models can publish messages that are then handled by a separate navigation service, successfully decoupling your view model from the Windows Phone navigation service.
Get the finished source code here
Comments Closed
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
That seems like an awful lot of code and xaml spread out.
I solve this problem by having my VMs depend upon a IMyAppNavigationService that has methods such as
void NavigateToPersonView(string id);
That way all the URIs and navigation logic is in one class, the MyAppNavigationService. Even though message buses are cool I don't see the benefit here.
/Linus
I like to wire up XAML as much as I can. I don't think it is all that much code really... the MessageBus and NavigationHandler (which is the same thing as your IMyAppNavigationService) are very small. I replace the dependency you have on the nav service with a dependency on the message bus, which provides me additional capabilities. Too each there own... whatever works for the apps you build. Just thought it was an interesting alternative.
Remove this comment
Remove this thread
close