Silverlight Constructor Injection into View Model + Design Mode
问题 Im trying to get to grips with writing testable ViewModels in Silverlight 4. Im currently using MVVM light. Im using AutoFac and the IoCContainer is doing its job fine. However to inject into the constructor of ViewModels, which are bound to Views I have this constructor chaining: public UserViewModel() : this(IoCContainer.Resolve<IUserServiceAsync>()) { } public UserViewModel(IUserServiceAsync userService) { if (this.IsInDesignMode) return; _userService = userService; } Which doesn't feel