Changing active view using MVVM Toolkit

Jun 9, 2012 at 4:56 PM


I am using the toolkit to create a dashboard

I am currently working on the main page of the dashboard which contains a series of tiles

When the user clicks a tile, I need to take them to relevant view

Should the code for this reside in the code behind for the view, or in the dashboard's View Model?

I have created the view model but not too sure what goes in there at the moment and not sure whether to use commands or events?

Any advice would be appreciated!


Jun 28, 2012 at 8:38 AM
Edited Jun 29, 2012 at 3:21 AM

Hi Paul,

This is a bit late but to my knowledge,

  • You could use CallMethodAction to hook up to a method in Viewmodel using Event Trigger
  • The method sends message to the view using 'Notify"
  • The view listens to the event in code behind and fires a method that will create new view for that particular tile
  • The tileview has a datacontext attached to its own viewmodel that gets created when the view is created.

Please let me know if I have got it wrong. This would help me as well.