Beispiel #1
0
        protected override void InitBindings()
        {
            if (ViewModel is null)
            {
                Resolve <Logger <FeedPageFragment> >().LogError("No ViewModel on InitBindings.");
                Debugger.Break();
            }

            Bindings.Add(this.SetBinding(() => ViewModel.FeedTabEntries).WhenSourceChanges(() =>
            {
                if (ViewModel.FeedTabEntries is null)
                {
                    return;
                }

                _adapter          = new FeedPagerAdapter(ChildFragmentManager, ViewModel.FeedTabEntries, this);
                ViewPager.Adapter = _adapter;
                UpdateTabIcons();
            }));

            Bindings.Add(this.SetBinding(() => ViewModel.JumpToButtonVisibility).WhenSourceChanges(() =>
            {
                if (ViewModel.JumpToButtonVisibility)
                {
                    JumpToButton.Show();
                }
                else
                {
                    JumpToButton.Hide();
                }
            }));

            JumpToButton.SetOnClickListener(new OnClickListener(HandleJumpToPopup));
            TabStrip.SetupWithViewPager(ViewPager);
            ViewPager.PageSelected += ViewPagerOnPageSelected;
        }