In my application, I bind Views to ViewModels via a central ResourceDictionary in my App.xaml, like this:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="_styles/SomeStyle.xaml" />
...
<ResourceDictionary>
<DataTemplate DataType="{x:Type viewModels:MyViewModel}">
<views:MyView />
</DataTemplate>
...
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
This works fine. However, the IDE (both Visual Studio with ReSharper and Rider) doesn't recognize the bindings in the views, so e.g. renaming properties is dangerous.
How can I make the IDE recognize the bindings?
Add to your window or user control. For using IsDesignTimeCreatable=True you have to have parameterless constructor.
d:DataContext="{d:DesignInstance Type=local:YourVm, IsDesignTimeCreatable=True}"