Merge branch 'DataBinding'
continuous-integration/drone/push Build is failing
Details
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 101 KiB |
Before Width: | Height: | Size: 573 KiB After Width: | Height: | Size: 573 KiB |
Before Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.2 KiB |
@ -1,18 +1,48 @@
|
|||||||
namespace MangaMap.Views;
|
namespace MangaMap.Views;
|
||||||
using Model;
|
using Model;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
|
||||||
public partial class ficheAnime : ContentPage
|
public partial class ficheAnime : ContentPage, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public Manager DataManager { get; set; }
|
||||||
public Oeuvre AnimeModel { get; set; }
|
public Oeuvre AnimeModel { get; set; }
|
||||||
|
|
||||||
public ficheAnime()
|
public ficheAnime()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
// Exemple de création d'une instance de la classe Oeuvre
|
this.BindingContext = this;
|
||||||
List<string> genres = new List<string>() { "Action", "Aventure" };
|
}
|
||||||
AnimeModel = new Oeuvre("Nom de l'oeuvre", genres, "Type de l'oeuvre", "Description de l'oeuvre", 5, 12, "Chemin/vers/l'affiche.png");
|
|
||||||
|
public ficheAnime(Oeuvre anime)
|
||||||
|
{
|
||||||
|
AnimeModel = anime;
|
||||||
|
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
this.BindingContext = this;
|
this.BindingContext = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetNote(float note)
|
||||||
|
{
|
||||||
|
note = (int)note; // Tronquer à un entier car nous ne gérons actuellement pas les demi-étoiles
|
||||||
|
var starImages = star.Children.OfType<Image>().Reverse().ToList();
|
||||||
|
foreach (var img in starImages)
|
||||||
|
{
|
||||||
|
if (note > 0)
|
||||||
|
{
|
||||||
|
img.Opacity = 1;
|
||||||
|
note--;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
img.Opacity = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|