Skip to content

Instantly share code, notes, and snippets.

@JakeGinnivan
Created July 22, 2011 02:49
Show Gist options
  • Save JakeGinnivan/1098788 to your computer and use it in GitHub Desktop.
Save JakeGinnivan/1098788 to your computer and use it in GitHub Desktop.
public partial class App
{
private void Application_Startup(object sender, StartupEventArgs e)
{
var containerBuilder = new ContainerBuilder();
containerBuilder
.RegisterAssemblyTypes(typeof (App).Assembly)
.AssignableTo<Window>()
.AsSelf()
.OnActivating(ae =>
{
var instance = (Window) ae.Instance;
instance.DataContext = ae.Context.Resolve<IViewModelFactory>().Create(instance);
});
var container = containerBuilder.Build();
container.Resolve<IUIService>().ShowDialog(container.Resolve<MainView>());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment