protected override void OnRender(DrawingContext drawingContext) { base.OnRender(drawingContext); var roundedArrangeBound = LayoutHelper.RoundLayoutSize(this.arrangeBounds); drawingContext.DrawSnappedRectangle(new Rect(0, 0, roundedArrangeBound.Width, roundedArrangeBound.Height), pen, Background); //if (formattedText == null) //{ // formattedText = new FormattedText(text, // culture, // this.FlowDirection, // segoeTypeface, // 13, // Brushes.Black, // dpiScale.PixelsPerDip); //} //drawingContext.DrawText(formattedText, new Point(0, 0)); //if (glyphRun == null) //{ // glyphRun = CreateGlyphRun(text, 13, new Point(0, 0), dpiScale.PixelsPerDip); //} //drawingContext.DrawGlyphRun(borderBrush, glyphRun); }
protected override void OnRender(DrawingContext drawingContext) { drawingContext.DrawSnappedRectangle(new Rect(0, 0, ActualWidth, ActualHeight), linePen, Background); }