Exemple #1
0
 public static Rect TranslateToParent(this Rect rect, FrameworkElement child, FrameworkElement parent)
 {
     foreach (FrameworkElement element in Enumerable.OfType <FrameworkElement>((IEnumerable)VisualTreeExtensions.GetVisualAncestors((DependencyObject)child)))
     {
         if (element != parent)
         {
             Rect layoutSlot = LayoutInformation.GetLayoutSlot(element);
             rect = RectExtensions.Translate(rect, layoutSlot.X, layoutSlot.Y);
         }
         else
         {
             break;
         }
     }
     return(rect);
 }
Exemple #2
0
 public static Rect Expand(this Rect rectangle, Size size)
 {
     return(RectExtensions.Expand(rectangle, size.Width, size.Height));
 }
Exemple #3
0
 public static Rect Translate(this Rect rectangle, Point point)
 {
     return(RectExtensions.Translate(rectangle, point.X, point.Y));
 }
Exemple #4
0
 public static Rect InflateRect(Rect rect, double x, double y)
 {
     RectExtensions.Expand(rect, x, y);
     return(rect);
 }
Exemple #5
0
 private Rect TransformRect(Size size)
 {
     return(RectExtensions.Transform(new Rect(0.0, 0.0, size.Width, size.Height), (Transform)this._rotateTransform));
 }