5

I have to update multiple child controls in a WPF control. I don't want the control redrawn until I have updated all its child controls.

Jader Dias
  • 88,211
  • 155
  • 421
  • 625

1 Answers1

3

If you are making all these updates on the UI thread (which is typically the case), then the WPF framework will do exactly what you desire!

To test it out, create an infinite loop that continually updates your control and child controls. The UI will freeze up as a result.

ColinE
  • 68,894
  • 15
  • 164
  • 232
  • So they typically wait for an interval without changes to redraw the controls? – Jader Dias Jan 20 '11 at 22:33
  • 2
    Sort of ... a thread can only do one thing at a time. You are updating the state of your controls on the same thread that re-renders them. – ColinE Jan 20 '11 at 22:39
  • I tested your answer with a buttonClick event, and with a Timer callback, and I confirmed it in both cases – Jader Dias Jan 21 '11 at 11:22