Created
March 6, 2018 13:41
-
-
Save Char0394/3c28b29d826d8213b57055e06c4a2589 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace myApp | |
{ | |
public partial class App : PrismApplication | |
{ | |
static IApiService<IMyApi> myApi = new ApiService<IMyApi>(Config.ApiUrl); | |
static IApiManager _apiManager; | |
public App(IPlatformInitializer initializer = null) : base(initializer) | |
{ | |
} | |
protected override async void OnInitialized() | |
{ | |
InitializeComponent(); | |
} | |
protected override void RegisterTypes(IContainerRegistry containerRegistry) | |
{ | |
// Registering instances | |
containerRegistry.RegisterInstance<IApiService<IMyApi>>(myApi); | |
containerRegistry.RegisterInstance<IConnectivity>(CrossConnectivity.Current); | |
// Registering types | |
containerRegistry.RegisterSingleton<IApiManager, ApiManager>(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment