Exemplo n.º 1
0
        protected override void InitializeFields()
        {
            base.InitializeFields();

            this.itemDragService   = new RadPageViewDragDropService(this);
            this.items             = new RadPageViewReadonlyCollection <RadPageViewItem>();
            this.actionMouseButton = MouseButtons.Left;

            this.itemListMenu = new RadContextMenu();
            this.itemListMenu.DropDownClosed += OnItemListMenu_DropDownClosed;

            this.StretchHorizontally       = true;
            this.StretchVertically         = true;
            this.AllowDrop                 = true;
            this.UpdateSelectedItemContent = true;
        }
        protected override void SetItemIndex(int currentIndex, int newIndex)
        {
            RadPageViewExplorerBarItem explorerBarItemToMove          = this.Items[currentIndex] as RadPageViewExplorerBarItem;
            RadPageViewExplorerBarItem explorerBarItemTargetIndexItem = this.Items[newIndex] as RadPageViewExplorerBarItem;

            RadPageViewItem item = this.Items[currentIndex];
            RadPageViewReadonlyCollection <RadPageViewItem> items = this.Items as RadPageViewReadonlyCollection <RadPageViewItem>;

            items.RemoveAt(currentIndex);
            items.Insert(newIndex, item);
            int sourceChildrenIndex = this.ItemsParent.Children.IndexOf(explorerBarItemToMove);
            int targetChildrenIndex = this.ItemsParent.Children.IndexOf(explorerBarItemTargetIndexItem);

            this.ItemsParent.Children.Move(sourceChildrenIndex, targetChildrenIndex);
            this.ItemsParent.InvalidateMeasure();
        }