In one of my first attempts with WPF I went a bit too far:
I have an object that needs a different DataTemplate depending on one of its properties. In other words if (object.property=="multi")
then the template should be a combo, etc.
Now I 've went ahead and obviously used a DataTemplateSelector to apply the required template. And in runtime that works. In design-time vs2008 designer complains because the DataTemplateSelector uses Application.Current.MainWindow.FindResource in order to find the appropriate template to apply and obviously Application.Current in design time is not my application, so the resource cannot be found, so the designer throws an exception.
Given that I would like other people to be able to change the templates, I really need design-time support for this.
Is there a solution to my problem? Is my whole approach completely flawed?