When I put this code Thread.Sleep(2000); it gives me the error:
The name 'Thread' does not exist in the current context`.
I already included the namespace using System.Threading;. See System.Threading.Thread.Sleep() on MSDN.
I'm guessing it's a Portable Class Library or Windows Store/Phone project targeting the Windows Runtime that doesn't have such a construct.
An alternative and recommended way would be to use:
await Task.Delay(TimeSpan.FromSeconds(2));
or for a blocking call in case it's not in an async context:
Task.Delay(TimeSpan.FromSeconds(2)).Wait();
A similar problem is also presented in this post.
Try using the full namespace in your code:
System.Threading.Thread.Sleep(1000);