Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kellabyte/1524408 to your computer and use it in GitHub Desktop.
Save kellabyte/1524408 to your computer and use it in GitHub Desktop.
private void InitApplicationHost()
{
var container = ApplicationHost.Current.Container;
db = new Database();
container.Register<IEventAggregator>(new EventAggregator());
container.Register<IDatabase>(db);
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>()));
container.Register<NavigationManager>(c => new NavigationManager(
c.Resolve<IEventAggregator>()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment