// -------------------------------------------------------------------------------------------------------------------- // (c) Copyright Microsoft Corporation. // This source is subject to the Microsoft Public License (Ms-PL). // Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details. // All other rights reserved. // -------------------------------------------------------------------------------------------------------------------- namespace ClearStyle { using System; using System.Linq; using System.Windows; using System.Windows.Input; public static class UIElementExtensions { /// <summary> /// Gets the relative position of the given UIElement to this. /// </summary> public static Point GetRelativePosition(this UIElement element, UIElement other) { return element.TransformToVisual(other) .Transform(new Point(0, 0)); } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)