WPF Designer DataTemplate.DataType cannot be type object

I was able to solve this WPF Designer Bug by adding a x:Key to the DataTemplate

<ResourceDictionary>
    <DataTemplate x:Key="ThisKeySolvesDesignersNullRef" 
                  DataType="viewmodels:MyViewModel">
        <views:MyView/>
    </DataTemplate>
</ResourceDictionary> 

I had been searching for months, because it eventually appeared on different projects and sometimes appeared and disappeard without an explicit reason.
Thanks to the helping answer on SO

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)