public bool Load(IModuleContext context) { IViewModelPresenter service; #if APPCOMPAT if (!context.IocContainer.TryGet(out service)) { return(false); } #else if (!AndroidToolkitExtensions.IsApiGreaterThanOrEqualTo17 || !context.IocContainer.TryGet(out service)) { return(false); } #endif var mediatorFactory = AndroidToolkitExtensions.MediatorFactory; AndroidToolkitExtensions.MediatorFactory = (o, dataContext, arg3) => { #if APPCOMPAT return(FragmentExtensions.MvvmFragmentMediatorDefaultFactory(o, dataContext, arg3) ?? mediatorFactory?.Invoke(o, dataContext, arg3)); #else return(AndroidToolkitExtensions.MvvmFragmentMediatorDefaultFactory(o, dataContext, arg3) ?? mediatorFactory?.Invoke(o, dataContext, arg3)); #endif }; var windowPresenter = service.DynamicPresenters.OfType <DynamicViewModelWindowPresenter>().FirstOrDefault(); if (windowPresenter == null) { windowPresenter = context.IocContainer.Get <DynamicViewModelWindowPresenter>(); service.DynamicPresenters.Add(windowPresenter); } #if APPCOMPAT windowPresenter.RegisterMediatorFactory <Infrastructure.Mediators.WindowViewMediator, Interfaces.Views.IWindowView>(); #else windowPresenter.RegisterMediatorFactory <WindowViewMediator, IWindowView>(); #endif return(true); }