You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ShopNCook/Pages/CreateRecipePage.xaml

102 lines
3.9 KiB

<?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="ShoopNCook.Pages.CreateRecipePage"
Title="CreateRecipePage"
xmlns:views="clr-namespace:ShoopNCook.Views"
BackgroundColor="{StaticResource BackgroundPrimary}">
<Grid
RowDefinitions="Auto, *, Auto"
Padding="20, 30, 20, 20">
<!-- Header label and return button -->
<HorizontalStackLayout
Grid.Row="0"
MaximumHeightRequest="60">
<ImageButton
HeightRequest="50"
WidthRequest="50"
Source="arrow_back.svg"
HorizontalOptions="Start"/>
<Label
Text="Create new recipe"
Style="{StaticResource h3}"
FontSize="20"
VerticalTextAlignment="Center"/>
</HorizontalStackLayout>
<!--Image display and upload button-->
<ScrollView
Grid.Row="1">
<VerticalStackLayout>
<Grid
RowDefinitions="Auto">
<Border
Grid.Row="0"
BackgroundColor="{StaticResource ImageBackground}"
Stroke="White"
StrokeThickness="2"
StrokeShape="RoundRectangle 25">
<Image
x:Name="RecipeImage"
HeightRequest="250"/>
</Border>
<Border
Grid.Row="0"
BackgroundColor="{StaticResource Selected}"
Stroke="White"
StrokeThickness="2"
StrokeShape="RoundRectangle 200"
WidthRequest="50"
HeightRequest="50"
HorizontalOptions="End"
VerticalOptions="End"
TranslationY="20"
TranslationX="-20">
<ImageButton
Source="edit.svg"
WidthRequest="30"/>
</Border>
</Grid>
<VerticalStackLayout>
<Entry
Style="{StaticResource UserInput}"
Placeholder="Specify your recipe name"/>
<Label
Style="{StaticResource h2}"
Text="Ingredient list (for 1 person)"/>
<VerticalStackLayout
x:Name="IngredientList"
Spacing="5">
<views:IngredientInput/>
</VerticalStackLayout>
<HorizontalStackLayout>
<HorizontalStackLayout.GestureRecognizers>
<TapGestureRecognizer
Tapped="OnAddIngredientTapped"
NumberOfTapsRequired="1"/>
</HorizontalStackLayout.GestureRecognizers>
<Label
Text="+"
TextColor="LightGreen"
FontSize="50"/>
<Label
Margin="0, 10, 0, 0"
Style="{StaticResource h2}"
Text="Add Ingredient"
VerticalTextAlignment="Center"/>
</HorizontalStackLayout>
</VerticalStackLayout>
</VerticalStackLayout>
</ScrollView>
<Button
Grid.Row="3"
Style="{StaticResource UserButton}"
BackgroundColor="{StaticResource ActionButton}"
Text="Upload recipe"/>
</Grid>
</ContentPage>