Ejemplo n.º 1
0
        void initComponent()
        {
            if (source != null)
            {
                numberOfItems = source.Pages.Count;
                float stackItemXPosition = 0;
                //_numberofitems = 6;
                for (int i = 0; i < numberOfItems; i++)
                {
                    var sitem = new IStackItem(stackItemXPosition);
                    Console.WriteLine(sitem.Frame);
                    sitem.InitialAngle = angles[i % 3];

                    sitem.Chapter = Chapter;
                    sitem.Section = Section;
                    sitem.Page    = i;
                    sitem.Source  = source.Pages[i];

                    sitem.Layer.ZPosition = i + 1;
                    sitem.StackItemFullAnimationStarted    += HandleStackItemFullAnimationStarted;
                    sitem.StackItemFullAnimationCompleted  += HandleStackItemFullAnimationCompleted;
                    sitem.StackItemThumbAnimationStarted   += HandleStackItemThumbAnimationStarted;
                    sitem.StackItemThumbAnimationCompleted += HandleStackItemThumbAnimationCompleted;


                    Add(sitem);
                    itemsVector.Add(sitem);
                    StackItemCreated(sitem, sitem.IndexInBook);

                    stackItemXPosition += (float)sitem.Frame.Width + Constants.ItemSeparation;
                }
                if (itemsVector.Count > 0)
                {
                    selectedItem = itemsVector[0];
                }

                CGRect tmp = Frame;
                tmp.Width = stackItemXPosition;
                Frame     = tmp;
            }
        }
Ejemplo n.º 2
0
 void HandleStackItemFullAnimationStarted(object sender, int chapter, int section, int page)
 {
     StackItemFullAnimationStarted(sender, chapter, section, page);
     selectedItem = (IStackItem)sender;
 }