From 9bac4e84fcd76dd729918213937539af0099c8a7 Mon Sep 17 00:00:00 2001 From: "maxime.BATISTA@etu.uca.fr" Date: Fri, 14 Apr 2023 17:45:49 +0200 Subject: [PATCH] add headed button and add buttons in the more page --- Pages/MorePage.xaml | 25 ++++++---------------- Resources/Images/share.svg | 3 +++ Resources/Images/user_fill.svg | 4 ++++ ShoopNCook.csproj | 5 +++++ Views/HeadedButton.xaml | 28 ++++++++++++++++++++++++ Views/HeadedButton.xaml.cs | 39 ++++++++++++++++++++++++++++++++++ Views/IngredientView.xaml.cs | 6 +++--- 7 files changed, 88 insertions(+), 22 deletions(-) create mode 100644 Resources/Images/share.svg create mode 100644 Resources/Images/user_fill.svg create mode 100644 Views/HeadedButton.xaml create mode 100644 Views/HeadedButton.xaml.cs diff --git a/Pages/MorePage.xaml b/Pages/MorePage.xaml index 6dbfea9..5387f99 100644 --- a/Pages/MorePage.xaml +++ b/Pages/MorePage.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="ShoopNCook.Pages.MorePage" BackgroundColor="{StaticResource BackgroundPrimary}" + xmlns:views="clr-namespace:ShoopNCook.Views" Title="MorePage"> - - - - - + + + + + \ No newline at end of file diff --git a/Resources/Images/share.svg b/Resources/Images/share.svg new file mode 100644 index 0000000..df811c7 --- /dev/null +++ b/Resources/Images/share.svg @@ -0,0 +1,3 @@ + + + diff --git a/Resources/Images/user_fill.svg b/Resources/Images/user_fill.svg new file mode 100644 index 0000000..90e367c --- /dev/null +++ b/Resources/Images/user_fill.svg @@ -0,0 +1,4 @@ + + + + diff --git a/ShoopNCook.csproj b/ShoopNCook.csproj index 1cfb821..23b7a0d 100644 --- a/ShoopNCook.csproj +++ b/ShoopNCook.csproj @@ -62,9 +62,11 @@ + + @@ -83,6 +85,9 @@ + + MSBuild:Compile + MSBuild:Compile diff --git a/Views/HeadedButton.xaml b/Views/HeadedButton.xaml new file mode 100644 index 0000000..26a3f4d --- /dev/null +++ b/Views/HeadedButton.xaml @@ -0,0 +1,28 @@ + + + + + + + + diff --git a/Views/HeadedButton.xaml.cs b/Views/HeadedButton.xaml.cs new file mode 100644 index 0000000..e8691ed --- /dev/null +++ b/Views/HeadedButton.xaml.cs @@ -0,0 +1,39 @@ +using System.Xml.Linq; + +namespace ShoopNCook.Views; + +public partial class HeadedButton : ContentView +{ + + private readonly BindableProperty TextProperty = + BindableProperty.Create("Text", typeof(string), typeof(HeadedButton), "No Text Defined."); + + private readonly BindableProperty HeadColorProperty = + BindableProperty.Create("HeadColor", typeof(string), typeof(HeadedButton), "#FFFFFF"); + + private readonly BindableProperty HeadSourceProperty = + BindableProperty.Create("HeadSource", typeof(string), typeof(HeadedButton), default(string)); + + public string Text + { + get => (string)GetValue(TextProperty); + set => SetValue(TextProperty, value); + } + + public string HeadColor + { + get => (string)GetValue(HeadColorProperty); + set => SetValue(HeadColorProperty, value); + } + + public string HeadSource + { + get => (string)GetValue(HeadSourceProperty); + set => SetValue(HeadSourceProperty, value); + } + + public HeadedButton() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Views/IngredientView.xaml.cs b/Views/IngredientView.xaml.cs index 01288d8..2013447 100644 --- a/Views/IngredientView.xaml.cs +++ b/Views/IngredientView.xaml.cs @@ -3,13 +3,13 @@ namespace ShoopNCook.Views; public partial class IngredientView : ContentView { - public static readonly BindableProperty NameProperty = + private readonly BindableProperty NameProperty = BindableProperty.Create(nameof(Name), typeof(string), typeof(IngredientView), default(string)); - public static readonly BindableProperty QuantityProperty = + private readonly BindableProperty QuantityProperty = BindableProperty.Create(nameof(Quantity), typeof(float), typeof(IngredientView), default(float)); - public static readonly BindableProperty UnitProperty = + private readonly BindableProperty UnitProperty = BindableProperty.Create(nameof(Unit), typeof(string), typeof(IngredientView), default(string)); public string Name