You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SAE-2.01/MCTG/Views/ContentPages/AddRecipe.xaml

94 lines
5.9 KiB

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Views.AddRecipe"
Title="AddRecipe"
xmlns:local="clr-namespace:Views"
x:Name="nAddRecipe">
<ScrollView>
<VerticalStackLayout>
<local:MiniHeader
TitleMini="Ajouter une recette"
NeedReturn="True"
HeightRequest="100"/>
<Grid ColumnDefinitions="auto, auto, auto"
RowDefinitions="auto,auto,auto,auto,auto,auto, auto, auto, auto,auto"
Margin="50,20,20,20">
<Label Text="Titre de la recette :"/>
<Entry Placeholder="Saisie du texte de la recette correspondante"
Grid.Row="1"
Margin="10"
Text="{Binding TitleRecipe, Mode=OneWayToSource}"
x:Name="RecipeName"/>
<Label Text="Type de la recette" Grid.Row="2"/>
<RadioButton x:Name="CheckEntree" Grid.Row="3" Margin="10,0,20,0" />
<Label Text="Entrée" Grid.Row="3" Margin="40,20"/>
<RadioButton x:Name="CheckPlat" Grid.Row="3" Margin="90,0" />
<Label Text="Plat" Grid.Row="3" Margin="120,20"/>
<RadioButton x:Name="CheckDessert" Grid.Row="3" Margin="155,0" />
<Label Text="Dessert" Grid.Row="3" Margin="185,20"/>
<Button Text="pick photo" Clicked="PickPhoto" Grid.Row="1" Grid.Column="1"/>
<Button Text="Import recipe (json)" Clicked="Import_Clicked" Grid.Row="1" Grid.Column="2"/>
<Label Text="Type de priorité :" Grid.Row="4" Margin="0,10,0,20"/>
<VerticalStackLayout Grid.Row="5">
<HorizontalStackLayout RadioButtonGroup.GroupName="PriorityGroup">
<Label Text="Recettes Economiques" VerticalOptions="Center"/>
<RadioButton x:Name="checkEconomique"/>
</HorizontalStackLayout>
<HorizontalStackLayout RadioButtonGroup.GroupName="PriorityGroup">
<Label Text="Recettes Rapides" VerticalOptions="Center"/>
<RadioButton x:Name="checkFast"/>
</HorizontalStackLayout>
<HorizontalStackLayout RadioButtonGroup.GroupName="PriorityGroup">
<Label Text="Recettes Faciles" VerticalOptions="Center"/>
<RadioButton x:Name="checkEasy"/>
</HorizontalStackLayout>
<HorizontalStackLayout RadioButtonGroup.GroupName="PriorityGroup">
<Label Text="Recettes Légères" VerticalOptions="Center"/>
<RadioButton x:Name="checkLight"/>
</HorizontalStackLayout>
<HorizontalStackLayout RadioButtonGroup.GroupName="PriorityGroup">
<Label Text="Recettes Gourmandes" VerticalOptions="Center"/>
<RadioButton x:Name="checkGourmet"/>
</HorizontalStackLayout>
</VerticalStackLayout>
<Label Text="Saisir les étapes de la recette " Grid.Row="6" Margin="0,15" />
<HorizontalStackLayout Grid.Row="7" BindingContext="{Binding PreparationStep}">
<Editor Placeholder="Description de l'étape de la recette"
Text ="{Binding Description}"
x:Name="PreparationDescription"
MaximumWidthRequest="300"
MinimumWidthRequest="299"
AutoSize="TextChanges"/>
<Entry Margin="12,0"
IsReadOnly="True"
Text ="{Binding PreparationStepOrder, Source={x:Reference nAddRecipe}}"
x:Name="PreparationOrder"/>
</HorizontalStackLayout>
<HorizontalStackLayout Grid.Row="8" Margin="20">
<Button WidthRequest="100" Text="Ajouter" TextColor="Black" Margin="20,0,20,0" Clicked="AddStepRecipe"/>
<Button WidthRequest="100" Text="Précédent" TextColor="Black" Margin="20,0" Clicked="RemoveStepRecipe"/>
</HorizontalStackLayout>
<Label Text="Saisir les ingrédients de la recette (nom, quantité, unité)" Grid.Row="6" Grid.Column="1" Margin="50,15"/>
<HorizontalStackLayout Grid.Row="7" Grid.Column="1" BindingContext="{Binding Ingredient}">
<Entry Placeholder="Nom de l'ingrédient"
Margin="12,0,0,0" WidthRequest="500"
Text="{Binding Name, Mode=OneWayToSource}"
x:Name="nameIngredient"/>
<Entry Placeholder="1"
Text="{Binding QuantityI.Number , Mode=OneWayToSource}"
x:Name="quantityNumber"/>
<Picker ItemsSource= "{Binding UnitList, Source={x:Reference nAddRecipe}}" x:Name="UnitPicker"/>
</HorizontalStackLayout>
<HorizontalStackLayout Grid.Row="8" Grid.Column="1" Margin="20">
<Button WidthRequest="100" Text="Ajouter" TextColor="Black" Margin="20,0,20,0" Clicked="AddIngredient"/>
<Button WidthRequest="100" Text="Précédent" TextColor="Black" Margin="20,0" Clicked="RemoveIngredient"/>
</HorizontalStackLayout>
<Button Grid.Row="10" Grid.ColumnSpan="2" Text="Valider" TextColor="Black" Clicked="AddRecipeValidation"/>
</Grid>
</VerticalStackLayout>
</ScrollView>
</ContentPage>