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); }
public static IPlatformViewActivator RegisterView <TView, TViewModel>(this IPlatformViewActivator activator) { activator.RegisterView <TView, TViewModel> (); return(activator); }