Navigation fonctionnel dans toute l'application
continuous-integration/drone/push Build is passing Details

master
Camille TURPIN-ETIENNE 11 months ago
parent eb91d4d278
commit 57f20e57b2

@ -16,6 +16,7 @@
Style="{StaticResource AccueilBouton}" Style="{StaticResource AccueilBouton}"
Source="pointinterrogation.png" Source="pointinterrogation.png"
HorizontalOptions="End" HorizontalOptions="End"
Clicked="QuandReglesClique"
/> />
</Grid> </Grid>
@ -47,6 +48,7 @@
Grid.Column="1" Grid.Column="1"
HorizontalOptions="End" HorizontalOptions="End"
Source="statistiques.png" Source="statistiques.png"
Clicked="QuandTableauClique"
/> />
</Grid> </Grid>

@ -14,4 +14,14 @@ public partial class Accueil : ContentPage
{ {
Navigation.PushAsync(new Mode()); Navigation.PushAsync(new Mode());
} }
private void QuandReglesClique (Object? sender, EventArgs e)
{
Navigation.PushAsync(new Regle());
}
private void QuandTableauClique(Object? sender, EventArgs e)
{
Navigation.PushAsync(new TableauScore());
}
} }

@ -48,7 +48,7 @@ public partial class ConnexionPage : ContentPage
} }
else if (e.Gagnants.Count() == 2) else if (e.Gagnants.Count() == 2)
{ {
Navigation.PushAsync(new Egalite()); Navigation.PushAsync(new Egalite((Partie)sender, e));
} }
else else
{ {

@ -15,6 +15,6 @@
<Frame Margin="20"> <Frame Margin="20">
<Label HorizontalOptions="Center" Text="{Binding}" Style="{StaticResource TexteFrame}"/> <Label HorizontalOptions="Center" Text="{Binding}" Style="{StaticResource TexteFrame}"/>
</Frame> </Frame>
<Button Text="Menu" VerticalOptions="End" HorizontalOptions="Center"></Button> <Button Text="Menu" VerticalOptions="End" HorizontalOptions="Center" Clicked="QuandButtonMenuCliquer"></Button>
</VerticalStackLayout> </VerticalStackLayout>
</ContentPage> </ContentPage>

@ -11,4 +11,9 @@ public partial class Defaite : ContentPage
BindingContext = $"Aucun des deux joueurs, {e.Perdants.First().Nom} et {e.Perdants.Last().Nom} n'a trouvé le code secret"; BindingContext = $"Aucun des deux joueurs, {e.Perdants.First().Nom} et {e.Perdants.Last().Nom} n'a trouvé le code secret";
} }
private void QuandButtonMenuCliquer(object sender, EventArgs e)
{
Navigation.PushAsync(new Mode());
}
} }

@ -15,6 +15,6 @@
<Frame Margin="20"> <Frame Margin="20">
<Label HorizontalOptions="Center" Text="Les deux joueur ont trouvé en même temps" Style="{StaticResource TexteFrame}"/> <Label HorizontalOptions="Center" Text="Les deux joueur ont trouvé en même temps" Style="{StaticResource TexteFrame}"/>
</Frame> </Frame>
<Button Text="Menu" VerticalOptions="End" HorizontalOptions="Center"></Button> <Button Text="Menu" VerticalOptions="End" HorizontalOptions="Center" Clicked="QuandButtonMenuCliquer"></Button>
</VerticalStackLayout> </VerticalStackLayout>
</ContentPage> </ContentPage>

@ -1,9 +1,17 @@
using CoreLibrary.Events;
using CoreLibrary;
namespace MauiSpark.Pages; namespace MauiSpark.Pages;
public partial class Egalite : ContentPage public partial class Egalite : ContentPage
{ {
public Egalite() public Egalite(Partie p, PartieTermineeEventArgs e)
{ {
InitializeComponent(); InitializeComponent();
BindingContext = $"Les deux joueurs, {e.Gagnants.First().Nom} et {e.Gagnants.Last().Nom} ont trouvé le code secret"; ;
} }
private void QuandButtonMenuCliquer(object sender, EventArgs e)
{
Navigation.PushAsync(new Mode());
}
} }

@ -10,8 +10,15 @@
<conv:IndicateurVersCouleurMAUI x:Key="IndicateurVersCouleurMAUI"/> <conv:IndicateurVersCouleurMAUI x:Key="IndicateurVersCouleurMAUI"/>
<conv:JetonVersTexte x:Key="JetonVersTexte"/> <conv:JetonVersTexte x:Key="JetonVersTexte"/>
</ContentPage.Resources> </ContentPage.Resources>
<Grid RowDefinitions="*" ColumnDefinitions="*, *,auto">
<Grid RowDefinitions="*" ColumnDefinitions="*, *"> <ImageButton
Grid.Column="2"
Style="{StaticResource AccueilBouton}"
Source="pointinterrogation.png"
HorizontalOptions="End"
VerticalOptions="Start"
Clicked="QuandReglesClique"
/>
<Grid RowDefinitions="*" ColumnDefinitions="*" Margin="50"> <Grid RowDefinitions="*" ColumnDefinitions="*" Margin="50">
<Border <Border
Stroke="#000000" Stroke="#000000"

