Even in the world of .NET, some things never change.
You block your UI thread with a Sleep(10000) and wonder why it's not painting properly?
Patient: "It hurts when I do this"
Physiotherapist: "Well don't do it then"
Do not block your UI thread in a non-UI friendly way.