WindowlessInvalidate() public method

public WindowlessInvalidate ( ) : void
return void
コード例 #1
0
        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);
            }
        }
コード例 #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);
            }
        }
コード例 #3
0
 void RectangleWidthChanged(object sender, DependencyPropertyEventArgs e)
 {
     myPen.Width = (float)myRectangleWidth.Value;
     if (!myFilled.Value)
     {
         WindowlessControlHost.WindowlessInvalidate(this);
     }
 }
コード例 #4
0
 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);
 }
コード例 #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));
            }
        }
コード例 #6
0
        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);
        }
コード例 #7
0
 void ForeColorChanged(object sender, DependencyPropertyEventArgs e)
 {
     myForeBrush.Color = ForeColor;
     WindowlessControlHost.WindowlessInvalidate(this);
 }
コード例 #8
0
 protected virtual void FontChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
     Remeasure();
     WindowlessControlHost.WindowlessInvalidate(this);
 }
コード例 #9
0
 void VerticalTextAlignmentChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
 }
コード例 #10
0
 void MultilineChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
 }
コード例 #11
0
 void AutoEllipsisChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
 }
コード例 #12
0
 void MarginChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
     Remeasure();
 }
コード例 #13
0
 void ClipToBoundsChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
 }
コード例 #14
0
 void PaintChildrenChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
 }
コード例 #15
0
 void GradientDirectionChanged(object sender, DependencyPropertyEventArgs e)
 {
     WindowlessControlHost.WindowlessInvalidate(this);
 }