using System;
using Artemis.UI.Shared.Services;
using Ninject.Extensions.Conventions;
using Ninject.Modules;
namespace Artemis.UI.Shared.Ninject;
///
/// The main of the Artemis Shared UI toolkit that binds all services
///
public class SharedUIModule : NinjectModule
{
///
public override void Load()
{
if (Kernel == null)
throw new ArgumentNullException("Kernel shouldn't be null here.");
// Bind all shared UI services as singletons
Kernel.Bind(x =>
{
x.FromAssemblyContaining()
.IncludingNonPublicTypes()
.SelectAllClasses()
.InheritedFrom()
.BindAllInterfaces()
.Configure(c => c.InSingletonScope());
});
}
}