ToWpfRect() public static method

public static ToWpfRect ( this rect ) : Rect
rect this
return System.Windows.Rect
Exemplo n.º 1
0
        void ArrangeChildren(bool force)
        {
            if (widgets == null || rects == null)
            {
                return;
            }

            // Use the 'widgets' field so we can easily map a control position by looking at 'rects'.
            for (int i = 0; i < widgets.Length; i++)
            {
                var element = WidgetBackend.GetFrameworkElement(widgets [i]);
                if (!element.IsArrangeValid || force)
                {
                    // Measure the widget again using the allocation constraints. This is necessary
                    // because WPF widgets my cache some measurement information based on the
                    // constraints provided in the last Measure call (which when calculating the
                    // preferred size is normally set to infinite.
                    element.InvalidateMeasure();
                    element.Measure(new SW.Size(rects[i].Width, rects[i].Height));

                    element.Arrange(DataConverter.ToWpfRect(rects[i]));
                    element.UpdateLayout();
                }
            }
        }
Exemplo n.º 2
0
 public void SetAllocation(IWidgetBackend [] widget, Rectangle [] rect)
 {
     for (int i = 0; i < widget.Length; i++)
     {
         var e = GetFrameworkElement(widget [i]);
         e.Arrange(DataConverter.ToWpfRect(rect [i]));
     }
 }
Exemplo n.º 3
0
        void ArrangeChildren(bool force)
        {
            if (widgets == null || rects == null)
            {
                return;
            }

            // Use the 'widgets' field so we can easily map a control position by looking at 'rects'.
            for (int i = 0; i < widgets.Length; i++)
            {
                var element = WidgetBackend.GetFrameworkElement(widgets [i]);
                if (!element.IsArrangeValid || force)
                {
                    element.Arrange(DataConverter.ToWpfRect(rects [i]));
                }
            }
        }