link between Home and ViewRecette finished. remind binding of rewiew and navigation to review's page
continuous-integration/drone/push Build is passing Details

pull/53/head
Roxane ROSSETTO 2 years ago
parent e88eb58e70
commit a3350f9230

@ -67,7 +67,7 @@ namespace Model
public override string ToString() public override string ToString()
{ {
return $"{Number}{UnitQ}"; return $"{Number} {UnitQ} de : ";
} }
} }
} }

@ -63,9 +63,7 @@
<Label Text="Saisir les ingrédients de la recette" Grid.Row="6" Grid.Column="1" Margin="50,15"/> <Label Text="Saisir les ingrédients de la recette" Grid.Row="6" Grid.Column="1" Margin="50,15"/>
<HorizontalStackLayout Grid.Row="7" Grid.Column="1"> <HorizontalStackLayout Grid.Row="7" Grid.Column="1">
<Entry Placeholder="Nom de l'ingrédient" Margin="12,0,50,0" WidthRequest="500"/> <Entry Placeholder="Nom de l'ingrédient" Margin="12,0,50,0" WidthRequest="500"/>
<Picker Title="Unité"> <Picker ItemsSource= "{Binding UnitList}"/>
</Picker>
</HorizontalStackLayout> </HorizontalStackLayout>
<HorizontalStackLayout Grid.Row="8" Grid.Column="1" Margin="20"> <HorizontalStackLayout Grid.Row="8" Grid.Column="1" Margin="20">
<Button WidthRequest="100" Text="Précédent" TextColor="Black" Margin="20,0,20,0"/> <Button WidthRequest="100" Text="Précédent" TextColor="Black" Margin="20,0,20,0"/>

@ -9,10 +9,11 @@ namespace Views
public partial class AddRecipe : ContentPage public partial class AddRecipe : ContentPage
{ {
public MasterManager MasterMgr => (App.Current as App).MasterMgr; public MasterManager MasterMgr => (App.Current as App).MasterMgr;
public List<Unit> UnitList { get; set; } = new List<Unit> { Unit.unit, Unit.kG, Unit.mG, Unit.G, Unit.L, Unit.cL, Unit.mL };
public AddRecipe() public AddRecipe()
{ {
InitializeComponent(); InitializeComponent();
BindingContext = this;
} }
} }
} }

@ -30,9 +30,6 @@ namespace Views
currentRecipe = value; currentRecipe = value;
OnPropertyChanged(nameof(CurrentRecipe)); OnPropertyChanged(nameof(CurrentRecipe));
} }
} }
//collection de recette de l'application //collection de recette de l'application

