If in my wpf application there are multiple grids and a dragable user control.Can anyone suggest code that could return different grid id every time the control is dragged over different grids.
If in my wpf application there are multiple grids and a dragable user control.Can
Share
You can use
Mouse.DirectlyOverthen go up the visual tree to find the firstGridup the tree.Mouse.DirectlyOverreturns theIInputElementthat is under the mouse at the time you check the property.You can walk up the visual tree using a method described in this SO question
Edit: I found the SO question about visual tree walking i was thinking about. (much better than the first link IMHO).