Oct 13, 2009 at 8:59 PM
Edited Oct 13, 2009 at 9:45 PM
Whilst building my first Composite WPF application I came across the following issue and although I have a wayaround the problem I am not sure if my assumptions are correct.
I have a ListView and I wanted to data bind to fire a Command on the MouseUp event. Realizing this is not possible by default to bind a command to such an event I then simply created a method for my command on the PresenterModel
class and Hooked up a standard windows event on the Mouse up which then calls the PresenterModel Method in the Code Behind.
This works fine however I am not happy for the following two reasons.
1. I feel I should be using the CompositeWPF command mechanisms and I really wanted to Databind the commands
2. Usinf the MVVP patterms I try to keep the code behind as minimal as possible ( ideally nothign in this file if at all possible ).
Having searched this forum for a possible solution I came across the following implementation of a snippet which if I understand it correctly, will solve my problem but then I need to have one of these classes for each control and event type that I need
So I go from 5 lines in the code behind file and a method in the PresenterModel to needing two classes and the associated command in the Presenter Model file.
Can someone tell me if I am missing the point here or if there is an better way of addressing this issue?