protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.BuildingPlans); // Create your application here imageTitle = FindViewById <TextView>(Resource.Id.imageTitleTextView); previousImage = FindViewById <ImageButton>(Resource.Id.previousImageButton); nextImage = FindViewById <ImageButton>(Resource.Id.nextImageButton); imagesList = new List <Image> { new Image { Id = Resource.Drawable.parter, Title = "Parter" }, new Image { Id = Resource.Drawable.pierwszePietro, Title = "Pierwsze piętro" }, new Image { Id = Resource.Drawable.drugiePietro, Title = "Drugie piętro" } }; foreach (var image in imagesList) { imagesIdList.Add(image.Id); } viewPager = FindViewById <ViewPager>(Resource.Id.buildingsPlanViewPager); ImagesScrollViewAdapter adapter = new ImagesScrollViewAdapter(this, imagesIdList); viewPager.Adapter = adapter; viewPager.PageScrolled += ViewPager_PageScrolled; previousImage.Click += PreviousImage_Click; nextImage.Click += NextImage_Click; }
private void SetAdapter() { ImagesScrollViewAdapter adapter = new ImagesScrollViewAdapter(this, routeImagesId); viewPager.Adapter = adapter; viewPager.PageScrolled += ViewPager_PageScrolled; }