public void Activate(IViewLayoutContainer controllerContainer)
        {
            _lifeTimeDefinition.Release();
            _lifeTimeDefinition.AddCleanUpAction(() => _controllerContainer = null);

            _controllerContainer = controllerContainer;

            BindSceneActions();

            OnActivate(controllerContainer);
        }
        public GameViewSystem(
            IViewFactory viewFactory,
            IViewLayoutContainer viewLayouts,
            IViewFlowController flowController)
        {
            _viewCreatedSubject = new Subject <IView>().AddTo(_lifeTimeDefinition);

            _viewFactory    = viewFactory;
            _viewLayouts    = viewLayouts;
            _flowController = flowController;

            _flowController.Activate(_viewLayouts);
        }
        public GameViewSystem(
            IViewFactory viewFactory,
            IViewLayoutContainer viewLayouts,
            IViewFlowController flowController,
            IViewModelProvider viewModelProvider,
            IViewModelTypeMap modelTypeMap)
        {
            _viewCreatedSubject = new Subject <IView>().AddTo(LifeTime);

            _viewFactory       = viewFactory;
            _viewLayouts       = viewLayouts;
            _flowController    = flowController;
            _viewModelProvider = viewModelProvider;
            _modelTypeMap      = modelTypeMap;

            _flowController.Activate(_viewLayouts);
        }
示例#4
0
        protected override void OnActivate(IViewLayoutContainer layouts)
        {
            var screenController = layouts.GetLayout(ViewType.Screen);
            var windowController = layouts.GetLayout(ViewType.Window);

            screenController.HasActiveView
            .Where(x => x)
            .Subscribe(x => windowController.CloseAll())
            .AddTo(windowController.LifeTime);

            windowController.HasActiveView
            .Where(x => x)
            .CombineLatest(windowController.OnBeginShow, (hasView, view) => view)
            .Where(x => x is IScreenSuspendingWindow)
            .Subscribe(x => _screenSuspended.Value = true)
            .AddTo(windowController.LifeTime);

            windowController.HasActiveView
            .Where(x => x)
            .CombineLatest(windowController.OnBeginShow, (hasView, view) => view)
            .Where(x => !(x is IScreenSuspendingWindow))
            .Subscribe(x => _screenSuspended.Value = false)
            .AddTo(windowController.LifeTime);

            windowController.HasActiveView
            .Where(x => !x)
            .Subscribe(x => _screenSuspended.Value = false)
            .AddTo(windowController.LifeTime);

            _screenSuspended
            .Skip(1)
            .Subscribe(x =>
            {
                if (x)
                {
                    screenController.Suspend();
                }
                else
                {
                    screenController.Resume();
                }
            })
            .AddTo(windowController.LifeTime);
        }
 /// <summary>
 /// Custom defined initialization of layout
 /// </summary>
 /// <param name="layouts"></param>
 protected virtual void OnActivate(IViewLayoutContainer layouts)
 {
 }