コード例 #1
0
        protected int EnsureItemToChildIndex(int itemIndex)
        {
            RadElement element = (RadElement)this.items.GetVirtualData(itemIndex);

            int childIndex = this.Children.IndexOf(element);

            if (childIndex != -1)
            {
                return(childIndex);
            }
            CarouselContentItem childContainer = new CarouselContentItem(element);

            childContainer.SetOwner(this.owner);
            childContainer.AddBehavior(this.carouselItemBehavior);
            this.CarouselPath.InitializeItem(childContainer, this.AnimationsApplied);
            this.Children.Add(childContainer);

//#if Marker
//            RadButtonElement e = element as RadButtonElement;
//            if (e != null && e.Tag != null)
//            {
//                int i = (int)e.Tag;
//                CarouselPathAnimationData data = GetItemAnimationData(this.Children.Count - 1);
//                data.marker = i;
//            }
//#endif

            return(this.Children.Count - 1);
        }
コード例 #2
0
        protected int EnsureItemToChildIndex(int itemIndex)
        {
            RadElement virtualData = (RadElement)this.items.GetVirtualData(itemIndex);
            int        num         = this.Children.IndexOf(virtualData);

            if (num != -1)
            {
                return(num);
            }
            CarouselContentItem carouselContentItem = new CarouselContentItem(virtualData);

            carouselContentItem.SetOwner(this.owner);
            carouselContentItem.AddBehavior((PropertyChangeBehavior)this.carouselItemBehavior);
            this.CarouselPath.InitializeItem((VisualElement)carouselContentItem, (object)this.AnimationsApplied);
            this.Children.Add((RadElement)carouselContentItem);
            return(this.Children.Count - 1);
        }