/// <summary> /// Constructor /// </summary> static ViewAssemblyProvider() { // Initialize fields. ViewAssemblyProvider.AssemblyMappings = new List <AssemblyMapping>(); ViewAssemblyProvider.AssemblyMappingsLock = new object(); // Start watching loaded assemblies for IViewHolders. ViewAssemblyProvider.UpdatedLoadedAssemblies(); AppDomain.CurrentDomain.AssemblyLoad += ViewAssemblyProvider.AssemblyLoaded; }
private static void AssemblyLoaded(object sender, AssemblyLoadEventArgs args) { var loadedAssembly = args.LoadedAssembly; ViewAssemblyProvider.TryAddNewAssembly(loadedAssembly); }
/// <inheritdoc /> /// <remarks> Delegates its responsibility to <see cref="ViewAssemblyProvider.GetViewAssemblies"/>. </remarks> protected internal override Assembly[] GetViewAssemblies(Type viewModelType, Assembly viewAssembly = null) { return(viewAssembly is null?ViewAssemblyProvider.GetViewAssemblies(viewModelType) : new[] { viewAssembly }); }