Skip to content
TikoContainer - tiny IoC container for MonoTouch
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



TikoContainer is a tiny IoC container for MonoTouch with support for property injection.

Currently TikoContainer supports following features:

  • Register type as Singleton
  • Resolve single type
  • Resolve type and inject dependencies
  • Property injection
  • BuildUp existing instance (inject dependencies)
  • Clear IoC container

Using TikoContainer

Register type

Register type thru Register() or Register() methods. All type will be registered as Singleton.

public void RegisterDal()
    TikoContainer.Register<IUserAccountRepository, UserAccountRepository>();

Resolve by type

Resolve object by type. _userAccountRepository will be initialised with an instance of UserAccountRepository.

var _userAccountRepository = TikoContainer.Resolve<IUserAccountRepository>();

Resolve with property injection

Resolve dependency thru property injection. UserAccountRepository and PasswordManager properties will be injected after call


public class UserAccountManager
    private static readonly Lazy<UserAccountManager> _instance = 
        new Lazy<UserAccountManager>(TikoContainer.Resolve<UserAccountManager>);

    public static UserAccountManager Value
        get { return _instance.Value; }

    public IUserAccountRepository UserAccountRepository { get; set; }

    public PasswordManager PasswordManager { get; set; }

Resolve dependencies of an exsisting object

UserAccountRepository and PasswordManager properties will be injected after BuildUp call.

var _userAccountManager = new UserAccountManager();

Clear TikoContainer

Clear IoC container cache, all registered types will be removed.

Something went wrong with that request. Please try again.