Howdy,
I use MVVM architecture to decouple my application. That is, you often see something like
var u = new UserControl();
u.Content = new MyCustomType(); // MyCustomType is not a control
The UI is defined via data templates that reside in resource dictionaries in their own XAML files
<ResourceDictionary ...>
<DataTemplate DataType="{x:Type local:MyCustomType}">
...
I load the resources at application startup and the application is happy to display my UI. But if I remove a data template and add a new one (same key, same data type) the UI still uses the old data template. Of course I can re-set the content of my container to force a refresh but this seems goofy because I have to notify every control about a change, like this
var tmp = control.Content;
control.Content = null;
control.Content = tmp; // New data template will be used
Any other approaches? Thanks!