public void EnsureInit(IMvxAndroidGlobals androidGlobals) { if (MvxSimpleIoCContainer.Instance != null) { return; } MvxSimpleIoCContainer.Initialize(); Mvx.RegisterSingleton <IMvxTrace>(new MvxDebugTrace()); MvxTrace.Initialize(); Mvx.RegisterSingleton <IMvxAndroidGlobals>(androidGlobals); new MvxAndroidBindingBuilder().DoRegistration(); var viewCache = Mvx.Resolve <IMvxTypeCache <View> >(); viewCache.AddAssembly(typeof(View).Assembly); var namespaces = Mvx.Resolve <IMvxNamespaceListViewTypeResolver>(); namespaces.Add("Android.Views"); namespaces.Add("Android.Widget"); namespaces.Add("Android.Webkit"); }
public void EnsureInitialized(Context applicationContext) { if (MvxSimpleIoCContainer.Instance != null) { return; } var ioc = MvxSimpleIoCContainer.Initialize(); ioc.RegisterSingleton <IMvxTrace>(new MvxDebugOnlyTrace()); MvxTrace.Initialize(); ioc.RegisterSingleton <IMvxAndroidGlobals>(new AndroidGlobals(applicationContext)); var builder = new MvxAndroidBindingBuilder(); builder.DoRegistration(); var viewCache = ioc.Resolve <IMvxTypeCache <View> >(); viewCache.AddAssembly(typeof(View).Assembly); var namespaces = ioc.Resolve <IMvxNamespaceListViewTypeResolver>(); namespaces.Add("Android.Views"); namespaces.Add("Android.Widget"); namespaces.Add("Android.Webkit"); }
protected virtual void InitializeDebugServices() { var debugTrace = CreateDebugTrace(); Mvx.RegisterSingleton <IMvxTrace>(debugTrace); MvxTrace.Initialize(); }
protected virtual void ClearAll() { // fake set up of the IoC MvxSingleton.ClearAllSingletons(); _ioc = MvxSimpleIoCContainer.Initialise(); _ioc.RegisterSingleton(_ioc); _ioc.RegisterSingleton <IMvxTrace>(new TestTrace()); MvxTrace.Initialize(); MvxBindingStatics.ClearCaches(); AdditionalSetup(); }
public static void ResetContext() { MvxSingleton.ClearAllSingletons(); var ioc = MvxSimpleIoCContainer.Initialize(null); ioc.RegisterSingleton(ioc); ioc.RegisterSingleton <IMvxTrace>(new UnitTestTrace()); MvxSingletonCache.Initialize(); ioc.RegisterSingleton <IMvxSettings>(new MvxSettings()); MvxTrace.Initialize(); }
protected virtual void ClearAll() { // fake set up of the IoC MvxSingleton.ClearAllSingletons(); this._ioc = MvxSimpleIoCContainer.Initialize(this.CreateIocOptions()); this._ioc.RegisterSingleton(this._ioc); this._ioc.RegisterSingleton <IMvxTrace>(new TestTrace()); InitializeSingletonCache(); this.InitializeMvxSettings(); MvxTrace.Initialize(); this.AdditionalSetup(); }
public virtual void Setup() { // fake set up of the IoC MvxSingleton.ClearAllSingletons(); _ioc = new MvxSimpleIoCServiceProvider(); var serviceProvider = new MvxServiceProvider(_ioc); _ioc.RegisterServiceInstance <IMvxServiceProviderRegistry>(serviceProvider); _ioc.RegisterServiceInstance <IMvxServiceProvider>(serviceProvider); _ioc.RegisterServiceInstance <IMvxTrace>(new MvxDebugTrace()); MvxTrace.Initialize(); }
protected void ClearAll() { // fake set up of the IoC MvxSingleton.ClearAllSingletons(); _ioc = MvxSimpleIoCContainer.Initialise(); _ioc.RegisterSingleton(_ioc); _ioc.RegisterSingleton <IMvxTrace>(new TestTrace()); RegisterAdditionalSingletons(); InitialiseSingletonCache(); InitialiseMvxSettings(); MvxTrace.Initialize(); }
static BaseMvvmCrossTest() { if (MvxSimpleIoCContainer.Instance == null) { MvxSingletonCache.Initialize(); MvxSimpleIoCContainer.Initialize(); MvxSimpleIoCContainer.Instance.RegisterSingleton(MvxSimpleIoCContainer.Instance); MvxSimpleIoCContainer.Instance.RegisterSingleton <IMvxTrace>(new TestTrace()); MvxSimpleIoCContainer.Instance.RegisterSingleton <IMvxSettings>(new MvxSettings()); MvxTrace.Initialize(); } }
public void EnsureInit() { if (MvxSimpleIoCContainer.Instance != null) { return; } MvxSimpleIoCContainer.Initialize(); Mvx.RegisterSingleton <IMvxTrace>(new MvxDebugTrace()); MvxTrace.Initialize(); new MvxTouchBindingBuilder().DoRegistration(); }
static BaseMvvmCrossTests() { if (MvxSingleton <IMvxIoCProvider> .Instance != null) { return; } MvxSingletonCache.Initialize(); MvxSimpleIoCContainer.Initialize(); MvxSingleton <IMvxIoCProvider> .Instance.RegisterSingleton <IMvxTrace>(new TestTrace()); MvxSingleton <IMvxIoCProvider> .Instance.RegisterSingleton <IMvxSettings>(new MvxSettings()); MvxTrace.Initialize(); }
protected virtual void ClearAll() { // fake set up of the IoC MvxSingleton.ClearAllSingletons(); var withInject = new MvxPropertyInjectorOptions() { InjectIntoProperties = MvxPropertyInjection.MvxInjectInterfaceProperties, ThrowIfPropertyInjectionFails = true }; var options = new MvxIocOptions { PropertyInjectorOptions = withInject }; _ioc = MvxSimpleIoCContainer.Initialize(options); _ioc.RegisterSingleton(_ioc); InitializeTrace(); InitializeSingletonCache(); InitializeMvxSettings(); MvxTrace.Initialize(); AdditionalSetup(); }
//public static void Execute() //{ // Execute(new NullSingletonRegisterer()); //} public static IMvxIoCProvider Execute() { MvxSingleton.ClearAllSingletons(); var ioc = MvxSimpleIoCContainer.Initialize(); var dispatcher = new InlineMockMainThreadDispatcher(); ioc.RegisterSingleton(dispatcher); ioc.RegisterSingleton <IMvxMainThreadDispatcher>(dispatcher); // for navigation parsing ioc.RegisterSingleton <IMvxStringToTypeParser>(new MvxStringToTypeParser()); ioc.RegisterSingleton(ioc); ioc.RegisterSingleton <IMvxTrace>(new TestTrace()); //singletonRegisterer.RegisterSingletons(ioc); InitialiseSingletonCache(); InitialiseMvxSettings(ioc); MvxTrace.Initialize(); return(ioc); }
protected virtual void InitializeDebugServices() { MvxTrace.Initialize(); }