public void OpenStack(int index) { if (stacksVector[index].IsStack) { stacksVector[index].animateToShowItems(0); } selectedStack = stacksVector[index]; }
void loadControls() { if (dataSource != null) { NumberOfStacks = dataSource.Sections.Count; float stackViewXPosition = 400; for (int i = 0; i < NumberOfStacks; i++) { var stack = new IStackView(stackViewXPosition); stack.StackItemCreated += HandleStackItemCreated; stack.StackNumber = i; stack.Chapter = Chapter; stack.Section = i; stack.Source = dataSource.Sections[i]; stack.StackViewsUpdate += HandleStackViewsUpdate; stack.StackViewsDidFinish += HandleStackViewsDidFinish; stack.StackItemFullAnimationStarted += HandleStackItemFullAnimationStarted; stack.StackItemFullAnimationCompleted += HandleStackItemFullAnimationCompleted; stack.StackItemThumbAnimationStarted += HandleStackItemThumbAnimationStarted; stack.StackItemThumbAnimationCompleted += HandleStackItemThumbAnimationCompleted; Add(stack); stacksVector.Add(stack); stackViewXPosition += (float)stack.Frame.Width; } //header headerControl.Author = dataSource.Author; headerControl.Title = dataSource.Title; headerControl.DescriptionText = dataSource.Description; headerControl.ChapterColor = dataSource.ChapterColor; CGRect tmp = Frame; tmp.Width = stackViewXPosition; Frame = tmp; } }
void HandleStackItemFullAnimationStarted(object sender, int chapter, int section, int page) { StackItemFullAnimationStarted(sender, chapter, section, page); selectedStack = stacksVector[section]; }