Created
December 27, 2011 17:20
-
-
Save kellabyte/1524437 to your computer and use it in GitHub Desktop.
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
private void Initialize() | |
{ | |
// Create the IoC container. | |
container = new Container(); | |
// Initialize the ViewModelFactory with the Funq ViewModelResolver. | |
ViewModelFactory.InitializeResolver(new FunqViewModelResolver(container)); | |
// Register the dependency composition. | |
container.Register<IEventAggregator>(new EventAggregator()); | |
container.Register<IDatabase>(new Database()); | |
container.Register<MainViewModel>(c => new MainViewModel( | |
c.Resolve<IEventAggregator>(), | |
c.Resolve<IDatabase>())); | |
container.Register<BrowserViewModel>(c => new BrowserViewModel()); | |
container.Register<SettingsViewModel>(c => new SettingsViewModel( | |
c.Resolve<IDatabase>())); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment