Utilities.cs
 1  // Copyright (c) Microsoft Corporation
 2  // The Microsoft Corporation licenses this file to you under the MIT license.
 3  // See the LICENSE file in the project root for more information.
 4  
 5  using System.Windows;
 6  using System.Windows.Media;
 7  
 8  namespace FancyZone_HitTest
 9  {
10      public static class Utilities
11      {
12          public static Point GetPosition(Visual element, Visual root)
13          {
14              var positionTransform = element.TransformToAncestor(root);
15              var areaPosition = positionTransform.Transform(new Point(0, 0));
16  
17              return areaPosition;
18          }
19      }
20  }