Lets say I have this bit of code:
You can do it the other way around. That is, add DataTriggers
to Image
and TextBlock
and make them trigger on IsMouseOver
for the ancestor Grid
.
Note: If you want this effect to trigger as soon as the mouse is over the Grid
you will need to set Background
to a value, like Transparent
. By default, the Background
is null
and this value isn't used in hit testing.