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
x:Name="StepList"
Spacing="5">
<Entry
Style="{StaticResource UserInput}"
BackgroundColor="{StaticResource BackgroundSecondary}"/>
<views:StepEntry Ordinal="1"/>
</VerticalStackLayout>
<!--Add new Step button-->

@ -16,6 +16,6 @@ public partial class CreateRecipePage : ContentPage
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"
x:Class="ShoopNCook.Views.StepEntry">
<VerticalStackLayout>
<Label
Style="{StaticResource h3}"
Text="Step"/>
<Label
Style="{StaticResource h3}"
x:Name="OrdinalLabel"
Text="{Binding Ordinal}"/>
<HorizontalStackLayout>
<Label
Style="{StaticResource h3}"
Text="Step"
Margin="0, 0, 2, 0"/>
<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>
</ContentView>

@ -2,14 +2,18 @@ namespace ShoopNCook.Views;
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();
Ordinal = ordinal;
}
public uint Ordinal {
get => (uint)GetValue(OrdinalProperty);
set => SetValue(OrdinalProperty, value);
get => uint.Parse(OrdinalLabel.Text);
set => OrdinalLabel.Text = value.ToString();
}
}
Loading…
Cancel
Save