@ -9,7 +9,7 @@ namespace Views
{ {
public MasterManager MasterMgr => (App.Current as App).MasterMgr; public MasterManager MasterMgr => (App.Current as App).MasterMgr;
public User user => (App.Current as App).CurrentUser; public User user => (App.Current as App).CurrentUser;
public Recipe recipe => (App.Current as App).CurrentRecipe; public Recipe Recipe => (App.Current as App).CurrentRecipe;
public RecipeCollection AllRecipes => (App.Current as App).AllRecipes; public RecipeCollection AllRecipes => (App.Current as App).AllRecipes;
public Home() public Home()
{ {

@ -7,8 +7,8 @@ public partial class MiniHeader : ContentView
InitializeComponent(); InitializeComponent();
} }
public readonly BindableProperty TitleMiniProperty = public static readonly BindableProperty TitleMiniProperty =
BindableProperty.Create(nameof(TitleMini), typeof(string), typeof(MiniHeader), "Erreur de titre"); BindableProperty.Create(nameof(TitleMini), typeof(string), typeof(Label), "Erreur de titre");
public string TitleMini public string TitleMini
{ {

@ -7,7 +7,7 @@
x:Name="nrecipe"> x:Name="nrecipe">
<VerticalStackLayout BindingContext="{Binding Recipe}"> <VerticalStackLayout BindingContext="{Binding Recipe}">
<local:MiniHeader <local:MiniHeader
TitleMini="{Binding Toto}" TitleMini="{Binding Title}"
NeedReturn="True" NeedReturn="True"
HeightRequest="100"/> HeightRequest="100"/>
<Image <Image
@ -16,8 +16,8 @@
Aspect="AspectFill"/> Aspect="AspectFill"/>
<Grid ColumnDefinitions="200,*"> <Grid ColumnDefinitions="200,*">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="*"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
@ -25,49 +25,39 @@
Text="Ingrédients :" Text="Ingrédients :"
FontSize="Subtitle" FontSize="Subtitle"
FontAttributes="Bold"/> FontAttributes="Bold"/>
<Label Margin="10,60,20,0" <ListView Margin="10,60,20,0"
Grid.RowSpan="4"> Grid.RowSpan="4"
<Label.Text> ItemsSource="{Binding Ingredients}">
<ListView.ItemTemplate>
- 6 pommes <DataTemplate>
- 6 poires <ViewCell>
- une banane <Grid ColumnDefinitions="auto,auto, auto"
- 3 fraises RowDefinitions="auto">
- 400g de farine <Label Text="{Binding QuantityI}" Grid.Column="0" Grid.Row="0"/>
- 200g de beurre <Label Text="{Binding Name}" Grid.Column=" 1" Grid.Row="0"/>
- 150g de pépite de chocolat </Grid>
</Label.Text> </ViewCell>
</Label> </DataTemplate>
<Label Margin="10,20,0,0" </ListView.ItemTemplate>
</ListView>
<Label Margin="10,0,20,20"
Grid.Column="1" Grid.Column="1"
Grid.Row="0" Grid.Row="0"
Text="Préparation :" Text="Préparation :"
FontSize="Subtitle" FontSize="Subtitle"
FontAttributes="Bold"/> FontAttributes="Bold"/>
<Label Grid.Column="1" <ListView Margin="10,30,0,0"
Grid.Row="1" Grid.Column="1"
Text="Etape 1"
FontAttributes="Italic"/> ItemsSource="{Binding PreparationSteps}">
<Label Grid.Column="1" <ListView.ItemTemplate>
Grid.Row="1" <DataTemplate>
Margin="10,20,0,0" <TextCell Text="{Binding Order, StringFormat='Etape {0}'}"
Text=" ° Laissez ramollir le beurre à température ambiante. Dans un saladier, malaxez-le avec le sucre"/> Detail="{Binding Description}"/>
<Label Grid.Column="1" </DataTemplate>
Grid.Row="2" </ListView.ItemTemplate>
FontAttributes="Italic" </ListView>
Text="Etape 2"/>
<Label Grid.Column="1"
Grid.Row="2"
Margin="10,20,0,0"
Text=" ° Ajoutez l'oeuf et éventuellement le sucre vanillé. "/>
<Label Grid.Column="1"
Grid.Row="3"
FontAttributes="Italic"
Text="Etape 3"/>
<Label Grid.Column="1"
Grid.Row="3"
Margin="10,20,0,0"
Text=" ° Ajoutez l'oeuf et éventuellement le sucre vanillé. "/>
@ -81,30 +71,37 @@
Padding="20,10,80,20" Padding="20,10,80,20"
Margin="50,100,50,0" Margin="50,100,50,0"
MinimumHeightRequest="200"> MinimumHeightRequest="200">
<Grid ColumnDefinitions="600,*"> <ListView ItemsSource="{Binding Reviews}">
<Grid.RowDefinitions> <ListView.ItemTemplate>
<RowDefinition Height="*"/> <DataTemplate>
<RowDefinition Height="*"/> <Grid ColumnDefinitions="600,*" >
<RowDefinition Height="*"/> <Grid.RowDefinitions>
</Grid.RowDefinitions> <RowDefinition Height="*"/>
<Label Grid.ColumnSpan="2" <RowDefinition Height="*"/>
Grid.Row="0" <RowDefinition Height="*"/>
Text=" Meilleure revue : " </Grid.RowDefinitions>
FontAttributes="Bold"/> <Label Grid.ColumnSpan="2"
<Label Background="#FFCB9A" Grid.Row="0"
Grid.Column="0" Text=" Meilleure revue : "
Grid.Row="1" FontAttributes="Bold"/>
Grid.RowSpan="2" <Label
Padding="10,10,10,10" Background="#FFCB9A"
Text="Recette facile, non prise de tête et agréable à réaliser avec ses grands parents. Le resultat est délicieux, ma famille a adorée." Grid.Column="0"
Margin="0,0,15,0"/> Grid.Row="1"
Grid.RowSpan="2"
Padding="10,10,10,10"
Text="{Binding Content}"
Margin="0,0,15,0"/>
<Button Grid.Column="1"
Grid.Row="2"
Background="#FFCB9A"
Text="Voir plus"
TextColor="Black"/>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<Button Grid.Column="1"
Grid.Row="2"
Background="#FFCB9A"
Text="Voir plus"
TextColor="Black"/>
</Grid>
</Border> </Border>
</VerticalStackLayout> </VerticalStackLayout>

Loading…
Cancel
Save