Xamarin.Forms Projects by Johan Karlsson

Xamarin.Forms Projects by Johan Karlsson

Author:Johan Karlsson
Language: eng
Format: epub
Tags: COM051310 - COMPUTERS / Programming Languages / C#, COM051460 - COMPUTERS / Programming / Mobile Devices, COM051380 - COMPUTERS / Programming / Microsoft
Publisher: Packt Publishing
Published: 2019-01-15T07:01:18+00:00


namespace Weather

{

public class Bootstrapper

{

public static void Init()

{

var containerBuilder = new ContainerBuilder();

containerBuilder.RegisterType

<OpenWeatherMapWeatherService>().As

<IWeatherService>();

containerBuilder.RegisterType<MainViewModel>();

var container = containerBuilder.Build();

Resolver.Initialize(container);

}

}

}

Call the Init method of Bootstrapper in the constructor in the App.xaml.cs file after the call to the InitializeComponent method. Also, set the MainPage property to MainView, as shown in the following code:

public App()

{

InitializeComponent();

Bootstrapper.Init();

MainPage = new NavigationPage(new MainView());

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.