private void saveAdditions()
        {
            ButtonAdd.Background   = (SolidColorBrush) new BrushConverter().ConvertFrom("#bd5555");;
            ButtonAdd.Content      = "Add";
            TextBoxName.IsReadOnly = true;
            TextBoxAge.IsReadOnly  = true;
            ButtonEdit.IsEnabled   = true;
            ButtonDelete.IsEnabled = true;
            ButtonCancel.IsEnabled = true;
            TextBoxName.Background = (SolidColorBrush) new BrushConverter().ConvertFrom("#cf7c7c");
            TextBoxAge.Background  = (SolidColorBrush) new BrushConverter().ConvertFrom("#cf7c7c");

            //=== COMMIT CHANGES ===
            if ((TextBoxName.Text.Length > 0) && (TextBoxAge.Text.Length > 0))
            {
                //get the age
                if (int.TryParse(TextBoxAge.Text, out int age))
                {
                    var RabbitToAdd = new Rabbit()
                    {
                        Name = TextBoxName.Text,
                        Age  = age
                    };
                    //read database and add the new rabbit
                    using (var db = new RabbitDbEntities())
                    {
                        db.Rabbits.Add(RabbitToAdd);
                        db.SaveChanges();
                        //Update the view
                        rabbits = db.Rabbits.ToList();        //gets rabbits
                        ListBoxRabbits.ItemsSource = rabbits; //binds to listbox
                    }
                }
                else
                {
                }
                TextBoxName.Text       = "";
                TextBoxAge.Text        = "";
                ButtonEdit.IsEnabled   = false;
                ButtonCancel.IsEnabled = false;
                ButtonDelete.IsEnabled = false;
            }
        }
        private void ListBoxRabbits_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (ListBoxRabbits.SelectedItem != null)
            {
                //Whenever we select an item in the list, cast it from Object type to Rabbit type in the global rabbit variable
                rabbit = (Rabbit)ListBoxRabbits.SelectedItem;


                //Enable edit and delete if not adding already
                if (ButtonAdd.Content.Equals("Add"))
                {
                    TextBoxName.Text       = rabbit.Name;
                    TextBoxAge.Text        = rabbit.Age.ToString();
                    ButtonEdit.IsEnabled   = true;
                    ButtonDelete.IsEnabled = true;
                    ButtonAdd.IsEnabled    = true;
                }
                if (ButtonAdd.Content.Equals("Save"))
                {
                    TextBoxName.Text = "";
                    TextBoxAge.Text  = "";
                }
            }
        }