diff --git a/ParionsCuite/ParionsCuite/MainPage.xaml b/ParionsCuite/ParionsCuite/MainPage.xaml
index d4ee218..02619a2 100644
--- a/ParionsCuite/ParionsCuite/MainPage.xaml
+++ b/ParionsCuite/ParionsCuite/MainPage.xaml
@@ -38,7 +38,7 @@
-
+
diff --git a/ParionsCuite/ParionsCuite/MainPage.xaml.cs b/ParionsCuite/ParionsCuite/MainPage.xaml.cs
index 382f151..fb55d46 100644
--- a/ParionsCuite/ParionsCuite/MainPage.xaml.cs
+++ b/ParionsCuite/ParionsCuite/MainPage.xaml.cs
@@ -15,6 +15,8 @@ public partial class MainPage : ContentPage
{
public Manageur mgr => (App.Current as App).MyManager;
+ Evenement EventSelect { get; set; }
+
public MainPage()
{
InitializeComponent();
@@ -25,25 +27,30 @@ public partial class MainPage : ContentPage
private void OnEvenementAdded(Evenement evenement)
{
// Logique à exécuter lorsque un événement est ajouté
- // Par exemple : affichez le nom de l'événement dans la console
Debug.WriteLine("Événement ajoutéz : " + evenement.Nom);
Button newButton = new Button
{
Text = evenement.Nom,
VerticalOptions = LayoutOptions.Center,
- HorizontalOptions = LayoutOptions.Center
+ HorizontalOptions = LayoutOptions.Center,
+
};
+ newButton.Clicked += (sender, e) =>
+ {
+ // Appeler la méthode qui récupère l'événement associé
+ SelectEvent(evenement);
+ };
// Ajouter le bouton au ButtonStackLayout
ButtonStackLayout.Children.Add(newButton); ;
}
- public void test(object sender, EventArgs e)
+ public void SelectEvent(Evenement evenement)
{
- Debug.WriteLine("Taille liste Evenement = " + mgr.Evenement.Count);
- foreach(Evenement evenement in mgr.Evenement)
- {
- Debug.Write(evenement);
- }
+ Debug.WriteLine("Événement cliqué : " + evenement.Nom);
+ Debug.WriteLine("Date : " + evenement.Date);
+ Debug.WriteLine("Lieu : " + evenement.Lieu);
+ Debug.WriteLine("Heure : " + evenement.Heure);
+ EventSelect = evenement;
}
@@ -87,7 +94,7 @@ public partial class MainPage : ContentPage
}
private void InfoView(object sender, EventArgs e)
{
- var newPage = new Views.Information.Info();
+ var newPage = new Views.Information.Info(EventSelect);
// Définissez le contenu de la ContentView sur la nouvelle page
changeButton.Content = newPage;
diff --git a/ParionsCuite/ParionsCuite/Modeles/Manageur.cs b/ParionsCuite/ParionsCuite/Modeles/Manageur.cs
index bebc089..02a9ee9 100644
--- a/ParionsCuite/ParionsCuite/Modeles/Manageur.cs
+++ b/ParionsCuite/ParionsCuite/Modeles/Manageur.cs
@@ -38,7 +38,6 @@ namespace ParionsCuite.Modeles
private void OnEvenementAdded(Evenement evenement)
{
// Logique à exécuter lorsque un événement est ajouté
- // Par exemple : affichez le nom de l'événement dans la console
Debug.WriteLine("Événement ajouté : ");
}
diff --git a/ParionsCuite/ParionsCuite/Views/Information/Info.xaml b/ParionsCuite/ParionsCuite/Views/Information/Info.xaml
index f4f6ab0..4bd039c 100644
--- a/ParionsCuite/ParionsCuite/Views/Information/Info.xaml
+++ b/ParionsCuite/ParionsCuite/Views/Information/Info.xaml
@@ -2,23 +2,25 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
diff --git a/ParionsCuite/ParionsCuite/Views/Information/Info.xaml.cs b/ParionsCuite/ParionsCuite/Views/Information/Info.xaml.cs
index fe41faf..fffdd10 100644
--- a/ParionsCuite/ParionsCuite/Views/Information/Info.xaml.cs
+++ b/ParionsCuite/ParionsCuite/Views/Information/Info.xaml.cs
@@ -1,5 +1,6 @@
using ParionsCuite.Modeles;
using System.Diagnostics;
+using System.Xml.Linq;
namespace ParionsCuite.Views.Information;
@@ -7,20 +8,29 @@ public partial class Info : ContentView
{
public Manageur mgr => (App.Current as App).MyManager;
- public Info()
+ public Info(Evenement EventSelect)
{
InitializeComponent();
- MiseAJourInfo();
+ MiseAJourInfo(EventSelect);
BindingContext = this;
- }
+
- public Manageur m = new Manageur();
+ }
- public void MiseAJourInfo()
+ public Manageur m = new Manageur();
+ public const int DefaultCellHeight = 40;
+ public void MiseAJourInfo(Evenement EventSelect)
{
- int NbInvite = m.LenListInvite(m.Invites);
- Debug.WriteLine(NbInvite);
- }
+ NomEvent.Detail = EventSelect.Nom;
+ DateEvent.Detail = EventSelect.Date;
+ int i = EventSelect.ListInviter.Count();
+ NbInvite.Detail = i.ToString();
+ int v = EventSelect.ListParier.Count();
+ NbPari.Detail = v.ToString();
+ AdresseEvent.Detail = EventSelect.Lieu;
+ HoraireEvent.Detail = v.ToString();
+
+ }