public virtual void BindSplashView(ISplashView view) { _splashView = view; _splashView.OnViewDestroy = (view2) => { _splashPresenter.ViewDestroyed(); _splashPresenter = null; _splashView = null; }; _splashPresenter = Bootstrapper.GetContainer().Resolve<ISplashPresenter>(); _splashPresenter.BindView(view); _splashPresenter.Initialize(ContinueAfterSplash); }
public virtual ISplashView CreateSplashView() { // The view invokes the OnViewReady action when the view is ready. This means the presenter can be created and bound to the view. Action onInitDone = () => { Tracing.Log("SplashInitDone"); try { var resumePlaybackService = Bootstrapper.GetContainer().Resolve<IResumePlaybackService>(); _resumeCloudDeviceInfo = resumePlaybackService.GetResumePlaybackInfo(); CreateMainView(); if(_resumeCloudDeviceInfo != null) CreateStartResumePlaybackView(); } catch(Exception ex) { Tracing.Log("NavigationManager - CreateMainView - Exception: {0}", ex); throw; } }; Action<IBaseView> onViewReady = (view) => { _splashPresenter = Bootstrapper.GetContainer().Resolve<ISplashPresenter>(); _splashPresenter.BindView((ISplashView)view); _splashPresenter.Initialize(onInitDone); // TODO: Should the presenter call NavMgr instead of using an action? }; _splashView = Bootstrapper.GetContainer().Resolve<ISplashView>(new NamedParameterOverloads() { { "onViewReady", onViewReady } }); _splashView.OnViewDestroy = (view) => { _splashPresenter.ViewDestroyed(); _splashPresenter = null; _splashView = null; }; return _splashView; }