Is is possible to fire event when a UIElement
's location is changed in wpf? We can fire location changed event in case of Windows but can we have a custom event which fires when a UIElement
's location is changed in the Window.
Asked
Active
Viewed 527 times
1

Dave Clemmer
- 3,741
- 12
- 49
- 72

Aksel
- 53
- 3
2 Answers
0
Maybe this link will help you, UIElement
supports a lot of Events. I think what you are looking for are Manipulation Events or the LayoutUpdate
Event.

andreikashin
- 1,528
- 3
- 14
- 21

BigL
- 1,631
- 1
- 11
- 10
0
It's not possible for the general case. The UIElement
doesn't even know the location it's rendered to.
You can do it for particular cases, though. You can use events of the layout parent, like the Left
and Top
attached property of the Canvas
, the scroll offset of a ScrollViewer
, etc., depending on where your UIElement
is in the visual tree.

Dave Clemmer
- 3,741
- 12
- 49
- 72

Csaba Fabian
- 846
- 9
- 19