private void SetIoc() { var resolverContainer = new SimpleContainer(); var app = new XFormsAppDroid(); // app.Init(this); resolverContainer.Register <IDevice>(t => AndroidDevice.CurrentDevice) .Register <IDisplay>(t => t.Resolve <IDevice>().Display) .Register <IDependencyContainer>(resolverContainer) .Register <IXFormsApp>(app); Resolver.SetResolver(resolverContainer.GetResolver()); //_initialized = true; //resolverContainer.Register<IDevice>(t => AndroidDevice.CurrentDevice) // .Register<IDisplay>(t => t.Resolve<IDevice>().Display) // .Register<IXFormsApp>(app) // .Register<IDependencyContainer>(t => resolverContainer); //Resolver.SetResolver(resolverContainer.GetResolver()); }
/// <summary> /// Sets the IoC. /// </summary> private void SetIoc() { var resolverContainer = new SimpleContainer(); var app = new XFormsAppDroid(); //app.Init(this); var documents = app.AppDataDirectory; //var pathToDatabase = Path.Combine(documents, "xforms.db"); resolverContainer.Register <IDevice>(t => AndroidDevice.CurrentDevice) .Register <IDisplay>(t => t.Resolve <IDevice>().Display) .Register <IFontManager>(t => new FontManager(t.Resolve <IDisplay>())) .Register <IEmailService, EmailService>() .Register <IMediaPicker, MediaPicker>() .Register <ITextToSpeechService, TextToSpeechService>() .Register <IDependencyContainer>(resolverContainer) .Register <IXFormsApp>(app) .Register <ISecureStorage>(t => new KeyVaultStorage(t.Resolve <IDevice>().Id.ToCharArray())); Resolver.SetResolver(resolverContainer.GetResolver()); }
/// <summary> /// Sets the IoC. /// </summary> private void SetIoc() { var resolverContainer = new SimpleContainer(); var app = new XFormsAppDroid(); app.Init(this); var documents = app.AppDataDirectory; var pathToDatabase = Path.Combine(documents, "xforms.db"); resolverContainer.Register <IDevice>(t => AndroidDevice.CurrentDevice) .Register <IDisplay>(t => t.Resolve <IDevice>().Display) .Register <IJsonSerializer, Services.Serialization.ServiceStackV3.JsonSerializer>() .Register <IDependencyContainer>(resolverContainer) .Register <IXFormsApp>(app) .Register <ISimpleCache>( t => new SQLiteSimpleCache(new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid(), new SQLite.Net.SQLiteConnectionString(pathToDatabase, true), t.Resolve <IJsonSerializer>())); Resolver.SetResolver(resolverContainer.GetResolver()); _initialized = true; }
/// <summary> /// Sets the IoC. /// </summary> private void SetIoc() { var resolverContainer = new SimpleContainer(); var app = new XFormsAppDroid(); app.Init(this); var documents = app.AppDataDirectory; var pathToDatabase = Path.Combine(documents, "xforms.db"); resolverContainer.Register<IDevice> (t => AndroidDevice.CurrentDevice) .Register<IDisplay> (t => t.Resolve<IDevice> ().Display) .Register<IFontManager> (t => new FontManager (t.Resolve<IDisplay> ())) //.Register<IJsonSerializer, Services.Serialization.JsonNET.JsonSerializer>() //.Register<IJsonSerializer, JsonSerializer>() //.Register<IEmailService, EmailService>() .Register<IMediaPicker, MediaPicker> () //.Register<ITextToSpeechService, TextToSpeechService>() .Register<IDependencyContainer> (resolverContainer) .Register<IXFormsApp> (app) .Register<ISecureStorage> (t => new KeyVaultStorage (t.Resolve<IDevice> ().Id.ToCharArray ())); /*.Register<ISimpleCache>( t => new SQLiteSimpleCache(new SQLitePlatformAndroid(), new SQLiteConnectionString(pathToDatabase, true), t.Resolve<IJsonSerializer>()));*/ Resolver.SetResolver(resolverContainer.GetResolver()); }
/// <summary> /// Sets the IoC. /// </summary> private void SetIoc() { var resolverContainer = new SimpleContainer(); var app = new XFormsAppDroid(); app.Init(this); var documents = app.AppDataDirectory; var pathToDatabase = Path.Combine(documents, "xforms.db"); resolverContainer.Register <IDevice>(t => AndroidDevice.CurrentDevice) .Register <IDisplay>(t => t.Resolve <IDevice>().Display) .Register <IFontManager>(t => new FontManager(t.Resolve <IDisplay>())) //.Register<IJsonSerializer, Services.Serialization.JsonNET.JsonSerializer>() .Register <IJsonSerializer, JsonSerializer>() .Register <IEmailService, EmailService>() .Register <IMediaPicker, MediaPicker>() .Register <ITextToSpeechService, TextToSpeechService>() .Register <IDependencyContainer>(resolverContainer) .Register <IXFormsApp>(app) .Register <ISecureStorage>(t => new KeyVaultStorage(t.Resolve <IDevice>().Id.ToCharArray())) .Register <ISimpleCache>( t => new SQLiteSimpleCache(new SQLitePlatformAndroid(), new SQLiteConnectionString(pathToDatabase, true), t.Resolve <IJsonSerializer>())); Resolver.SetResolver(resolverContainer.GetResolver()); }
/// <summary> /// Sets the IoC. /// </summary> private void SetIoc() { var resolverContainer = new SimpleContainer(); var app = new XFormsAppDroid(); app.Init(this); var documents = app.AppDataDirectory; var pathToDatabase = Path.Combine(documents, "xforms.db"); resolverContainer.Register<IDevice>(t => AndroidDevice.CurrentDevice) .Register<IDisplay>(t => t.Resolve<IDevice>().Display) .Register<IJsonSerializer, Services.Serialization.ServiceStackV3.JsonSerializer>() .Register<IDependencyContainer>(resolverContainer) .Register<IXFormsApp>(app) .Register<ISimpleCache>( t => new SQLiteSimpleCache(new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid(), new SQLite.Net.SQLiteConnectionString(pathToDatabase, true), t.Resolve<IJsonSerializer>())); Resolver.SetResolver(resolverContainer.GetResolver()); _initialized = true; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); try { LoadApplication(new App()); var container = App.container; var device = AndroidDevice.CurrentDevice; if (!Resolver.IsSet) { var app = new XFormsAppDroid(); app.Init(this); container.Register <IDevice>((arg) => device) .Register <IAudioStream>(t => device.Microphone) .Register <IDisplay>((t) => t.Resolve <IDevice>().Display) .Register <ISoundService>(t => t.Resolve <ISoundService>()) .Register <IXFormsApp>(app); Resolver.SetResolver(container.GetResolver()); } } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e); } }
private void SetIoc() { var resolverContainer = new SimpleContainer(); var app = new XFormsAppDroid(); app.Init(this); resolverContainer.Register <IMediaPicker, MediaPicker>(); Resolver.SetResolver(resolverContainer.GetResolver()); }
/// <summary> /// Sets the IoC. /// </summary> private void SetIoc() { var resolverContainer = new SimpleContainer(); var app = new XFormsAppDroid(); app.Init(this); resolverContainer.Register<IDevice>(t => AndroidDevice.CurrentDevice).Register<IDisplay>(t => t.Resolve<IDevice>().Display).Register<IJsonSerializer, JsonSerializer>().Register<IDependencyContainer>(resolverContainer).Register<IXFormsApp>(app); Resolver.SetResolver(resolverContainer.GetResolver()); }
private void SetIoc() { var resolverContainer = new SimpleContainer(); var app = new XFormsAppDroid(); resolverContainer.Register(t => AndroidDevice.CurrentDevice) .Register<IDependencyContainer>(t => resolverContainer) .Register<IXFormsApp>(app); Resolver.SetResolver(resolverContainer.GetResolver()); }
private void SetIoc() { var resolverContainer = new SimpleContainer(); var app = new XFormsAppDroid(); app.Init(this); resolverContainer .Register<IXFormsApp>(app); Resolver.SetResolver(resolverContainer.GetResolver()); }
private void SetIoC() { var resolverContainer = new SimpleContainer(); var app = new XFormsAppDroid(); resolverContainer.Register(t => AndroidDevice.CurrentDevice) .Register <IDependencyContainer>(t => resolverContainer) .Register <IXFormsApp>(app) .Register <IGeolocator, Geolocator>() .Register <IMediaPicker, MediaPicker>(); Resolver.SetResolver(resolverContainer.GetResolver()); }
/// <summary> /// Sets the IoC. /// </summary> private void SetIoc() { var resolverContainer = new SimpleContainer(); var app = new XFormsAppDroid(); app.Init(this); resolverContainer.Register <IDevice>(t => AndroidDevice.CurrentDevice) .Register <IDisplay>(t => t.Resolve <IDevice>().Display) //.Register<IJsonSerializer, Services.Serialization.JsonNET.JsonSerializer>() //.Register<IJsonSerializer, XLabs.Serialization.ServiceStack.JsonSerializer>() .Register <IDependencyContainer>(resolverContainer) .Register <IXFormsApp>(app); //.Register<ISimpleCache>( // t => new SQLiteSimpleCache(new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid(), // new SQLite.Net.SQLiteConnectionString(pathToDatabase, true), t.Resolve<IJsonSerializer>())); Resolver.SetResolver(resolverContainer.GetResolver()); }
/// <summary> /// Sets the IoC. /// </summary> private void SetIoc() { var resolverContainer = new SimpleContainer(); var app = new XFormsAppDroid(); app.Init(this); resolverContainer.Register <IDevice>(t => AndroidDevice.CurrentDevice) .Register <IDisplay>(t => t.Resolve <IDevice>().Display) .Register <IDependencyContainer>(resolverContainer) .Register <INetwork>(t => t.Resolve <IDevice>().Network) .Register <IGeolocator, Geolocator>() .Register <INavigationService, NavigationService>() .Register <IXFormsApp>(app); Resolver.SetResolver(resolverContainer.GetResolver()); _initialized = true; }
private void SetIoc() { var app = new XFormsAppDroid(); app.Init(this); const string sqliteFilename = "Advosys.db3"; var documentsPath = System.Environment.GetFolderPath(Environment.SpecialFolder.Personal); var path = Path.Combine(documentsPath, sqliteFilename); var container = new SimpleContainer(); container.Register(t => t.Resolve <IDevice>().Display) .Register <IDependencyContainer>(t => container) .Register <IXFormsApp>(app) .Register <IByteSerializer, JsonSerializer>(); container.Register <IGeolocator, Geolocator>(); container.Register <ISimpleCache>(resolver => new SQLiteSimpleCache( new SQLitePlatformAndroid(), new SQLiteConnectionString(path, true), resolver.Resolve <IByteSerializer>())); Resolver.SetResolver(container.GetResolver()); }
/// <summary> /// Sets the IoC. /// </summary> private void SetIoc() { var resolverContainer = new SimpleContainer(); var app = new XFormsAppDroid(); var documents = Environment.ExternalStorageDirectory.AbsolutePath; var pathToDatabase = Path.Combine(documents, "xforms.db"); //app.Init(this); resolverContainer.Register <IDevice>(t => AndroidDevice.CurrentDevice) .Register <IDisplay>(t => t.Resolve <IDevice>().Display) .Register <IJsonSerializer, Xamarin.Forms.Labs.Services.Serialization.JsonNET.JsonSerializer>() .Register <IDependencyContainer>(resolverContainer) .Register <IXFormsApp>(app); //.Register<ISimpleCache>(t => new SQLiteSimpleCache(new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid(), // new SQLite.Net.SQLiteConnectionString(pathToDatabase, true), t.Resolve<IJsonSerializer>())); Resolver.SetResolver(resolverContainer.GetResolver()); _initialized = true; }