The problem seems to be that the window has loaded before your ViewModel has been instantiated and bound to the DataContext. The solution is to instantiate your ViewModel before your View.
var vm = new MyViewModel();
var view = new MyView();
view.DataContext = vm;
view.Show();
Don't use a framework that instantiates the view and then "discovers" the applicable viewmodel, at least not in this case.