Currently, I'm building a C# library, which will be used in different WPF applications. Such a library should be tested well so I'm using MVVM and Mvvm Light in particular. MvvM Light has a simple IOC that is initialized in static cstor of the class ViewModelLocator (at least when used out of the box). When I run my library, this static cstor is called. However, when referencing the library from a different WPF project called MyProject, the initialization is not carried out. The only work-around is to have a ViewModelLocator in MyProject, but that poses an unacceptable restriction on MyProject. Is there any way to have the static cstor of ViewModelLocator in a non-startup project be fired?
This question is not new, I've found similar formulations on SO, e.g. MVVMLight within another MVVMLight project and Register viewmodel in different project from main project viewmodellocatoe in mvvmlight. However, in both cases no answer has been suggested and now I'm wondering if someone with new insight can help a hand.
Thnx