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

后端 未结 12 1498
清歌不尽
清歌不尽 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:37

    I've implemented a Behavior that listens to a Message from the ViewModel. It's based on Laurent Bugnion solution, but since it doesn't use code behind and is more reusable, I think it's more elegant.

    Check it out here

    Cache of the broken link

提交回复
热议问题