public void ValidateGeometry(Rect renderRect, CornerRadius cornerRadius)
        {
            if (this.geometry != null)
            {
                return;
            }
            this.geometry = new StreamGeometry();
            StreamGeometryContext ctx = this.geometry.Open();

            SuperRoundedRectRenderer.GenerateGeometry(ctx, renderRect, new SuperRoundedRectRenderer.Radii(cornerRadius, SuperRoundedRectRenderer.zeroThickness, false));
            ctx.Close();
            this.geometry.Freeze();
        }
예제 #2
0
        protected override void OnRender(DrawingContext drawingContext)
        {
            base.OnRender(drawingContext);
            if (this.rangeRenderer == null)
            {
                this.rangeRenderer = new SuperRoundedRectRenderer();
            }
            Thickness rangeMargin = this.RangeMargin;
            Rect      rect        = RenderUtils.CalculateInnerRect(new Rect(0.0, 0.0, this.ActualWidth, this.ActualHeight), this.BorderWidth);
            Rect      renderRect  = new Rect(new Point(rect.Left + rangeMargin.Left, rect.Top + rect.Height - rangeMargin.Bottom - this.RangeHeight), new Point(rect.Left + rect.Width - rangeMargin.Right, rect.Top + rect.Height - rangeMargin.Bottom));

            this.rangeRenderer.Render(drawingContext, renderRect, this.RangeBrush, this.RangeCornerRadius);
        }