diff --git a/Sources/GameAtlas/GameAtlas/Views/Composants/BoutonVoir.xaml.cs b/Sources/GameAtlas/GameAtlas/Views/Composants/BoutonVoir.xaml.cs
index 3d2f62a..31144fb 100644
--- a/Sources/GameAtlas/GameAtlas/Views/Composants/BoutonVoir.xaml.cs
+++ b/Sources/GameAtlas/GameAtlas/Views/Composants/BoutonVoir.xaml.cs
@@ -14,7 +14,6 @@ public partial class BoutonVoir : ContentView
var selectedjeu = (sender as Button)?.BindingContext as Jeu;
if (selectedjeu != null)
{
- //await Shell.Current.GoToAsync(nameof(PageJeu(selectedjeu)); ---- Ne marche pas ----
await Navigation.PushAsync(new PageJeu(selectedjeu));
}
}
diff --git a/Sources/GameAtlas/GameAtlas/Views/PageAccueil.xaml b/Sources/GameAtlas/GameAtlas/Views/PageAccueil.xaml
index ca35a56..0005956 100644
--- a/Sources/GameAtlas/GameAtlas/Views/PageAccueil.xaml
+++ b/Sources/GameAtlas/GameAtlas/Views/PageAccueil.xaml
@@ -35,7 +35,7 @@
-
+
@@ -105,7 +105,7 @@
Padding="25,25,0,25"
/>
-
+
diff --git a/Sources/GameAtlas/GameAtlas/Views/PageAdmin.xaml b/Sources/GameAtlas/GameAtlas/Views/PageAdmin.xaml
index 7c672f1..08ceecb 100644
--- a/Sources/GameAtlas/GameAtlas/Views/PageAdmin.xaml
+++ b/Sources/GameAtlas/GameAtlas/Views/PageAdmin.xaml
@@ -15,7 +15,7 @@
-
+
@@ -29,9 +29,9 @@
-
+
-
+
diff --git a/Sources/GameAtlas/GameAtlas/Views/PageAdmin.xaml.cs b/Sources/GameAtlas/GameAtlas/Views/PageAdmin.xaml.cs
index b8e9d29..f658b16 100644
--- a/Sources/GameAtlas/GameAtlas/Views/PageAdmin.xaml.cs
+++ b/Sources/GameAtlas/GameAtlas/Views/PageAdmin.xaml.cs
@@ -49,7 +49,7 @@ public partial class PageAdmin : ContentPage
int etape = 1;
bool annuler = false;
- while (etape <= 9 && !annuler)
+ while (etape <= 10 && !annuler)
{
switch (etape)
{
@@ -61,7 +61,7 @@ public partial class PageAdmin : ContentPage
}
break;
case 2:
- resume = await DisplayPromptAsync("Informations sur le Jeu [2/10]", "Résumé du jeu", accept: "Terminer", cancel: "Annuler", placeholder: "Résumé du jeu");
+ resume = await DisplayPromptAsync("Informations sur le Jeu [2/10]", "Résumé du jeu", accept: "Suivant", cancel: "Annuler", placeholder: "Résumé du jeu");
if (string.IsNullOrEmpty(resume))
{
annuler = true;
@@ -96,7 +96,7 @@ public partial class PageAdmin : ContentPage
}
break;
case 7:
- note = await DisplayPromptAsync("Informations sur le Jeu [7/10]", "Note de 0 à 10", accept: "Suivant", cancel: "Annuler", maxLength: 3, placeholder: "4,5");
+ note = await DisplayPromptAsync("Informations sur le Jeu [7/10]", "Note de 0 à 10",accept: "Suivant", cancel: "Annuler", maxLength: 3, placeholder: "4,5");
if (string.IsNullOrEmpty(note))
{
annuler = true;
@@ -144,4 +144,33 @@ public partial class PageAdmin : ContentPage
Debug.WriteLine("Annulation de l'ajout du jeu.");
}
}
+
+ private async void OnDeleteClicked(object sender, EventArgs e)
+ {
+ var gameNames = GetGameNames().ToArray();
+ string action = await DisplayActionSheet("Sélectionnez un jeu à supprimer", "Annuler", null, gameNames);
+
+ if (action != null && action != "Annuler")
+ {
+ var jeuASupprimer = GetGameByName(action);
+ if (jeuASupprimer != null)
+ {
+ AdminManager.ListJeux.Remove(jeuASupprimer);
+ AdminManager.SauvegardeDonnees();
+ await DisplayAlert("Succès",$"{jeuASupprimer.Nom} a bien été supprimé de l'application.", "Ok");
+ Debug.WriteLine($"Le jeu {jeuASupprimer.Nom} a été supprimé");
+ }
+ }
+ }
+
+ private List GetGameNames()
+ {
+ return AdminManager.ListJeux.Select(jeu => jeu.Nom).ToList();
+ }
+
+ private Jeu GetGameByName(string name)
+ {
+ return AdminManager.ListJeux.FirstOrDefault(jeu => jeu.Nom == name);
+ }
+
}
\ No newline at end of file
diff --git a/Sources/GameAtlas/GameAtlas/Views/PageInscription.xaml b/Sources/GameAtlas/GameAtlas/Views/PageInscription.xaml
index 122b8e2..b00eed2 100644
--- a/Sources/GameAtlas/GameAtlas/Views/PageInscription.xaml
+++ b/Sources/GameAtlas/GameAtlas/Views/PageInscription.xaml
@@ -31,11 +31,13 @@
+
+