using System; using Android.Content; using MonoStockPortfolio.Activites.Main; using MonoStockPortfolio.Core.Config; using MonoStockPortfolio.Core.PortfolioRepositories; using MonoStockPortfolio.Core.Services; using MonoStockPortfolio.Core.StockData; namespace MonoStockPortfolio.Framework { public static class ServiceLocator { public static Context Context { get; set; } static ServiceLocator() { // presenters IttyBittyIoC.Register(() => new MainPresenter(new AndroidSqlitePortfolioRepository(Context))); // services/repositories IttyBittyIoC.Register(() => new YahooStockDataProvider()); IttyBittyIoC.Register(() => new PortfolioService(new AndroidSqlitePortfolioRepository(Context), new YahooStockDataProvider())); IttyBittyIoC.Register(() => new AndroidSqlitePortfolioRepository(Context)); IttyBittyIoC.Register(() => new AndroidSqliteConfigRepository(Context)); } public static object Get(Type serviceType) { return IttyBittyIoC.Resolve(serviceType); } } }