Skip to content

Latest commit

 

History

History
33 lines (31 loc) · 521 Bytes

README.md

File metadata and controls

33 lines (31 loc) · 521 Bytes

XamIoc

a very tiny ioc for the xamarin apps and .net standard apps

Usage

public interface IMessenger
{
  void Send();
}
public class Messenger:IMessenger
{
  public Messenger(string msg)
  {
    ...
  }
  public void Send()
  {
    ...
  }
}

public class App
{
  public App()
  {
    //wire the interface and implementation
    XamIoc.Core.Bind<IMessenger, Messenger>();
    //resolve the interface and passing a parameter
    var msg = XamIoc.Core.Resolve<IMessenger>("Love you");
    msg.Send();
  }
}