I often run into problems with null exceptions in code because the WPF controls I refer to don't exist yet.

Is there a way to idle code until WPF has finished rendering?