mirror of
https://github.com/farcasclaudiu/myfriendsaround.git
synced 2026-06-29 11:02:07 +03:00
IoC and NavigationService implementation
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace MicroIoc
|
||||
{
|
||||
public class ContainerConfiguration : IConfiguration
|
||||
{
|
||||
private readonly IMicroIocContainer _container;
|
||||
|
||||
public ContainerConfiguration(IMicroIocContainer container)
|
||||
{
|
||||
if (container == null)
|
||||
throw new ArgumentNullException("container");
|
||||
|
||||
_container = container;
|
||||
}
|
||||
|
||||
public IConfiguration Configure<T>(InjectedMemberBase injection)
|
||||
{
|
||||
var fullName = injection.DeriveFullName<T>();
|
||||
_container.RegisterInstance(injection.MemberValue.GetType(), injection.MemberValue, fullName);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user