I don't think you really need dependency injection. Since CentralLogic
has a single instance, it is effectively a singleton. Read about singleton pattern here.
You can implement the singleton pattern on CentralLogic
public sealed class CentralLogic
{
private static readonly Lazy<CentralLogic> lazy =
new Lazy<CentralLogic>(() => new CentralLogic());
public static CentralLogic Instance { get { return lazy.Value; } }
private CentralLogic()
{
}
}
Then in the Service Impl's contructor (and in the UI), you get the instance, this way:
class KLAService : IKLAService
{
CentralLogic m_centralLogic;
public KLAService()
{
m_centralLogic = CentralLogic.Instance;
....
}
}
There is no need to pass anything to ServiceHost.
The most important thing for you here is make sure your CentralLogic's instance is thread safe.