I'm trying to port a Windows Forms application to WPF (VS 2010 / .NET 4), and trying to follow the MVVM methodology. Unfortunately, most of the "buttons" in the legacy UI were done w/ images (PictureBoxes) to more closely match the actual hardware that we're simulating. As a result, I'm trying to figure out the best approach to modeling buttons as clickable images so that they can issue an ICommand? A couple of sub-requirements I have are:
The image needs to change when pressed (i.e. show the button down)
In some cases the value tied to the button needs to keep changing as long as the button is down. So I need to know not only when the button is pressed, but also when it is released.
I've seen some posts saying to use a button or hyperlink w/ an image and change the styling in order to get the command. If this is the best way, how can I incorporate the sub-requirements?
Any advice on best practices here would be appreciated.