public override void Init(BasePopupModel baseModel) { _model = baseModel as DictionaryPopupModel; Assert.IsNotNull(_model, "BasePopupModel is not DictionaryPopupModel"); _model.OnClickCloseButton = OnClickCloseButton; _view.Init(_model); }
public void Init(DictionaryPopupModel model) { _model = model; if (_closeDisposable == null) { _closeDisposable = closeButton.OnClickAsObservable().Subscribe(_ => OnClickCloseButton()); } _nextWordButton.interactable = _model.Words.Count > 1; _prevWordButton.interactable = false; ShowWord(index); _prevButtonDisposable?.Dispose(); _prevButtonDisposable = _prevWordButton.OnClickAsObservable().Subscribe(_ => OnClickPrevButton()); _nextButtonDisposable?.Dispose(); _nextButtonDisposable = _nextWordButton.OnClickAsObservable().Subscribe(_ => OnClickNextButton()); SetPaginationForDictionary(); }