WindowlessInvalidate() public method

public WindowlessInvalidate ( ) : void
return void
        public virtual void Measure(Size bounds)
        {
            myNeedsMeasure = false;

            // cap a control's dimensions if desired
            bounds.Width  = Math.Min(bounds.Width, myMaxWidth);
            bounds.Height = Math.Min(bounds.Height, myMaxHeight);

            Size newBounds = bounds;

            if (bounds.Width != Int32.MaxValue)
            {
                newBounds.Width = bounds.Width - myMargin.Value.Left - myMargin.Value.Right;
            }
            if (bounds.Height != Int32.MaxValue)
            {
                newBounds.Height = bounds.Height - myMargin.Value.Top - myMargin.Value.Bottom;
            }

            bool boundsChange = myLastMeasureBounds != newBounds;

            myLastMeasureBounds = newBounds;

            if (MeasureUnpadded(newBounds, boundsChange))
            {
                WindowlessControlHost.WindowlessInvalidate(this);
            }
        }
Beispiel #2
0
        void WindowlessInvalidate(Rectangle rect)
        {
            PrepareDirtyRegion();
            myDirtyRegion.Union(rect);
            Invalidate(rect);

            // tell all child controls that are transparent and in this rect that they need to repaint
            foreach (Control control in Controls)
            {
                WindowlessControlHost wc = control as WindowlessControlHost;
                if (wc == null || wc.BackColor != Color.Transparent)
                {
                    continue;
                }
                Rectangle intersect = new Rectangle(wc.Left, wc.Top, wc.Width, wc.Height);
                intersect.Intersect(rect);
                if (intersect.Width == 0 || intersect.Height == 0)
                {
                    continue;
                }
                intersect.X -= wc.Left;
                intersect.Y -= wc.Top;
                wc.WindowlessInvalidate(intersect);
            }
        }
 void RectangleWidthChanged(object sender, DependencyPropertyEventArgs e)
 {
     myPen.Width = (float)myRectangleWidth.Value;
     if (!myFilled.Value)
     {
         WindowlessControlHost.WindowlessInvalidate(this);
     }
 }
 void BottomRightColorChanged(object sender, DependencyPropertyEventArgs e)
 {
     myVertices[1].Red   = (ushort)(myBottomRightColor.Value.R << 8);
     myVertices[1].Green = (ushort)(myBottomRightColor.Value.G << 8);
     myVertices[1].Blue  = (ushort)(myBottomRightColor.Value.B << 8);
     myVertices[1].Alpha = (ushort)(myBottomRightColor.Value.A << 8);
     WindowlessControlHost.WindowlessInvalidate(this);
 }
Beispiel #5
0
        public static void WindowlessInvalidate(IWindowlessControl sender)
        {
            Point origin = Point.Empty;
            IWindowlessControl parent = sender;

            while (!(parent is WindowlessControlHost) && parent != null)
            {
                origin.X += parent.Left;
                origin.Y += parent.Top;
                parent    = parent.Parent;
            }
            WindowlessControlHost host = parent as WindowlessControlHost;

            if (host != null)
            {
                host.WindowlessInvalidate(new Rectangle(origin.X, origin.Y, sender.Width, sender.Height));
            }
        }
        void BitmapChanged(object sender, DependencyPropertyEventArgs e)
        {
            PlatformBitmap oldBitmap    = e.OldValue as PlatformBitmap;
            PlatformBitmap newBitmap    = e.NewValue as PlatformBitmap;
            Size           originalSize = Size.Empty;

            if (oldBitmap != null)
            {
                originalSize = new Size(oldBitmap.Width, oldBitmap.Height);
            }
            Size newSize = Size.Empty;

            if (newBitmap != null)
            {
                newSize = new Size(newBitmap.Width, newBitmap.Height);
            }
            if (originalSize != newSize)
            {
                Remeasure();
            }
            WindowlessControlHost.WindowlessInvalidate(this);
        }
Beispiel #7
0
 void ForeColorChanged(object sender, DependencyPropertyEventArgs e)
 {
     myForeBrush.Color = ForeColor;
     WindowlessControlHost.WindowlessInvalidate(this);
 }
Beispiel #8
0
 protected virtual void FontChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
     Remeasure();
     WindowlessControlHost.WindowlessInvalidate(this);
 }
Beispiel #9
0
 void VerticalTextAlignmentChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
 }
Beispiel #10
0
 void MultilineChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
 }
Beispiel #11
0
 void AutoEllipsisChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
 }
 void MarginChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
     Remeasure();
 }
Beispiel #13
0
 void ClipToBoundsChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
 }
Beispiel #14
0
 void PaintChildrenChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
 }
 void GradientDirectionChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
 }