How have you successfully implemented MessageBox.Show() functionality in MVVM?

后端 未结 12 1531
清歌不尽
清歌不尽 2020-11-28 05:55

I\'ve got a WPF application which calls MessageBox.Show() way back in the ViewModel (to check if the user really wants to delete). This actually works

12条回答
  •  野性不改
    2020-11-28 06:35

    What about raising an Event like "MessageBoxRequested" handled in the codebehind of the View (anyway it's View only code so I don't see any problem with having this code on the codebehind).

提交回复
热议问题