protected override void OnRender(DrawingContext drawingContext) { var width = LayoutRoot.ActualWidth; var height = LayoutRoot.ActualHeight; var availableSize = new Size(width, height); layout.Measure(availableSize); layout.Arrange(new Rect(Point.Zero, availableSize)); layout.Render(new WpfDrawingContext(drawingContext)); }
protected override void OnRender(DrawingContext drawingContext) { if (Exception != null) { RenderException(Exception, drawingContext); } if (Layout == null) { return; } var width = ActualWidth; var height = ActualHeight; var availableSize = new Size(width, height); Layout.Measure(availableSize); Layout.Arrange(new Rect(Point.Zero, availableSize)); Layout.Render(new WpfDrawingContext(drawingContext)); }