private void btbNewIng_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrWhiteSpace(tbxIngName.Text) && string.IsNullOrWhiteSpace(tbxIngPrice.Text) && cbbxIngType.SelectedItem == null) { MessageBox.Show("Du mangler at udfylde et felt"); } else { IngredientType selectedtype = (IngredientType)Enum.Parse(typeof(IngredientType), cbbxIngType.SelectedItem.ToString()); Ingredient ing = new Ingredient(decimal.Parse(tbxIngPrice.Text), tbxIngName.Text, selectedtype); handler.MakeIngredient(ing); handler.GetAllIngredients(); } }