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
There are a couple of simple ways to just bind a ViewModel to a view. As Elad mentioned you can add it in the code-behind:
_vm = new MarketIndexVM();
this.DataContext = _vm;
or, you can specify the ViewModel as a resource in your XAML of your view:
and bind the DataContext of your LayoutRoot to that resource: