public SearchResultsContent(InitRecipes init, List <Recipe> recipeList) : this() { InitializeComponent(); this.DisplayedRecipes = recipeList; this.Init = init; if (DisplayedRecipes.Count == 0) { Label lbl = new Label(); lbl.Content = "No recipes to display. Try removing some of your filters."; lbl.FontSize = 18; outerPanel.Children.Add(lbl); } else { foreach (Recipe rcp in DisplayedRecipes) { Button btn = new Button(); btn.Background = Brushes.Transparent; RecipeDisplaySmall _displayCard = new RecipeDisplaySmall(rcp); btn.Content = _displayCard; btn.Click += (sender, eventArgs) => { Switcher.SwitchTopPanel(new RecipeHeader(rcp)); Switcher.SwitchContentPanel(new RecipeDisplayContent(this.Init, rcp)); }; outerPanel.Children.Add(btn); } } }
public HomePageContent(InitRecipes init, List <Recipe> recipeList) : this() { InitializeComponent(); this.FeaturedRecipes = recipeList; this.Init = init; foreach (Recipe rcp in FeaturedRecipes) { Button btn = new Button(); btn.Background = Brushes.Transparent; RecipeDisplaySmall _displayCard = new RecipeDisplaySmall(rcp); btn.Content = _displayCard; btn.Click += (sender, eventArgs) => { Switcher.SwitchTopPanel(new RecipeHeader(rcp)); Switcher.SwitchContentPanel(new RecipeDisplayContent(this.Init, rcp)); }; outerPanel.Children.Add(btn); } }