(Please take each of controls stated below as control created using MVVM pattern)
So, I have a UserControl which I place on my MainWindow. I want my UserControl, if clicked (in the MainWindow, inside the UserControl), the background changed into another color, and if I click in the MainWindow, but outside of UserControl, then the UserControl's background will change to the original color.
What I've tried :
- I've tried to apply a Command inside the
UserControl.InputBindingswhich to detect Mouse Input (MouseBinding), but the onlyMouseBindingraised is theMouseBindingin theWindow.InputBindings(which should be raised ONLY when the click input is outside theUserControl), but apparently, wherever a click happen, the onlyMouseBindingraised is only the one inWindow.InputBindings. - Differ the
CommandParameterbetweenMouseBindinginWindow.InputBindingsandUserControl.InputBindings.
Question :
- How to differ the
MouseBindingbetween clicking inside theUserControland outside?
Thanks