protected override VisualGroup CreateVisual(IRenderContext context, IStripe stripe) { IRectangle layout = stripe.Layout.ToRectD(); GeneralPath outline = CreatePath(stripe, layout); var visual = outline.CreatePath(StripeDescriptor.BackgroundBrush, new Pen(StripeDescriptor.BorderBrush, StripeDescriptor.BorderThickness.Left), null, FillMode.Always); var cc = new VisualGroup(); cc.Add(visual); cc.SetCanvasArrangeRect(layout.ToRectD()); return(cc); }
protected override VisualGroup UpdateVisual(IRenderContext context, VisualGroup oldVisual, IStripe stripe) { IRectangle layout = stripe.Layout.ToRectD(); var rect = CanvasControl.GetCanvasControlArrangeRect(oldVisual); var arrangeRect = layout.ToRectD(); if (rect.Width != arrangeRect.Width || rect.Height != arrangeRect.Height) { GeneralPath outline = CreatePath(stripe, layout); var oldPath = (Path)oldVisual.Children[0]; outline.UpdatePath(oldPath, StripeDescriptor.BackgroundBrush, new Pen(StripeDescriptor.BorderBrush, StripeDescriptor.BorderThickness.Left), null, FillMode.Always); } oldVisual.SetCanvasArrangeRect(arrangeRect); return(oldVisual); }
public void Reshape(IRectangle newRectangle) { tightRect = newRectangle.ToRectD(); rectangle.Reshape(tightRect.GetEnlarged(Margins)); invalid = false; }