public void UpdateControlPosition(IQGControl child)
        {
            if (!this.ChildControls.Contains(child))
            {
                throw new Exception("Cannot update control position: control is not a child of the calling layer.");
            }

            Point wpfControlPoint = ((IQGLayer)this).GetRenderingCoordinatesOf(child.Position);

            foreach (WPFElementInfo elementInfo in child.WPFElementInfoEnumeration)
            {
                Point wpfRenderPoint = wpfControlPoint + child.GetAlignmentOffset(elementInfo.Size) + elementInfo.PositionOffset;
                Rect  wpfDimensions  = new Rect(wpfRenderPoint, elementInfo.Size);

                if (!Double.IsFinite(elementInfo.Size.Width) || !Double.IsFinite(elementInfo.Size.Height))
                {
                    break;
                }

                elementInfo.UIElement.Arrange(wpfDimensions);
            }
        }
Exemple #2
0
 public static double GetBottomEdge(this IQGControl control)
 {
     return(control.Y + (control.RenderSize.Height + control.GetAlignmentOffset().Y));
 }
Exemple #3
0
 public static double GetRightEdge(this IQGControl control)
 {
     return(control.X + (control.RenderSize.Width + control.GetAlignmentOffset().X));
 }