示例#1
0
        protected override void SynchronizeProperties()
        {
            base.SynchronizeProperties();
            CardListViewElement viewElement = this.Data.Owner.ViewElement as CardListViewElement;

            if (viewElement == null)
            {
                return;
            }
            viewElement.CompareContainers(this.layoutContainer, this);
            this.UpdateGroupItemsExpandedState(viewElement);
            List <LayoutControlItemBase> allChildItems = viewElement.GetAllChildItems((RadItemCollection)this.CardContainer.Items);

            this.SynchronizeCardViewItems(viewElement, allChildItems);
            foreach (LayoutControlItemBase layoutControlItemBase in allChildItems)
            {
                ((RadCardViewElement)this.Data.Owner).OnCardViewItemFormatting(new CardViewItemFormattingEventArgs(layoutControlItemBase, this));
            }
        }
示例#2
0
        private void UpdateGroupItemsExpandedState(CardListViewElement cardElement)
        {
            List <LayoutControlItemBase> allChildItems = cardElement.GetAllChildItems((RadItemCollection)this.CardContainer.Items);
            List <string> collapsedItemNames           = this.GetCollapsedItemNames(cardElement);

            foreach (LayoutControlItemBase layoutControlItemBase in allChildItems)
            {
                LayoutControlGroupItem controlGroupItem = layoutControlItemBase as LayoutControlGroupItem;
                if (controlGroupItem != null)
                {
                    bool flag = true;
                    if (collapsedItemNames.Contains(controlGroupItem.Name))
                    {
                        flag = false;
                    }
                    controlGroupItem.isAttaching = true;
                    controlGroupItem.IsExpanded  = flag;
                    controlGroupItem.isAttaching = false;
                }
            }
        }