コード例 #1
0
        void RaisePaint()
        {
            var args = new InvalidateDrawingEventArgs();

            args.Width  = ActualWidth;
            args.Height = ActualHeight;
            InvalidateDrawing?.Invoke(this, args);
        }
コード例 #2
0
        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);
            }
        }