예제 #1
0
 public static IPlatformViewActivator RegisterAssemblyViews(this IPlatformViewActivator activator, System.Reflection.Assembly assembly)
 {
     foreach (var viewTypeDefinition in assembly.ExportedTypes
              .Select(type => Tuple.Create(type, type.GetTypeInfo().GetCustomAttributes(typeof(ViewForAttribute), true)))
              .SelectMany(tuple => tuple.Item2.Select(attr => Tuple.Create(tuple.Item1, attr as ViewForAttribute))))
     {
         activator.RegisterView(viewTypeDefinition.Item1, viewTypeDefinition.Item2.Type);
     }
     return(activator);
 }
예제 #2
0
 public static IPlatformViewActivator RegisterView <TView, TViewModel>(this IPlatformViewActivator activator)
 {
     activator.RegisterView <TView, TViewModel> (); return(activator);
 }