How to open a new window using MVVM Light Toolkit

后端 未结 6 901
青春惊慌失措
青春惊慌失措 2020-11-27 11:50

I am using MVVM Light toolkit in my WPF application. I would like to know what is the best approach for opening a new window from an existing window. I have got this M

6条回答
  •  醉酒成梦
    2020-11-27 12:28

    Unless I am missing the point here - if I were to use the code behind, then why not directly implement button_click event and open the second view?

    What Bugnion seems to be suggesting is view1 -> button click -> relay command -> viewmodel1 -> message -> view1 -> view1.cs -> open view 2.

    You are going to sacrifice testability anyhow by writing code-behind, so why take such a long route?

提交回复
热议问题