I've adopted what Josh Smith does in his article on MSDN here... Scroll down to the part were he talks about applying a View to a ViewModel. In doing this, the View is created when the ViewModel is rendered. There is no need to manually create the view and then assign the DataContext to your ViewModel anymore. This does that automatically for you.
"You can easily tell WPF how to render a ViewModel object by using typed DataTemplates. A typed DataTemplate does not have an x:Key value assigned to it, but it does have its DataType property set to an instance of the Type class. If WPF tries to render one of your ViewModel objects, it will check to see if the resource system has a typed DataTemplate in scope whose DataType is the same as (or a base class of) the type of your ViewModel object. If it finds one, it uses that template to render the ViewModel object referenced by the tab item's Content property."
In other words, you would create your ViewModel like so:
MyViewModel viewModel = new MyViewModel();
// Add the view model to the content of some control (TabItem, Grid, Window, etc.)
// NOTE: You wouldn't actually make this call... instead you would add the
// ViewModel to a collection or a property and the parent would bind
// to it and display it properly
MyContainer.Content = viewModel;
And in your ResourceDictionary you would define this:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:DemoApp.ViewModel"
xmlns:vw="clr-namespace:DemoApp.View"
>
<!-- NOTE: The View must be a UserControl (or page) -->
<DataTemplate DataType="{x:Type vm:MyViewModel}">
<vw:MyView />
</DataTemplate>
</ResourceDictionary>