0

I'm working on a windows WPF application using MVVM Light. As far as for switching views and navigation purposes, is there set classes readily available? Right now, I'm using a MainViewController to load other views with datatemplate and messenger class. But i'm not sure if its the best practice.

my779
  • 59
  • 6
  • Why not use the MvvmLight Messenger for that? – Sir Rufo Jul 15 '15 at 19:20
  • how will the messenger be used? just to trigger calls and load the right controller in the main controller? – my779 Jul 15 '15 at 20:00
  • @my779 you seem to be on the right track. messenger also allows calls to be "directed" because of the subscription/broadcast concept. An answer with some actual code can be found: http://stackoverflow.com/a/26266708/3109213 – Stunna Jul 15 '15 at 20:32
  • try to implement the Navigation Service to suit your needs, take a look here http://stackoverflow.com/questions/28966819/mvvm-light-5-0-how-to-use-the-navigation-service/28968560#28968560 – SamTh3D3v Jul 15 '15 at 20:58
  • possible duplicate of [WPF MVVM navigate views](http://stackoverflow.com/questions/19654295/wpf-mvvm-navigate-views) – goobering Jul 15 '15 at 22:31

1 Answers1

0

Meant for switching is ContentControl but it has nothing to do with MVVM Light. Based on its Content you can assign diffrent Views. Take a look here.

Maximus
  • 3,458
  • 3
  • 16
  • 27
  • what if the sub view controllers has their own sub views? Such as a detail view from one of the view controllers. Will the MVVM light messenger framework be needed to trigger the change in the content control? – my779 Jul 15 '15 at 19:59
  • Presumably yes but you would have to paste some code to find out. – Maximus Jul 15 '15 at 20:06