Exemplo n.º 1
0
        private void OnMenuItemMoveUp(object sender, EventArgs e)
        {
            Tab selTab = this.LastSelectedTool as Tab;

            if (selTab != null && selTab.Owner != null)
            {
                TabCollection tabCollection = selTab.Owner.Categories;
                int           index         = tabCollection.IndexOf(selTab);
                if (index > 0)
                {
                    bool allowDelete = selTab.AllowDelete;
                    try {
                        selTab.AllowDelete = true;
                        tabCollection.RemoveAt(index);
                        tabCollection.Insert(index - 1, selTab);
                    } finally {
                        selTab.AllowDelete = allowDelete;
                    }
                }
            }
            Item selItem = this.LastSelectedTool as Item;

            if (selItem != null && selItem.Owner != null)
            {
                ItemCollection itemCollection = selItem.Owner.Items;
                int            index          = itemCollection.IndexOf(selItem);
                if (index > 0)
                {
                    itemCollection.RemoveAt(index);
                    itemCollection.Insert(index - 1, selItem);
                }
            }
        }
Exemplo n.º 2
0
        public void OnUiElementClick(MouseEventArgs args, UiElement item)
        {
            foreach (var tab in TabCollection)
            {
                tab.IsSelected = false;
            }
            item.IsSelected = true;

            TabSelectEventArgs tabControlComponent = new TabSelectEventArgs(item, TabCollection.IndexOf(item), args);

            OnTabSelectCallBack.InvokeAsync(tabControlComponent);
        }