I am trying to figure the many different ways of setting datacontext of a view to a viewmodel.
One I\'m oggling at this moment goes something like this:
I ha
Maybe this doesn't directly answer your question, but have you looked at using an MVVM framework? For example, in Caliburn.Micro you would do (very basic example):
public class ShellViewModel : Conductor
{
public ShellViewModel()
{
var myViewModel = new MyViewModel();
this.ActivateItem(myViewModel);
}
}
ShellView.xaml
MyView.xaml
Hello world
This is a viewmodel first approach.