Vue résultat
continuous-integration/drone/push Build is failing Details

master
Pauline PRADY 11 months ago
parent 0157d26db1
commit 36c23b6547

@ -8,7 +8,7 @@ namespace MauiSpark
{ {
InitializeComponent(); InitializeComponent();
MainPage = new NavigationPage(new Victoire()); MainPage = new NavigationPage(new AccueilPage());
MainPage.Title = "Mastermind"; MainPage.Title = "Mastermind";
} }
} }

@ -14,11 +14,11 @@
ColumnDefinitions="*, *, *" ColumnDefinitions="*, *, *"
RowDefinitions="*"> RowDefinitions="*">
<vues:ImageResultatVue HorizontalOptions="Start"/> <vues:ImageResultatVue Image="{Binding [2]}" HorizontalOptions="Start"/>
<vues:TitreVue Texte="{Binding [0]}" Grid.Column="1"/> <vues:TitreVue Texte="{Binding [0]}" Grid.Column="1"/>
<vues:ImageResultatVue Grid.Column="2" HorizontalOptions="End"/> <vues:ImageResultatVue Image="{Binding [2]}" Grid.Column="2" HorizontalOptions="End"/>
</Grid> </Grid>
<Frame Grid.Row="1"> <Frame Grid.Row="1">

@ -34,11 +34,11 @@ public partial class Victoire : ContentPage
Joueur[] perdants = e.Perdants; Joueur[] perdants = e.Perdants;
if (gagnants.Length == 1) if (gagnants.Length == 1)
BindingContext = ("Victoire", $"Le joueur {gagnants.First().Nom} a gagné"); BindingContext = ("Victoire", $"Le joueur {gagnants.First().Nom} a gagné", "trophy.jpg");
else if (gagnants.Length > 1) else if (gagnants.Length > 1)
BindingContext = ("Egalité", $"Les joueurs {string.Join(' ', gagnants.Select(joueur => joueur.Nom))} ont gagné"); BindingContext = ("Egalité", $"Les joueurs {string.Join(' ', gagnants.Select(joueur => joueur.Nom))} ont gagné", "egaliter.jpg");
else else
BindingContext = ("Défaite", "Personne n'a trouvé le code..."); BindingContext = ("Défaite", "Personne n'a trouvé le code...", "defaite.png");
if (gagnants.Length == 1) if (gagnants.Length == 1)

@ -2,12 +2,10 @@
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiSpark.Vues.ImageResultatVue" x:Class="MauiSpark.Vues.ImageResultatVue"
x:Name="ImageResultat"> x:Name="imageResultatVue">
<VerticalStackLayout> <Image
<Label Source="{Binding Image, Source={x:Reference imageResultatVue}}"
Text="Welcome to .NET MAUI!" WidthRequest="100"
VerticalOptions="Center" />
HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentView> </ContentView>

@ -2,12 +2,12 @@ namespace MauiSpark.Vues;
public partial class ImageResultatVue : ContentView public partial class ImageResultatVue : ContentView
{ {
public static readonly BindableProperty TexteProperty = BindableProperty.Create(nameof(Texte), typeof(string), typeof(TitreVue), default(string)); public static readonly BindableProperty ImageProperty = BindableProperty.Create(nameof(Image), typeof(string), typeof(ImageResultatVue), default(string));
public string Image public string Image
{ {
get => (string)GetValue(TexteProperty); get => (string)GetValue(ImageProperty);
set => SetValue(TexteProperty, value.ToUpper()); set => SetValue(ImageProperty, value);
} }
public ImageResultatVue() public ImageResultatVue()

Loading…
Cancel
Save