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();
MainPage = new NavigationPage(new Victoire());
MainPage = new NavigationPage(new AccueilPage());
MainPage.Title = "Mastermind";
}
}

@ -14,11 +14,11 @@
ColumnDefinitions="*, *, *"
RowDefinitions="*">
<vues:ImageResultatVue HorizontalOptions="Start"/>
<vues:ImageResultatVue Image="{Binding [2]}" HorizontalOptions="Start"/>
<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>
<Frame Grid.Row="1">

@ -34,11 +34,11 @@ public partial class Victoire : ContentPage
Joueur[] perdants = e.Perdants;
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)
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
BindingContext = ("Défaite", "Personne n'a trouvé le code...");
BindingContext = ("Défaite", "Personne n'a trouvé le code...", "defaite.png");
if (gagnants.Length == 1)

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

@ -2,12 +2,12 @@ namespace MauiSpark.Vues;
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
{
get => (string)GetValue(TexteProperty);
set => SetValue(TexteProperty, value.ToUpper());
get => (string)GetValue(ImageProperty);
set => SetValue(ImageProperty, value);
}
public ImageResultatVue()

Loading…
Cancel
Save