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

后端 未结 8 1595
醉梦人生
醉梦人生 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:00

    Off course this is possible. You can create just another level of abstraction. Add you own IMyCommand interface similar or same as ICommand and use that.

    Take a look at my current MVVM solution that solves most of the issues you mentioned yet its completely abstracted from platform specific things and can be reused. Also i used no code-behind only binding with DelegateCommands that implement ICommand. Dialog is basically a View - a separate control that has its own ViewModel and it is shown from the ViewModel of the main screen but triggered from the UI via DelagateCommand binding.

    See full Silverlight 4 solution here Modal dialogs with MVVM and Silverlight 4

提交回复
热议问题