Exemplo n.º 1
0
 public void RemoveCommandAtSelected()
 {
     if (SelectedItem != null && SelectedItem.parent != null)
     {
         SelectedItem.ParentList.RemoveCommandAt(SelectedItem.GetIndex());
         SelectItem(null);
     }
 }
Exemplo n.º 2
0
        public CommandItem AddCommandAtSelected(EventCommand command)
        {
            if (SelectedItem != null && SelectedItem.parent != null)
            {
                int index = SelectedItem.GetIndex();
                if (index == -1)
                {
                    throw new InvalidOperationException("Selected Item is not a member of the CommandListView. ");
                }

                return(SelectedItem.ParentList.AddCommandAt(index + 1, command));
            }
            else
            {
                return(RootCommandListView.AddCommandAt(-1, command));
            }
        }