Beispiel #1
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            var currentItem = (MenuElementTemplate)templatesDropdown.SelectedItem;
            var element     = new MenuElement(currentItem);

            graphWindow.AddElement(element.Element);
            elementsList.Items.Add(element);
        }
Beispiel #2
0
        private void RemoveButton_Click(object sender, EventArgs e)
        {
            MenuElement[] selectionCopy = new MenuElement[elementsList.SelectedItems.Count];
            elementsList.SelectedItems.CopyTo(selectionCopy, 0);

            foreach (var item in selectionCopy)
            {
                graphWindow.RemoveElement(item.Element);
                elementsList.Items.Remove(item);
            }
        }