How to achieve smooth UI updates every 16 ms?

前端 未结 3 440
滥情空心
滥情空心 2021-01-12 11:39

I am trying to create sort of a radar. Radar is VisualCollection that consists of 360 DrawingVisual\'s (which represent radar beams). Radar is placed on Viewbox.

<         


        
3条回答
  •  情话喂你
    2021-01-12 12:25

    while (Environment.TickCount - beginTime < delay) { }
            delay += deltaDelay;
    

    The sequence above blocks the thread. Use instead "await Task.Delay(...)" which doesn't block the thread like its counterpart Thread.Sleep(...).

提交回复
热议问题