|
|
@ -7,10 +7,6 @@ public partial class DetailBook : ContentPage
|
|
|
|
private int maxStars = 5;
|
|
|
|
private int maxStars = 5;
|
|
|
|
private int currentRating = 0;
|
|
|
|
private int currentRating = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public DetailBook()
|
|
|
|
public DetailBook()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
InitializeComponent();
|
|
|
@ -26,10 +22,9 @@ public partial class DetailBook : ContentPage
|
|
|
|
|
|
|
|
|
|
|
|
int currentStar = i;
|
|
|
|
int currentStar = i;
|
|
|
|
|
|
|
|
|
|
|
|
star.GestureRecognizers.Add(new TapGestureRecognizer
|
|
|
|
star.GestureRecognizers.Add(
|
|
|
|
{
|
|
|
|
new TapGestureRecognizer { Command = new Command(() => StarTapped(currentStar)), }
|
|
|
|
Command = new Command(() => StarTapped(currentStar)),
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
StarLayout.Children.Add(star);
|
|
|
|
StarLayout.Children.Add(star);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -38,7 +33,6 @@ public partial class DetailBook : ContentPage
|
|
|
|
BindingContext = this;
|
|
|
|
BindingContext = this;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void StarTapped(int rating)
|
|
|
|
private void StarTapped(int rating)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (rating > maxStars)
|
|
|
|
if (rating > maxStars)
|
|
|
@ -63,5 +57,4 @@ public partial class DetailBook : ContentPage
|
|
|
|
star.Source = "empty_star.svg";
|
|
|
|
star.Source = "empty_star.svg";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|