protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); ViewPager viewPager = FindViewById <ViewPager>(Resource.Id.viewpager); TreeCatalog treeCatalog = new TreeCatalog(); viewPager.Adapter = new TreePagerAdapter(this, treeCatalog); viewPager.SetCurrentItem(1, false); var dots = FindViewById <TabLayout>(Resource.Id.dots); dots.SetupWithViewPager(viewPager, true); // <- magic here }
public TreePagerAdapter(Context context, TreeCatalog treeCatalog) { this.context = context; this.treeCatalog = treeCatalog; }