Last active
June 19, 2017 07:55
-
-
Save oschwab/7a92c987da6e2d02b54ba004c5764319 to your computer and use it in GitHub Desktop.
Caliburn Micro : injection in ViewModel problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AppBootstrapper : BootstrapperBase { | |
... | |
protected override void Configure() { | |
container = new SimpleContainer(); | |
container.Instance(container); | |
container.Singleton<IWindowManager, WindowManager>(); | |
container.Singleton<IEventAggregator, EventAggregator>(); | |
container.PerRequest<ShellViewModel>(); | |
container.PerRequest<IRepository<Worklist>, DBRepository<Worklist>>() | |
... | |
} | |
} | |
public class WorklistViewModel : Screen { | |
... | |
public WorklistViewModel(IRepository<Worklist> worklistRepository) | |
{ | |
... | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment