From c669811f0d8aa2ca5b5eadc7d4a9b2e03aa4bbad Mon Sep 17 00:00:00 2001 From: "maxime.BATISTA@etu.uca.fr" Date: Mon, 10 Apr 2023 21:59:58 +0200 Subject: [PATCH 1/3] add recipe view page --- AppShell.xaml | 5 + MainPage.xaml | 48 --------- MainPage.xaml.cs | 29 ------ MauiProgram.cs | 3 +- Resources/Fonts/Poppins-Medium.ttf | Bin 0 -> 152860 bytes Resources/Images/earth_off.svg | 3 + Resources/Images/earth_on.svg | 3 + Resources/Images/minus.svg | 1 + Resources/Images/password_icon.svg | 2 +- Resources/Images/plus.svg | 1 + Resources/Styles/Styles.xaml | 32 +++++- ShoopNCook - Backup (1).csproj | 87 +++++++++++++++++ ShoopNCook.csproj | 12 +++ Views/LoginPage.xaml | 1 - Views/RecipePage.xaml | 152 +++++++++++++++++++++++++++++ Views/RecipePage.xaml.cs | 9 ++ Views/SearchPage.xaml | 3 +- 17 files changed, 306 insertions(+), 85 deletions(-) delete mode 100644 MainPage.xaml delete mode 100644 MainPage.xaml.cs create mode 100644 Resources/Fonts/Poppins-Medium.ttf create mode 100644 Resources/Images/earth_off.svg create mode 100644 Resources/Images/earth_on.svg create mode 100644 Resources/Images/minus.svg create mode 100644 Resources/Images/plus.svg create mode 100644 ShoopNCook - Backup (1).csproj create mode 100644 Views/RecipePage.xaml create mode 100644 Views/RecipePage.xaml.cs diff --git a/AppShell.xaml b/AppShell.xaml index 64dfc90..cc6ad48 100644 --- a/AppShell.xaml +++ b/AppShell.xaml @@ -23,5 +23,10 @@ Title="Search Page" ContentTemplate="{DataTemplate views:SearchPage}" Route="Search" /> + + \ No newline at end of file diff --git a/MainPage.xaml b/MainPage.xaml deleted file mode 100644 index 3c3aa3e..0000000 --- a/MainPage.xaml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/Views/RecipePage.xaml.cs b/Views/RecipePage.xaml.cs new file mode 100644 index 0000000..f5b479b --- /dev/null +++ b/Views/RecipePage.xaml.cs @@ -0,0 +1,9 @@ +namespace ShoopNCook.Views; + +public partial class RecipePage : ContentPage +{ + public RecipePage() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Views/SearchPage.xaml b/Views/SearchPage.xaml index 696c3b0..7668ea6 100644 --- a/Views/SearchPage.xaml +++ b/Views/SearchPage.xaml @@ -72,13 +72,13 @@ Grid.Row="3" ColumnSpacing="10" ColumnDefinitions="*, *"> + From 03d02a606ba483f5e23a6a40924514df7e31c7e2 Mon Sep 17 00:00:00 2001 From: "maxime.BATISTA@etu.uca.fr" Date: Tue, 11 Apr 2023 16:31:29 +0200 Subject: [PATCH 2/3] Add bindings to Recipe views --- Resources/Images/password_icon.svg | 2 +- Resources/Images/plus.svg | 4 +- ShoopNCook.csproj | 3 + Views/IngredientView.xaml | 24 ++++++ Views/IngredientView.xaml.cs | 41 +++++++++++ Views/RecipePage.xaml | 114 ++++++++++++++++------------- Views/RecipePage.xaml.cs | 86 +++++++++++++++++++++- 7 files changed, 219 insertions(+), 55 deletions(-) create mode 100644 Views/IngredientView.xaml create mode 100644 Views/IngredientView.xaml.cs diff --git a/Resources/Images/password_icon.svg b/Resources/Images/password_icon.svg index 7a823a5..e242a3d 100644 --- a/Resources/Images/password_icon.svg +++ b/Resources/Images/password_icon.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/Resources/Images/plus.svg b/Resources/Images/plus.svg index aa718df..ffcb182 100644 --- a/Resources/Images/plus.svg +++ b/Resources/Images/plus.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/ShoopNCook.csproj b/ShoopNCook.csproj index ab4d16c..de34a4b 100644 --- a/ShoopNCook.csproj +++ b/ShoopNCook.csproj @@ -77,6 +77,9 @@ + + MSBuild:Compile + MSBuild:Compile diff --git a/Views/IngredientView.xaml b/Views/IngredientView.xaml new file mode 100644 index 0000000..693cdde --- /dev/null +++ b/Views/IngredientView.xaml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/Views/IngredientView.xaml.cs b/Views/IngredientView.xaml.cs new file mode 100644 index 0000000..01288d8 --- /dev/null +++ b/Views/IngredientView.xaml.cs @@ -0,0 +1,41 @@ +namespace ShoopNCook.Views; + +public partial class IngredientView : ContentView +{ + + public static readonly BindableProperty NameProperty = + BindableProperty.Create(nameof(Name), typeof(string), typeof(IngredientView), default(string)); + + public static readonly BindableProperty QuantityProperty = + BindableProperty.Create(nameof(Quantity), typeof(float), typeof(IngredientView), default(float)); + + public static readonly BindableProperty UnitProperty = + BindableProperty.Create(nameof(Unit), typeof(string), typeof(IngredientView), default(string)); + + public string Name + { + get => (string)GetValue(NameProperty); + set => SetValue(NameProperty, value); + } + + public float Quantity + { + get => (float)GetValue(QuantityProperty); + set => SetValue(QuantityProperty, value); + } + + public string Unit + { + get => (string)GetValue(UnitProperty); + set => SetValue(UnitProperty, value); + } + + public IngredientView(string name, float quantity, string unit) + { + InitializeComponent(); + + Name = name; + Quantity = quantity; + Unit = unit; + } +} \ No newline at end of file diff --git a/Views/RecipePage.xaml b/Views/RecipePage.xaml index 0e2527a..95bb063 100644 --- a/Views/RecipePage.xaml +++ b/Views/RecipePage.xaml @@ -25,12 +25,14 @@ Source="arrow_back.svg"/>