Click or drag to resize
CanvasControlInvalidate Method
Indicates that the contents of the CanvasControl need to be redrawn. Calling Invalidate results in the Draw event being raised shortly afterward.

Namespace:  Microsoft.Graphics.Canvas.UI.Xaml
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version:
public void Invalidate()

Normally, the contents of a CanvasControl are drawn only once when it first becomes visible. If you want to change those contents, call Invalidate to tell the control it must redraw itself.

This is a lightweight method, so it is reasonable to call it many times in rapid succession. High frequency calls to Invalidate will be merged, with the control only actually redrawing at a maximum of the display refresh rate. It will not redraw once for every Invalidate call if these are happening faster than the display can keep up.

If you want to animate the contents of a CanvasControl, you should use CanvasAnimatedControl instead. CanvasAnimatedControl raises the Draw event on a configurable interval; by default this is 60 times per second.

If you find that you want to Invalidate only a region of the control, maybe because the control is very large or it takes too long to draw the entire control, then you should consider using CanvasVirtualControl instead.

See Also