using System; using Android.Content; 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() { //IttyBittyIoC.Register(Context); IttyBittyIoC.Register(() => new GoogleStockDataProvider()); IttyBittyIoC.Register(() => new PortfolioService(new AndroidSqlitePortfolioRepository(Context), new GoogleStockDataProvider())); IttyBittyIoC.Register(() => new AndroidSqlitePortfolioRepository(Context)); IttyBittyIoC.Register(() => new AndroidSqliteConfigRepository(Context)); } public static object Get(Type serviceType) { return IttyBittyIoC.Resolve(serviceType); } } }