void RaisePaint() { var args = new InvalidateDrawingEventArgs(); args.Width = ActualWidth; args.Height = ActualHeight; InvalidateDrawing?.Invoke(this, args); }
private void CompositionHost_InvalidateDrawing(object sender, InvalidateDrawingEventArgs e) { var width = e.Width; var height = e.Height; // Clear render target backbround windowRenderTarget.BeginDraw(); windowRenderTarget.Clear(white); windowRenderTarget.EndDraw(); // Update graph if (currentGraph != null) { var currentDpi = VisualTreeHelper.GetDpi(this); currentGraph.UpdateSize(currentDpi, width, height); } }