Is there a way to get the current rendered location of a WPF control its window after all of the current RenderTransform
s have been applied? I may just be blind, but I'm not seeing an obvious method.
I guess I should have kept poking before asking ... but instead of deleting maybe this will help someone later.
The trick is to transform the point (0,0) from the control's axes to the axes of the window, so...
Point renderedLocation = theControl.TranslatePoint(new Point(0,0), theWindow);
If you need an interior point on the control it works similar, just use that local point instead of (0,0).
Don't try basing it off of Margin
or Padding
, it doesn't come out correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With