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()
{ {

@ -1,27 +1,27 @@
namespace Views; namespace Views;
public partial class MiniHeader : ContentView public partial class MiniHeader : ContentView
{ {
public MiniHeader() public MiniHeader()
{ {
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
{ {
get => (string)GetValue(TitleMiniProperty); get => (string)GetValue(TitleMiniProperty);
set => SetValue(TitleMiniProperty, value); set => SetValue(TitleMiniProperty, value);
} }
// bind NeedReturn // bind NeedReturn
public static readonly BindableProperty NeedReturnProperty = public static readonly BindableProperty NeedReturnProperty =
BindableProperty.Create("NeedReturn", typeof(bool), typeof(Border), false); BindableProperty.Create("NeedReturn", typeof(bool), typeof(Border), false);
public bool NeedReturn public bool NeedReturn
{ {
get => (bool)GetValue(NeedReturnProperty); get => (bool)GetValue(NeedReturnProperty);
set => SetValue(NeedReturnProperty, value); set => SetValue(NeedReturnProperty, value);
} }
} }

@ -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"
<Button Grid.Column="1" Padding="10,10,10,10"
Grid.Row="2" Text="{Binding Content}"
Background="#FFCB9A" Margin="0,0,15,0"/>
Text="Voir plus" <Button Grid.Column="1"
TextColor="Black"/> Grid.Row="2"
</Grid> Background="#FFCB9A"
Text="Voir plus"
TextColor="Black"/>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Border> </Border>
</VerticalStackLayout> </VerticalStackLayout>

@ -1,106 +1,106 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net7.0-android</TargetFrameworks> <TargetFrameworks>net7.0-android</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks> <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('ios'))">$(TargetFrameworks);net7.0-ios</TargetFrameworks> <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('ios'))">$(TargetFrameworks);net7.0-ios</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('maccatalyst'))">$(TargetFrameworks);net7.0-maccatalyst</TargetFrameworks> <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('maccatalyst'))">$(TargetFrameworks);net7.0-maccatalyst</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET --> <!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> --> <!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<RootNamespace>Views</RootNamespace> <RootNamespace>Views</RootNamespace>
<UseMaui>true</UseMaui> <UseMaui>true</UseMaui>
<SingleProject>true</SingleProject> <SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<!-- Display name --> <!-- Display name -->
<ApplicationTitle>Views</ApplicationTitle> <ApplicationTitle>Views</ApplicationTitle>
<!-- App Identifier --> <!-- App Identifier -->
<ApplicationId>com.companyname.views</ApplicationId> <ApplicationId>com.companyname.views</ApplicationId>
<ApplicationIdGuid>79cbc22d-7cee-47b2-af9f-b25e09cea0af</ApplicationIdGuid> <ApplicationIdGuid>79cbc22d-7cee-47b2-af9f-b25e09cea0af</ApplicationIdGuid>
<!-- Versions --> <!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion> <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion> <ApplicationVersion>1</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion> <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
<Configurations>Debug;Release;CI</Configurations> <Configurations>Debug;Release;CI</Configurations>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<!-- App Icon --> <!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" /> <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
<!-- Splash Screen --> <!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" /> <MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
<!-- Images --> <!-- Images -->
<MauiImage Include="Resources\Images\*" /> <MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" /> <MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
<!-- Custom Fonts --> <!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" /> <MauiFont Include="Resources\Fonts\*" />
<!-- Raw Assets (also remove the "Resources\Raw" prefix) --> <!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" /> <MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="5.0.0" /> <PackageReference Include="CommunityToolkit.Maui" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\DataPersistence\DataPersistence.csproj" /> <ProjectReference Include="..\DataPersistence\DataPersistence.csproj" />
<ProjectReference Include="..\Model\Model.csproj" /> <ProjectReference Include="..\Model\Model.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<MauiXaml Update="AddRecipe.xaml"> <MauiXaml Update="AddRecipe.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="ContainerBase.xaml"> <MauiXaml Update="ContainerBase.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="ContainerFlyout.xaml"> <MauiXaml Update="ContainerFlyout.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="CustomHeader.xaml"> <MauiXaml Update="CustomHeader.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="Login.xaml"> <MauiXaml Update="Login.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="MiniHeader.xaml"> <MauiXaml Update="MiniHeader.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="MyPosts.xaml"> <MauiXaml Update="MyPosts.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="MyProfil.xaml"> <MauiXaml Update="MyProfil.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="RecipeCase.xaml"> <MauiXaml Update="RecipeCase.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="RecipeReviews.xaml"> <MauiXaml Update="RecipeReviews.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="ReturnButton.xaml"> <MauiXaml Update="ReturnButton.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="UserReview.xaml"> <MauiXaml Update="UserReview.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="ViewRecette.xaml"> <MauiXaml Update="ViewRecette.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
</ItemGroup> </ItemGroup>
</Project> </Project>

Loading…
Cancel
Save