private void SearchExecute() { try { if (selectedTitle != null && selectedTitle.Length >= 3) { RecipeList = service.GetRecipesByTitle(RecipeList, selectedTitle); } if (selectedType != null) { RecipeList = service.GetRecipesByType(RecipeList, selectedType); } if (ChooseIngredientsViewModel.staticSelectedIngredients != null) { RecipeList = service.GetRecipesByIngredients(RecipeList, ChooseIngredientsViewModel.staticSelectedIngredients); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }