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.
24 lines
464 B
24 lines
464 B
using Models;
|
|
|
|
namespace ShoopNCook.Views;
|
|
|
|
public partial class IngredientEntry : ContentView
|
|
{
|
|
public IngredientEntry()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public Ingredient MakeValue()
|
|
{
|
|
float quantity;
|
|
|
|
if (!float.TryParse(QuantityEntry.Text, out quantity))
|
|
{
|
|
quantity = 0;
|
|
// TODO handle quantity text malformation by raising exception
|
|
}
|
|
|
|
return new Ingredient(NameEntry.Text, quantity);
|
|
}
|
|
} |