Ejemplo n.º 1
0
 public virtual void BindPlaylistView(IBaseView sourceView, IPlaylistView view)
 {
     _playlistView = view;
     _playlistView.OnViewDestroy = (view2) =>
     {
         _playlistPresenter.ViewDestroyed();
         _playlistPresenter = null;
         _playlistView = null;
     };
     _playlistPresenter = Bootstrapper.GetContainer().Resolve<IPlaylistPresenter>();
     _playlistPresenter.BindView(view);
 }
Ejemplo n.º 2
0
        public virtual IPlaylistView CreatePlaylistView()
        {
            if(_playlistView != null)
            {
                _playlistView.ShowView(true);
                return _playlistView;
            }

            Action<IBaseView> onViewReady = (view) =>
            {
                _playlistPresenter = Bootstrapper.GetContainer().Resolve<IPlaylistPresenter>();
                _playlistPresenter.BindView((IPlaylistView)view);
            };

            // Create view and manage view destruction
            _playlistView = Bootstrapper.GetContainer().Resolve<IPlaylistView>(new NamedParameterOverloads() { { "onViewReady", onViewReady } });
            _playlistView.OnViewDestroy = (view) => {
                _playlistPresenter.ViewDestroyed();
                _playlistPresenter = null;
                _playlistView = null;
            };
            return _playlistView;
        }