|
|
@ -3,32 +3,35 @@ namespace ShoopNCook.Views;
|
|
|
|
public partial class RecipeView : ContentView
|
|
|
|
public partial class RecipeView : ContentView
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
private readonly BindableProperty NoteProperty;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public RecipeView(): this(5, "Title", "Subtitle")
|
|
|
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
public float Note {
|
|
|
|
public RecipeView(float note, string title, string subtitle)
|
|
|
|
get => (float) GetValue(NoteProperty);
|
|
|
|
{
|
|
|
|
set => SetValue(NoteProperty, value);
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
Note = note;
|
|
|
|
|
|
|
|
Title = title;
|
|
|
|
|
|
|
|
Subtitle = subtitle;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public RecipeView(): this(5)
|
|
|
|
public float Note
|
|
|
|
{}
|
|
|
|
{
|
|
|
|
|
|
|
|
set => SetNote(value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public RecipeView(float note)
|
|
|
|
public string Title
|
|
|
|
{
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
set => TitleLabel.Text = value;
|
|
|
|
NoteProperty = BindableProperty.Create(
|
|
|
|
}
|
|
|
|
nameof(Note),
|
|
|
|
|
|
|
|
typeof(float),
|
|
|
|
|
|
|
|
typeof(RecipeView),
|
|
|
|
|
|
|
|
0F,
|
|
|
|
|
|
|
|
propertyChanged: (_, _, v) => UpdateNotes((float) v)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Note = note;
|
|
|
|
public string Subtitle
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
set => SubtitleLabel.Text = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void UpdateNotes(float note)
|
|
|
|
|
|
|
|
|
|
|
|
private void SetNote(float note)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int i = 1;
|
|
|
|
int i = 1;
|
|
|
|
foreach (Image img in Stars.Children)
|
|
|
|
foreach (Image img in Stars.Children)
|
|
|
|