Ejemplo n.º 1
0
        private void addChild(object sender, RoutedEventArgs e)
        {
            BodyPart childBodyPart = new BodyPart();
            AddBodyPartWindow addChildWindow = new AddBodyPartWindow();
            addChildWindow.parent = bodyPart;
            addChildWindow.ShowDialog();

            if (addChildWindow.createdPart == true)
            {
                MainWindow.bodyParts.Add(addChildWindow.bodyPart);
                BodyPartItem bodyPartItem = new BodyPartItem(MainWindow.bodyParts.Last().name, addChildWindow.bodyPart);
                MainWindow.bodyPartItems.Add(bodyPartItem);
                Core.mainWindow.addToStackPanel(bodyPartItem);
            }
        }
Ejemplo n.º 2
0
        private void editBodyPart(object sender, RoutedEventArgs e)
        {
            int index;
            AddBodyPartWindow editPartWindow = new AddBodyPartWindow();

            editPartWindow.edit(bodyPart);
            editPartWindow.ShowDialog();

            MainWindow.bodyPartItems.Find(
                delegate(BodyPartItem item)
                {
                    if (item.bodyPart == this.bodyPart)
                    {
                        return true;
                    }
                    {
                        return false;
                    }
                }).bodyPart = this.bodyPart;

            editButton.Content = bodyPart.name;
            Core.mainWindow.StckPanel_Characteristics.InvalidateVisual();
        }
Ejemplo n.º 3
0
        //-------------------------------
        //Physical Characteristics Tab
        private void Btn_NewPart_Click(object sender, RoutedEventArgs e)
        {
            AddBodyPartWindow addBodyPart = new AddBodyPartWindow();
            addBodyPart.Owner = this;
            addBodyPart.ShowDialog();

            if (addBodyPart.createdPart == true)
            {
                bodyParts.Add(addBodyPart.bodyPart);
                BodyPartItem bodyPartItem = new BodyPartItem(bodyParts.Last().name, addBodyPart.bodyPart);
                bodyPartItems.Add(bodyPartItem);
                addToStackPanel(bodyPartItem);
            }
        }