Exemplo n.º 1
0
        private void items_ItemsChanged(RadItemCollection changed, RadItem target, ItemsChangeOperation operation)
        {
            RadGalleryItem item = target as RadGalleryItem;

            if (item != null)
            {
                switch (operation)
                {
                case ItemsChangeOperation.Inserted:
                    item.Click      += new EventHandler(galleryItem_Clicked);
                    item.MouseHover += new EventHandler(item_MouseHover);
                    if (this.GetBitState(ZoomItemsStateKey))
                    {
                        item.AddBehavior(this.zoomBehavior);
                    }
                    item.Owner = this;
                    item.StretchHorizontally = false;
                    item.StretchVertically   = false;

                    break;

                case ItemsChangeOperation.Removed:
                    item.Click      -= new EventHandler(galleryItem_Clicked);
                    item.MouseHover -= new EventHandler(item_MouseHover);
                    break;
                }
            }
            this.SetUpDownButtons();
        }
Exemplo n.º 2
0
        private void items_ItemsChanged(
            RadItemCollection changed,
            RadItem target,
            ItemsChangeOperation operation)
        {
            RadGalleryItem radGalleryItem = (RadGalleryItem)target;

            switch (operation)
            {
            case ItemsChangeOperation.Inserted:
                radGalleryItem.Click      += new EventHandler(this.galleryItem_Clicked);
                radGalleryItem.MouseHover += new EventHandler(this.item_MouseHover);
                if (this.GetBitState(35184372088832L))
                {
                    radGalleryItem.AddBehavior((PropertyChangeBehavior)this.zoomBehavior);
                }
                radGalleryItem.Owner = this;
                radGalleryItem.StretchHorizontally = false;
                radGalleryItem.StretchVertically   = false;
                break;

            case ItemsChangeOperation.Removed:
                radGalleryItem.Click      -= new EventHandler(this.galleryItem_Clicked);
                radGalleryItem.MouseHover -= new EventHandler(this.item_MouseHover);
                break;
            }
            this.SetUpDownButtons();
        }