@ -44,6 +44,10 @@ public partial class Plateau : ContentPage
p.NouveauTour += QuandNouveauTour; p.NouveauTour += QuandNouveauTour;
} }
private void QuandReglesClique(object sender, EventArgs e)
{
Navigation.PushAsync(new Regle());
}
private void QuandNouveauTour(object? sender, NouveauTourEventArgs e) private void QuandNouveauTour(object? sender, NouveauTourEventArgs e)
{ {
code = e.Code; code = e.Code;

@ -12,7 +12,7 @@
<Label Text="Règle" Style="{StaticResource TexteTitre}" /> <Label Text="Règle" Style="{StaticResource TexteTitre}" />
</Frame> </Frame>
<Grid RowDefinitions="auto,auto"> <Grid RowDefinitions="auto,auto">
<ImageButton Grid.Row="0" Style="{StaticResource ButtonFermeture}"/> <ImageButton Grid.Row="0" Style="{StaticResource ButtonFermeture}" Clicked="QuandButtonArriereClique"/>
<Image Grid.Row="1" Source="livre.png" WidthRequest="100" HorizontalOptions="Start" VerticalOptions="Center" Margin="10"/> <Image Grid.Row="1" Source="livre.png" WidthRequest="100" HorizontalOptions="Start" VerticalOptions="Center" Margin="10"/>
</Grid> </Grid>
</FlexLayout> </FlexLayout>

@ -6,4 +6,9 @@ public partial class Regle : ContentPage
{ {
InitializeComponent(); InitializeComponent();
} }
private void QuandButtonArriereClique(object sender, EventArgs e)
{
Navigation.PopAsync();
}
} }

@ -13,7 +13,7 @@
<Label Text="Scoreboard" Style="{StaticResource TexteTitre}"/> <Label Text="Scoreboard" Style="{StaticResource TexteTitre}"/>
</Frame> </Frame>
<Grid RowDefinitions="auto,auto"> <Grid RowDefinitions="auto,auto">
<ImageButton Grid.Row="0" Style="{StaticResource ButtonFermeture}"/> <ImageButton Grid.Row="0" Style="{StaticResource ButtonFermeture}" Clicked="QuandButtonArriereClique" />
<Image Grid.Row="1" Source="star.png" WidthRequest="100" HorizontalOptions="Start" VerticalOptions="Center" Margin="10"/> <Image Grid.Row="1" Source="star.png" WidthRequest="100" HorizontalOptions="Start" VerticalOptions="Center" Margin="10"/>
</Grid> </Grid>
</FlexLayout> </FlexLayout>

@ -3,6 +3,7 @@ using CoreLibrary.Joueurs;
using MauiSpark.Views; using MauiSpark.Views;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
namespace MauiSpark.Pages; namespace MauiSpark.Pages;
using System.Windows;
public partial class TableauScore : ContentPage public partial class TableauScore : ContentPage
{ {
@ -11,6 +12,14 @@ public partial class TableauScore : ContentPage
InitializeComponent(); InitializeComponent();
SetDefaultClassement(); SetDefaultClassement();
} }
private void QuandButtonArriereClique(object sender, EventArgs e)
{
Navigation.PopAsync();
}
private void SetDefaultClassement() private void SetDefaultClassement()
{ {
CTableauScore.UpdateClassement(CTableauScore.GetClassementNbCoupParPartie); CTableauScore.UpdateClassement(CTableauScore.GetClassementNbCoupParPartie);

@ -15,6 +15,6 @@
<Frame Margin="20" > <Frame Margin="20" >
<Label HorizontalOptions="Center" Text="{Binding}" Style="{StaticResource TexteFrame}"/> <Label HorizontalOptions="Center" Text="{Binding}" Style="{StaticResource TexteFrame}"/>
</Frame> </Frame>
<Button Text="Menu" VerticalOptions="End" HorizontalOptions="Center"></Button> <Button Text="Menu" VerticalOptions="End" HorizontalOptions="Center" Clicked="QuandButtonMenuCliquer"></Button>
</VerticalStackLayout> </VerticalStackLayout>
</ContentPage> </ContentPage>

@ -11,4 +11,8 @@ public partial class Victoire : ContentPage
BindingContext = $"Le joueur {e.Gagnants.First().Nom} a gagné"; BindingContext = $"Le joueur {e.Gagnants.First().Nom} a gagné";
} }
private void QuandButtonMenuCliquer(object sender, EventArgs e)
{
Navigation.PushAsync(new Mode());
}
} }
Loading…
Cancel
Save