예제 #1
0
 public virtual void BindSyncDownloadView(ISyncDownloadView view)
 {
     _syncDownloadView = view;
     _syncDownloadView.OnViewDestroy = (view2) =>
     {
         _syncDownloadPresenter.ViewDestroyed();
         _syncDownloadPresenter = null;
         _syncDownloadView = null;
     };
     _syncDownloadPresenter = Bootstrapper.GetContainer().Resolve<ISyncDownloadPresenter>();
     _syncDownloadPresenter.BindView(view);
 }
예제 #2
0
        public virtual ISyncDownloadView CreateSyncDownloadView(SyncDevice device, IEnumerable<AudioFile> audioFiles)
        {
            if(_syncDownloadView != null)
            {
                _syncDownloadView.ShowView(true);
                return _syncDownloadView;
            }

            Action<IBaseView> onViewReady = (view) =>
            {                    
                _syncDownloadPresenter = Bootstrapper.GetContainer().Resolve<ISyncDownloadPresenter>();
                _syncDownloadPresenter.BindView((ISyncDownloadView)view);
                _syncDownloadPresenter.StartSync(device, audioFiles);
            };

            _syncDownloadView = Bootstrapper.GetContainer().Resolve<ISyncDownloadView>(new NamedParameterOverloads() { { "onViewReady", onViewReady } });
            _syncDownloadView.OnViewDestroy = (view) => {
                _syncDownloadPresenter.ViewDestroyed();
                _syncDownloadPresenter = null;
                _syncDownloadView = null;
            };
            return _syncDownloadView;
        }