DI implementation started with registry class and filing class
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
using Caliburn.Micro;
|
||||
using ImageHandlingLibrary;
|
||||
using ImageHandlingLibrary.InterFaces;
|
||||
using ImageHandlingUI.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@ -29,12 +31,19 @@ namespace ImageHandlingUI
|
||||
.Singleton<IWindowManager, WindowManager>()
|
||||
.Singleton<IEventAggregator, EventAggregator>();
|
||||
|
||||
_container
|
||||
.PerRequest<IRegistring, Registring>()
|
||||
.PerRequest<IFiling, Filing>();
|
||||
|
||||
GetType().Assembly.GetTypes()
|
||||
.Where(type => type.IsClass)
|
||||
.Where(type => type.Name.EndsWith("ViewModel"))
|
||||
.ToList()
|
||||
.ForEach(viewModelType => _container.RegisterPerRequest(
|
||||
viewModelType, viewModelType.ToString(), viewModelType));
|
||||
|
||||
|
||||
|
||||
}
|
||||
//
|
||||
// implementing SimpleContainer (dependency injection system in Caliburn micro)
|
||||
|
||||
Reference in New Issue
Block a user