commit
41689ae1f5
@ -0,0 +1,80 @@
|
|||||||
|
<?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">
|
||||||
|
<VerticalStackLayout>
|
||||||
|
<local:MiniHeader
|
||||||
|
TitleMini="Ajouter une recette"
|
||||||
|
NeedReturn="True"
|
||||||
|
HeightRequest="100"/>
|
||||||
|
<Grid ColumnDefinitions="auto, *"
|
||||||
|
RowDefinitions="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"/>
|
||||||
|
<Label Text="Type de la recette" Grid.Row="2"/>
|
||||||
|
<CheckBox x:Name="CheckEntree" Grid.Row="3" Margin="10,0,20,0" />
|
||||||
|
<Label Text="Entrée" Grid.Row="3" Margin="40,20"/>
|
||||||
|
<CheckBox x:Name="CheckPlat" Grid.Row="3" Margin="90,0" />
|
||||||
|
<Label Text="Plat" Grid.Row="3" Margin="120,20"/>
|
||||||
|
<CheckBox x:Name="CheckDessert" Grid.Row="3" Margin="155,0" />
|
||||||
|
<Label Text="Dessert" Grid.Row="3" Margin="185,20"/>
|
||||||
|
|
||||||
|
<Label Text="Type de priorité" Grid.Row="4"/>
|
||||||
|
<Grid BackgroundColor="#D1E8E2"
|
||||||
|
MinimumHeightRequest="100"
|
||||||
|
MaximumWidthRequest="300"
|
||||||
|
Padding="20"
|
||||||
|
Grid.Row="5">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Label Text="Recettes économiques" Grid.Row="0" Padding="5,0,0,0"/>
|
||||||
|
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="1" />
|
||||||
|
<Label Text="Recettes rapides" Grid.Row="2"/>
|
||||||
|
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="3" />
|
||||||
|
<Label Text="Recettes simples" Grid.Row="4"/>
|
||||||
|
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="5" />
|
||||||
|
<Label Text="Recettes légères" Grid.Row="6"/>
|
||||||
|
<BoxView Color="Black" HeightRequest="1" Margin="10,10,10,10" Grid.Row="7" />
|
||||||
|
<Label Text="Recettes gourmandes" Grid.Row="8"/>
|
||||||
|
</Grid>
|
||||||
|
<Label Text="Saisir les étapes de la recette " Grid.Row="6" Margin="0,15"/>
|
||||||
|
<Entry Placeholder="Etape de la recette" Grid.Row="7" Margin="12,0"/>
|
||||||
|
<HorizontalStackLayout Grid.Row="8" Margin="20">
|
||||||
|
<Button WidthRequest="100" Text="Précédent" TextColor="Black" Margin="20,0,20,0"/>
|
||||||
|
<Button WidthRequest="100" Text="Ajouter" TextColor="Black" Margin="20,0"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
<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">
|
||||||
|
<Entry Placeholder="Nom de l'ingrédient" Margin="12,0,50,0" WidthRequest="500"/>
|
||||||
|
<Picker Title="Unité">
|
||||||
|
|
||||||
|
</Picker>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
<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="Ajouter" TextColor="Black" Margin="20,0"/>
|
||||||
|
</HorizontalStackLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</VerticalStackLayout>
|
||||||
|
</ContentPage>
|
@ -0,0 +1,18 @@
|
|||||||
|
using CommunityToolkit.Maui.Behaviors;
|
||||||
|
using DataPersistence;
|
||||||
|
using Model;
|
||||||
|
using Model.Managers;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
|
namespace Views
|
||||||
|
{
|
||||||
|
public partial class AddRecipe : ContentPage
|
||||||
|
{
|
||||||
|
public MasterManager MasterMgr => (App.Current as App).MasterMgr;
|
||||||
|
|
||||||
|
public AddRecipe()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,66 +1,107 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
|
||||||
xmlns:local="clr-namespace:Views"
|
xmlns:local="clr-namespace:Views"
|
||||||
x:Class="Views.Home">
|
xmlns:model="clr-namespace:Model;assembly=Model"
|
||||||
|
x:Class="Views.Home">
|
||||||
<local:ContainerBase
|
|
||||||
IsNotConnected="True">
|
<local:ContainerBase
|
||||||
|
IsNotConnected="True">
|
||||||
<!-- Flyout -->
|
|
||||||
<local:ContainerBase.MyFlyoutContent>
|
<!-- Flyout -->
|
||||||
<VerticalStackLayout Grid.Row="1">
|
<local:ContainerBase.MyFlyoutContent>
|
||||||
<!-- Research -->
|
<VerticalStackLayout Grid.Row="1">
|
||||||
<Button Text="Recherche" ImageSource="search_icon.png"
|
<!-- Research -->
|
||||||
MaximumHeightRequest="20"
|
<Button
|
||||||
Style="{StaticResource button1}"/>
|
Text="Recherche"
|
||||||
<SearchBar Placeholder="Mots-clés (ex.: rapide, fromage)" FontAttributes="Italic" TextColor="Black"
|
ImageSource="search_icon.png"
|
||||||
BackgroundColor="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Gray300}}"
|
MaximumHeightRequest="20"
|
||||||
Margin="15, 10, 15, 40"/>
|
Style="{StaticResource button1}"/>
|
||||||
|
<SearchBar
|
||||||
<!-- Direct research -->
|
Placeholder="Mots-clés (ex.: rapide, fromage)"
|
||||||
<Button Text="Entrées" ImageSource="flatware_icon.png"
|
FontAttributes="Italic" TextColor="Black"
|
||||||
Style="{StaticResource button1}"/>
|
BackgroundColor="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Gray300}}"
|
||||||
<Button Text="Plats" ImageSource="room_service_icon.png"
|
Margin="15, 10, 15, 40"/>
|
||||||
Style="{StaticResource button1}"/>
|
|
||||||
<Button Text="Desserts" ImageSource="coffee_icon.png"
|
<!-- Direct research -->
|
||||||
Style="{StaticResource button1}"/>
|
<Button
|
||||||
</VerticalStackLayout>
|
Text="Entrées"
|
||||||
</local:ContainerBase.MyFlyoutContent>
|
ImageSource="flatware_icon.png"
|
||||||
|
Style="{StaticResource button1}"/>
|
||||||
<!-- Master -->
|
<Button
|
||||||
<local:ContainerBase.MyContent>
|
Text="Plats"
|
||||||
<ScrollView>
|
ImageSource="room_service_icon.png"
|
||||||
<StackLayout>
|
Style="{StaticResource button1}"/>
|
||||||
<Label Text="Suggestions" TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Gray100}}"
|
<Button
|
||||||
FontSize="24" Padding="15"/>
|
Text="Desserts"
|
||||||
|
ImageSource="coffee_icon.png"
|
||||||
<FlexLayout
|
Style="{StaticResource button1}"/>
|
||||||
Margin="0, 15"
|
</VerticalStackLayout>
|
||||||
Wrap="Wrap"
|
</local:ContainerBase.MyFlyoutContent>
|
||||||
JustifyContent="Start"
|
|
||||||
AlignItems="Center"
|
<!-- Master -->
|
||||||
AlignContent="SpaceEvenly"
|
<local:ContainerBase.MyContent>
|
||||||
HorizontalOptions="Center">
|
<ScrollView>
|
||||||
|
<StackLayout BindingContext="{Binding AllRecipes}" MinimumWidthRequest="400">
|
||||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
<!--Modification du prof apportée sur le stacklayout pour empecher l'affichage d'une seule case recipe-->
|
||||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
<Label
|
||||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
Text="{Binding Description}"
|
||||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
TextColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource Gray100}}"
|
||||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
FontSize="24"
|
||||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
Padding="15"/>
|
||||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
|
||||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
<FlexLayout
|
||||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
Margin="0, 15"
|
||||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
Wrap="Wrap"
|
||||||
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
JustifyContent="Start"
|
||||||
|
AlignItems="Center"
|
||||||
</FlexLayout>
|
AlignContent="SpaceEvenly"
|
||||||
</StackLayout>
|
HorizontalOptions="Center"
|
||||||
</ScrollView>
|
BindableLayout.ItemsSource="{Binding}">
|
||||||
</local:ContainerBase.MyContent>
|
|
||||||
|
<BindableLayout.ItemTemplate>
|
||||||
</local:ContainerBase>
|
<DataTemplate x:DataType="model:Recipe">
|
||||||
|
<Border Style="{StaticResource recipeCase}">
|
||||||
</ContentPage>
|
<Grid RowDefinitions="*, 40">
|
||||||
|
<!--<local:RecipeCase
|
||||||
|
CaseImageSource="room_service_icon.png"
|
||||||
|
Title="{Binding Title}"/>-->
|
||||||
|
|
||||||
|
<Image
|
||||||
|
Grid.Row="0" VerticalOptions="Fill"
|
||||||
|
Source="{Binding Image}"/>
|
||||||
|
|
||||||
|
<Label
|
||||||
|
Text="{Binding Title}" FontSize="18"
|
||||||
|
Grid.Row="1" HorizontalOptions="Center"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
|
</BindableLayout.ItemTemplate>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||||
|
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||||
|
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||||
|
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||||
|
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||||
|
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||||
|
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||||
|
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||||
|
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||||
|
<local:RecipeCase CaseImageSource="room_service_icon.png"/>
|
||||||
|
<local:RecipeCase CaseImageSource="room_service_icon.png"/>-->
|
||||||
|
|
||||||
|
</FlexLayout>
|
||||||
|
</StackLayout>
|
||||||
|
</ScrollView>
|
||||||
|
</local:ContainerBase.MyContent>
|
||||||
|
|
||||||
|
</local:ContainerBase>
|
||||||
|
|
||||||
|
</ContentPage>
|
||||||
|
@ -1,31 +1,20 @@
|
|||||||
using CommunityToolkit.Maui.Behaviors;
|
using CommunityToolkit.Maui.Behaviors;
|
||||||
using DataPersistence;
|
using DataPersistence;
|
||||||
using Model;
|
using Model;
|
||||||
|
using Model.Managers;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace Views;
|
namespace Views;
|
||||||
|
|
||||||
public partial class MyProfil : ContentPage
|
public partial class MyProfil : ContentPage
|
||||||
{
|
{
|
||||||
public DataManager DataMgr => (App.Current as App).DataMgr;
|
public MasterManager MasterMgr => (App.Current as App).MasterMgr;
|
||||||
public User user => (App.Current as App).user;
|
public User user => (App.Current as App).CurrentUser;
|
||||||
public User userBis {get; set; }
|
|
||||||
|
|
||||||
public MyProfil()
|
public MyProfil()
|
||||||
{
|
{
|
||||||
userBis = new User(user);
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
BindingContext = this;
|
BindingContext = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void Validation_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (String.IsNullOrEmpty(userBis.Name) || String.IsNullOrEmpty(userBis.Surname)){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
user.Name = userBis.Name;
|
|
||||||
user.Surname = userBis.Surname;
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Reference in new issue