How can one be notified as to when a UIElement has been moved (eg: when a Panel has reArranged its child elements, or an Animation is moving them around)?
So far I've investigated the following dead ends: a) the LayoutUpdated event: works when the Panel moves things around -- but doesn't fire when Animations are applied to the position of a child event.
b) Binding: I've created a DP (called ProxyLeft) with a callback, and Bound it the value of the Canvas.Left DP of a child element.
This does work (in that all changes to the Canvas.Left of the child element, whether by end user or applied Animation, are picked up). But Binding to Canvas.Left is not 'hollistic enough': It would only work if the Panel is a Canvas, but is of no use if the Panel were a StackPanel (StackPanel's don't use Canvas.Left to determine position of element (the layout is updated when the panel size changes and/or prior siblings added or updated in size, etc.). I guess what I'm looking for is a Binding on the Rect of the child element...but that doesn't exists.
At present, i don't see a way of doing it, unless I am the creator of the Panel (CustomPanel) and can be involved with the layout mechanism and at that moment update an AttachedProperty of the child element (eg: CustomPanel.Rect) at that moment...and even that won't work -- as it won't be updated by animations applied to the child element.
Can one be notified when an element has moved? If so, how?
Thanks ever so much.