Hi
I have a more theoretical than a "hands on" question regarding the "design-time" data for WPF applicatons which use the MVVM pattern.
Lately I use two kinds of view-models in my applications. The "runtime" view-models which are used at runtime and "design-time" view-models which are used at design-time(when the designer is designing the views in expression blend). Everything I read about this topic suggests that the design-time view-models should be located in a different assembly so you don't have to ship them with the application. And therein lies my problem. Let's say I have two assemblies: Assembly XYZ.ViewModel(containing the runtime view-models) and XYZ.Design(containing the design-time view models). Since I oftenly use IOC containers both the design-time and runtime view-model for the same view must implement some shared interface. So in which assembly should I put the interfaces? If I put them in the XYZ.Design assembly than the XYZ.ViewModel must reference that assembly and I have to ship it with the appliation. I tried to put the interfaces in the XYZ.ViewModel assembly but that would create circual dependency becouse the XYZ.ViewModel assembly must reference the XYZ.Design assembly for the design-time view-models and the XYZ.Design assembly has to reference the XYZ.ViewModel assembly becouse of the interfaces.
The only solution to this problem seems to be to create the third assembly XYZ.Interfaces and put all the interfaces in that assembly. This approach works If I use the IoC container to assign the design-time view-model to the view or if I use the following expression in the view.
d:DataContext{d:DesignInstance, Type=design:SomeType, IsDesignTimeCreateble=True}
But it seems to me that creating a separate assembly just to contain the view-model interfaces is to much. If you have multiple aseemblies containing view-models(let's say for different applicaton moduls) than you end up with three assemblies for each one.
So my question is: Has anybody found a better or different approach to deal with this problem? Any thoughts on the subject will be appreciated.
Uroš