How do you trigger a redraw of a GraphicsView?
Short answer
Call Invalidate() on the GraphicsView to request that Draw runs again. Do this whenever the data your drawable depends on changes. For animation, invalidate on a timer or from an animation callback, keeping the Draw method fast to sustain frame rate.
Advertisement
AModel answer
Call Invalidate() on the GraphicsView to request that Draw runs again. Do this whenever the data your drawable depends on changes. For animation, invalidate on a timer or from an animation callback, keeping the Draw method fast to sustain frame rate.
graphicsView.Drawable = _drawable;
_drawable.Progress = 0.75f;
graphicsView.Invalidate(); // schedules a repaintReal-world example
A progress gauge repaints smoothly by updating its value and calling Invalidate as a download advances.
Likely follow-ups
- Why keep Draw fast? | How do you animate a GraphicsView?
Related topics