You are probably not seeing the results because you're not waiting for InitializeContents
to complete. Follow the Task-based Asynchronous Pattern (TAP); I also have an async
intro on my blog you may find helpful.
If my speculation is correct, then you can fix the code by making InitializeContents
return Task
instead of void
(and also rename it to follow the TAP naming convention: InitializeContentsAsync
), and have the calling code await
the Task
that is returned from InitializeContentsAsync
.