Navigate through UserControl with MVVM LIGHT (WPF) RRS feed

  • Question

  • First of all I apologize for my poor english which is not my first language.

    I'm new in MVVM so my question is probably a very newbie one ;)

    I'm encountering some issue with switching View in a C# Application using WPF and MVVM LIGHT. I've read a lot of articles but i still can't figured out how to do it in a clean way.

    So here is my question: What is the best way to achieve the navigation between UserControl contained in a MainWindows, assuming that:

    • I've a ViewModel for each UserControl and one for the Main Windows.
    • The buttons for switching between usercontrols are contained into UserControl itself
    • I've a ViewModelLocator
    • I need to sometimes Destroy/re-create a userControl's ViewModel
    • I want to respect the MVVM Pattern.
    • I want to keep it simple

    Some example code will be appreciate.


    Sushil Bhat


    • Edited by sushilbhat Monday, December 2, 2019 5:24 AM
    Monday, December 2, 2019 5:23 AM

All replies

  • Hi,

    I found the same question on stockoverflow, this is also your question?


    Best Regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, December 3, 2019 5:49 AM
  • Its exactly the same thing i wanted to do, but that link didn't help.
    Wednesday, December 4, 2019 7:17 AM