how to make DispatcherTimer events smoother in WPF?

Published on Author Code Father

Set a priority. The default is Background, that might explain the stuttering you see. I think Render is the level you want but do experiment.

DispatcherTimer timer = new DispatcherTimer(DispatcherPriority.Render);

If that isn’t smooth enough you could try setting it up as an Animation.



Categories C#