I'm new in WPF, and consider to try DI. I decide to take OnStartup method as Composition Root.
protected override void OnStartup(StartupEventArgs e)
{
IUnityContainer container = new UnityContainer();
container.RegisterType<IMailSender, Model.Concrete.GmailSender>();
var mainWindow = container.Resolve<MainWindow>();
mainWindow.Show();
}
But, after the application is started, appears two windows, normal, with my content, and totally empty (seems like not initialized). What is wrong?