Esempio n. 1
0
        public void InitIndexReader()
        {
            for (int i = 0; i < booksource.Chapters.Count; i++)
            {
                VerticalIndexContainer vc = new VerticalIndexContainer();
                vc.PageIndexSelected += (sender, id) => {
                    contentScroll.SetToIndex(id);
                    UIView.Animate(0.3, 0, UIViewAnimationOptions.CurveEaseIn, () => {
                        indexScroll.Transform = CGAffineTransform.MakeScale(0.9f, 0.9f);
                    }, null);
                    UIView.Animate(0.36, 0, UIViewAnimationOptions.CurveEaseIn,
                                   () => { contentScroll.Center = new PointF((float)contentScroll.Center.X - 320,
                                                                             (float)contentScroll.Center.Y); }, null);

                    UIView.Animate(0.36, 0, UIViewAnimationOptions.CurveEaseIn,
                                   () => { backButton.Center = new PointF((float)backButton.Center.X - 320,
                                                                          (float)backButton.Center.Y); }, null);
                    indexScroll.Layer.ZPosition   -= 100;
                    contentScroll.Layer.ZPosition += 100;
                };

                vc.SourceData = booksource.Chapters [i];
                vc.InitContent();
                indexScroll.AddVerticalIndexContainer(vc, i, booksource.Chapters[i].BackgroundImage);
            }
        }