Data Biding avec les boutons (alphabet, nbpartiegagnee, NbpartiePerdu,NbPartieEgalite) et correction des tests pour que sa marche avec la nouvel class joueur.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
c9cf49ab78
commit
a0cee7e7c7
@ -1,9 +1,48 @@
|
||||
|
||||
using CoreLibrary.Joueurs;
|
||||
using MauiSpark.Views;
|
||||
using System.Collections.ObjectModel;
|
||||
namespace MauiSpark.Pages;
|
||||
|
||||
public partial class TableauScore : ContentPage
|
||||
{
|
||||
public TableauScore()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public TableauScore()
|
||||
{
|
||||
InitializeComponent();
|
||||
SetDefaultClassement();
|
||||
}
|
||||
private void SetDefaultClassement()
|
||||
{
|
||||
CTableauScore.UpdateClassement(CTableauScore.GetClassementNbCoupParPartie);
|
||||
}
|
||||
|
||||
private void QuandNbCoutMoyenButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
CTableauScore.UpdateClassement(CTableauScore.GetClassementNbCoupParPartie);
|
||||
}
|
||||
|
||||
private void QuandGagneeButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
CTableauScore.UpdateClassement(CTableauScore.GetClassementPartieGagnee);
|
||||
}
|
||||
|
||||
private void QuandPerduButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
CTableauScore.UpdateClassement(CTableauScore.GetClassementPartiePerdue);
|
||||
}
|
||||
|
||||
private void QuandEgaliteButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
CTableauScore.UpdateClassement(CTableauScore.GetClassementPartieEgalite);
|
||||
}
|
||||
|
||||
private void QuandAlphabetHautButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
CTableauScore.UpdateClassement(CTableauScore.GetClassementAlphabetHaut);
|
||||
}
|
||||
|
||||
private void QuandAlphabetBasButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
CTableauScore.UpdateClassement(CTableauScore.GetClassementAlphabetBas);
|
||||
}
|
||||
}
|
@ -1,25 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="MauiSpark.Views.CTableauScore">
|
||||
|
||||
<Frame CornerRadius="5" Padding="0" VerticalOptions="Start" Margin="20,0,20,10" >
|
||||
<Grid ColumnDefinitions="auto,*,auto,auto" ColumnSpacing="10">
|
||||
<ListView ItemsSource="{Binding}">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<Grid ColumnDefinitions="*,*,*,*">
|
||||
<Label Grid.Column="0" Text="{Binding Place}" Margin="20" Style="{StaticResource TexteFrame}" />
|
||||
<Label Grid.Column="1" Text="{Binding Joueur.Nom}" Margin="20" Style="{StaticResource TexteFrame}" />
|
||||
|
||||
<Label Grid.Column="3" Text="{Binding Point}" Margin="20" Style="{StaticResource TexteFrame}" />
|
||||
</Grid>
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
|
||||
</Grid>
|
||||
</Frame>
|
||||
</ContentView>
|
||||
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="MauiSpark.Views.CTableauScore">
|
||||
<Frame CornerRadius="5" Padding="0" VerticalOptions="Start" Margin="20,0,20,10" >
|
||||
<ListView ItemsSource="{Binding}">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ViewCell>
|
||||
<Grid ColumnDefinitions="auto,*,auto,auto,auto,auto">
|
||||
<Label Grid.Column="0" Text="{Binding Place}" Margin="20,20,20,20" Style="{StaticResource TexteFrame}" />
|
||||
<Label Grid.Column="1" Text="{Binding Joueur.Nom}" Margin="20,20,20,20" Style="{StaticResource TexteFrame}" />
|
||||
<Label Grid.Column="2" Text="{Binding NbCoutMoyen}" Margin="20,20,100,20" Style="{StaticResource TexteFrame}" />
|
||||
<Label Grid.Column="3" Text="{Binding Joueur.NbPartieGagnee}" Margin="75,20,100,20" Style="{StaticResource TexteFrame}" />
|
||||
<Label Grid.Column="4" Text="{Binding Joueur.NbPartiePerdue}" Margin="75,20,100,20" Style="{StaticResource TexteFrame}" />
|
||||
<Label Grid.Column="5" Text="{Binding Joueur.NbPartieEgalite}" Margin="75,20,100,20" Style="{StaticResource TexteFrame}" />
|
||||
</Grid>
|
||||
</ViewCell>
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
</Frame>
|
||||
</ContentView>
|
Loading…
Reference in new issue