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