add button all recipes, supp search button
continuous-integration/drone/push Build is passing Details

pull/65/head
Alexandre AGOSTINHO 2 years ago
parent 596e699382
commit 4b1a597f9b

@ -15,11 +15,9 @@
<local:ContainerBase.MyFlyoutContent> <local:ContainerBase.MyFlyoutContent>
<VerticalStackLayout Grid.Row="1"> <VerticalStackLayout Grid.Row="1">
<!-- Research --> <!-- Research -->
<Button <Label
Text="Recherche" Text="Recherche de recettes :" FontSize="14"
ImageSource="search_icon.png" Margin="20, 10, 15, 0"/>
MaximumHeightRequest="20"
Style="{StaticResource button1}"/>
<SearchBar <SearchBar
Placeholder="Mots-clés (ex.: rapide, fromage)" Placeholder="Mots-clés (ex.: rapide, fromage)"
FontAttributes="Italic" TextColor="Black" FontAttributes="Italic" TextColor="Black"
@ -28,6 +26,11 @@
SearchButtonPressed="SearchBar_SearchButtonPressed"/> SearchButtonPressed="SearchBar_SearchButtonPressed"/>
<!-- Direct research --> <!-- Direct research -->
<Button
Text="Toutes les recettes"
ImageSource="home_icon.png"
Style="{StaticResource button1}"
Clicked="AllRecipes_Clicked"/>
<Button <Button
Text="Entrées" Text="Entrées"
ImageSource="flatware_icon.png" ImageSource="flatware_icon.png"
@ -36,11 +39,13 @@
<Button <Button
Text="Plats" Text="Plats"
ImageSource="room_service_icon.png" ImageSource="room_service_icon.png"
Style="{StaticResource button1}"/> Style="{StaticResource button1}"
Clicked="Plats_Clicked"/>
<Button <Button
Text="Desserts" Text="Desserts"
ImageSource="coffee_icon.png" ImageSource="coffee_icon.png"
Style="{StaticResource button1}"/> Style="{StaticResource button1}"
Clicked="Desserts_Clicked"/>
</VerticalStackLayout> </VerticalStackLayout>
</local:ContainerBase.MyFlyoutContent> </local:ContainerBase.MyFlyoutContent>

@ -57,6 +57,7 @@ namespace Views
private void ModifyRecipesDisplayed(RecipeCollection recipes) private void ModifyRecipesDisplayed(RecipeCollection recipes)
{ {
_recipesDisplayed.Clear(); _recipesDisplayed.Clear();
_recipesDisplayed.Description = recipes.Description;
foreach (Recipe recipe in recipes) foreach (Recipe recipe in recipes)
{ {
_recipesDisplayed.Add(recipe); _recipesDisplayed.Add(recipe);
@ -76,7 +77,22 @@ namespace Views
private void Entrees_Clicked(object sender, EventArgs e) private void Entrees_Clicked(object sender, EventArgs e)
{ {
return; ModifyRecipesDisplayed(new RecipeCollection("Entrées", AllRecipe.ToList().FindAll(r => r.Type == RecipeType.Starter).ToArray()));
}
private void Plats_Clicked(object sender, EventArgs e)
{
ModifyRecipesDisplayed(new RecipeCollection("Plats", AllRecipe.ToList().FindAll(r => r.Type == RecipeType.Dish).ToArray()));
}
private void Desserts_Clicked(object sender, EventArgs e)
{
ModifyRecipesDisplayed(new RecipeCollection("Desserts", AllRecipe.ToList().FindAll(r => r.Type == RecipeType.Dessert).ToArray()));
}
private void AllRecipes_Clicked(object sender, EventArgs e)
{
ModifyRecipesDisplayed(AllRecipe);
} }
} }
} }

Loading…
Cancel
Save