end create recipe page
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details

pull/37/head
Maxime BATISTA 2 years ago
parent 682c02edfd
commit 1e53769fce

@ -123,9 +123,7 @@
<VerticalStackLayout <VerticalStackLayout
x:Name="StepList" x:Name="StepList"
Spacing="5"> Spacing="5">
<Entry <views:StepEntry Ordinal="1"/>
Style="{StaticResource UserInput}"
BackgroundColor="{StaticResource BackgroundSecondary}"/>
</VerticalStackLayout> </VerticalStackLayout>
<!--Add new Step button--> <!--Add new Step button-->

@ -16,6 +16,6 @@ public partial class CreateRecipePage : ContentPage
private void OnAddStepTapped(object sender, TappedEventArgs e) private void OnAddStepTapped(object sender, TappedEventArgs e)
{ {
StepList.Children.Add(new Entry()); StepList.Children.Add(new StepEntry((uint) StepList.Children.Count() + 1));
} }
} }

@ -3,15 +3,27 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ShoopNCook.Views.StepEntry"> x:Class="ShoopNCook.Views.StepEntry">
<VerticalStackLayout> <VerticalStackLayout>
<Label <HorizontalStackLayout>
Style="{StaticResource h3}" <Label
Text="Step"/> Style="{StaticResource h3}"
<Label Text="Step"
Style="{StaticResource h3}" Margin="0, 0, 2, 0"/>
x:Name="OrdinalLabel"
Text="{Binding Ordinal}"/> <Label
Style="{StaticResource h3}"
x:Name="OrdinalLabel"/>
</HorizontalStackLayout>
<Border
StrokeShape="RoundRectangle 5"
Stroke="Gray"
BackgroundColor="{StaticResource BackgroundSecondary}">
<Editor
MaxLength="10000"
Style="{StaticResource UserInput}"
AutoSize="TextChanges"
FontSize="15"/>
</Border>
<Entry
Style="{StaticResource UserInput}"/>
</VerticalStackLayout> </VerticalStackLayout>
</ContentView> </ContentView>

@ -2,14 +2,18 @@ namespace ShoopNCook.Views;
public partial class StepEntry : ContentView public partial class StepEntry : ContentView
{ {
private readonly BindableProperty OrdinalProperty = BindableProperty.Create(nameof(OrdinalLabel), typeof(uint), typeof(StepEntry), default(uint));
public StepEntry() public StepEntry(): this(1)
{}
public StepEntry(uint ordinal)
{ {
InitializeComponent(); InitializeComponent();
Ordinal = ordinal;
} }
public uint Ordinal { public uint Ordinal {
get => (uint)GetValue(OrdinalProperty); get => uint.Parse(OrdinalLabel.Text);
set => SetValue(OrdinalProperty, value); set => OrdinalLabel.Text = value.ToString();
} }
} }
Loading…
Cancel
Save