Début du databinding
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
853d486439
commit
7833e48ebd
@ -1,9 +1,37 @@
|
||||
using CoreLibrary.Joueurs;
|
||||
using CoreLibrary.Manager;
|
||||
|
||||
namespace MauiSpark.Views;
|
||||
|
||||
internal class JoueurClassement
|
||||
{
|
||||
private Manager manager;
|
||||
private Joueur joueur;
|
||||
|
||||
public Joueur Joueur
|
||||
{
|
||||
get => joueur;
|
||||
private set => joueur = value;
|
||||
}
|
||||
|
||||
public int Place
|
||||
{
|
||||
get => manager.Classement.IndexOf(Joueur) + 1;
|
||||
}
|
||||
|
||||
public JoueurClassement(Joueur joueur, Manager manager)
|
||||
{
|
||||
this.manager = manager;
|
||||
this.joueur = joueur;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CTableauScore : ContentView
|
||||
{
|
||||
public CTableauScore()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
BindingContext = MauiProgram.Manager.Classement.Select(joueur => new JoueurClassement(joueur, MauiProgram.Manager));
|
||||
}
|
||||
}
|
Loading…
Reference in new issue