예제 #1
0
 private static Rect GetRectFromRoot(UIElement root)
 {
     return new Rect(
         root.PointToScreen(new Point()),
         root.PointToScreen(new Point(root.RenderSize.Width, root.RenderSize.Height))
         );
 }
예제 #2
0
 internal static Point ToScreen(this Point self, UIElement element)
 {
     return element.PointToScreen(self);
 }
예제 #3
0
 internal static Rect ToScreen(this Rect rect, UIElement element)
 {
     var topLeft = element.PointToScreen(rect.TopLeft);
     var bottomRight = element.PointToScreen(rect.BottomRight);
     return new Rect(topLeft, bottomRight);
 }