private void HookupViewBuildup(ContainerBuilder builder)
{
IEnumerable<Type> viewTypes = Assembly.GetExecutingAssembly()
.GetTypes()
.Where(
t => t.GetInterface(typeof (IView<>).FullName) != null &&
(t.IsSubclassOf(typeof (Page)) || t.IsSubclassOf(typeof (Window))));
foreach (Type viewType in viewTypes)
{
builder.RegisterType(viewType)
.AsSelf()
.AsImplementedInterfaces()
.OnActivating(i => { BuildupView(i.Context, (DependencyObject) i.Instance); });
}
}