Implementing MVVM in WPF without using System.Windows.Input.ICommand

后端 未结 8 1605
醉梦人生
醉梦人生 2021-02-06 04:43

I\'m trying to implement a WPF application using MVVM (Model-View-ViewModel) pattern and I\'d like to have the View part in a separate assembly (an EXE) from the Model and ViewM

8条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-06 05:24

    Instead of the VM exposing commands, just expose methods. Then use attached behaviors to bind events to the methods, or if you need a command, use an ICommand that can delegate to these methods and create the command through attached behaviors.

提交回复
热议问题