public virtual IStartResumePlaybackView CreateStartResumePlaybackView()
 {
     _startResumePlaybackView = Bootstrapper.GetContainer().Resolve<IStartResumePlaybackView>(new NamedParameterOverloads() { { "device", _resumeCloudDeviceInfo } });
     return _startResumePlaybackView;
 }
 public virtual void BindStartResumePlaybackView(IStartResumePlaybackView view)
 {
     _startResumePlaybackView = view;
     _startResumePlaybackPresenter = Bootstrapper.GetContainer().Resolve<IStartResumePlaybackPresenter>(new NamedParameterOverloads() { { "device", _resumeCloudDeviceInfo } });
     _startResumePlaybackPresenter.BindView(view);
     _startResumePlaybackView.OnViewDestroy = (view2) =>
     {
         _startResumePlaybackPresenter.ViewDestroyed();
         _startResumePlaybackPresenter = null;
         _startResumePlaybackView = null;
     };            
 }
Beispiel #3
0
        public virtual IStartResumePlaybackView CreateStartResumePlaybackView()
        {
            // If the view is still visible, just make it the top level window
            if (_startResumePlaybackView != null)
            {
                _startResumePlaybackView.ShowView(true);
                return _startResumePlaybackView;
            }

            // The view invokes the OnViewReady action when the view is ready. This means the presenter can be created and bound to the view.
            Action<IBaseView> onViewReady = (view) =>
            {
                _startResumePlaybackPresenter = Bootstrapper.GetContainer().Resolve<IStartResumePlaybackPresenter>(new NamedParameterOverloads() { { "device", _resumeCloudDeviceInfo } });
                _startResumePlaybackPresenter.BindView((IStartResumePlaybackView)view);
            };

            // Create view and manage view destruction
            _startResumePlaybackView = Bootstrapper.GetContainer().Resolve<IStartResumePlaybackView>(new NamedParameterOverloads() { { "onViewReady", onViewReady }, { "device", _resumeCloudDeviceInfo } });
            _startResumePlaybackView.OnViewDestroy = (view) =>
            {
                _startResumePlaybackPresenter.ViewDestroyed();
                _startResumePlaybackPresenter = null;
                _startResumePlaybackView = null;
            };
            return _startResumePlaybackView;
        }