WPF MVVM : Commands are easy. How to Connect View and ViewModel with RoutedEvent

后端 未结 7 421
走了就别回头了
走了就别回头了 2020-12-13 02:51

Suppose I have a view implemented as a DataTempate inside a resource Dictionary. And I have a corresponding ViewModel. Binding Commands are easy. But what if my View contain

7条回答
  •  独厮守ぢ
    2020-12-13 03:28

    Well, nobody answered. So I've gave up and moved the implementation of the View outside the Dictionary into a regular UserControl, I've injected him a reference to the ViewModel.

    Now when the ListBox fire the Event it's calls the ViewModel and from there everything is possible again.

    Ariel

提交回复
热议问题