예제 #1
0
 private ReadOnlyReactivePropertySlim <bool> Init(ICommand command, ReactiveCommand reactiveCommand)
 {
     reactiveCommand.AddTo(_disposables);
     reactiveCommand.Subscribe(() =>
     {
         command.Execute();
     });
     return(command.IsEnabled.Observable.ToReadOnlyReactivePropertySlim(command.IsEnabled.Value).AddTo(_disposables));
 }
예제 #2
0
        public void Initialize()
        {
            _closableParent    = _closableParent ?? gameObject;
            _animationStrategy = CreateAnimationStrategy();

            _onViewOpen           = new Subject <Unit>().AddTo(Disposer);
            _onViewOpenCompleted  = new Subject <Unit>().AddTo(Disposer);
            _onViewClose          = new Subject <Unit>().AddTo(Disposer);
            _onViewCloseCompleted = new Subject <Unit>().AddTo(Disposer);

            if (_closeButton != null)
            {
                _onCloseClicked.AddTo(Disposer);
                _onCloseClicked.BindTo(_closeButton).AddTo(Disposer);
            }

            _closableParent.SetActive(!_startClosed);
        }