Created
July 22, 2011 02:49
-
-
Save JakeGinnivan/1098788 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
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