Using MVVM, what if the control does not have the “Command” property?

In my program, I need a way to click on the Image control, the program takes the X, Y position where it was clicked, and then creates a rectangle around this position. My problem is that I use MVVM, so all my code is in a separate file (ViewModel file, not a code file). An Image control does not have a Command property, and what is the best way to implement it?

+5
source share
2 answers

There are several options:

  • . , MVVM - , . , ViewModel "" , MVVM.
  • , , Blend Trigger, . , ( MVVM).

, , . , , . ViewModel , , .

ViewModel ( ). "" .

+9

@Reed. , . . . , , "". ViewModel .

" MVVM, , " Command "? - , , , , - Button.Controltemplate . , Command.

+3

All Articles