diff --git a/Sources/Model/Manager.cs b/Sources/Model/Manager.cs
index e073e6f..7ffb8a8 100644
--- a/Sources/Model/Manager.cs
+++ b/Sources/Model/Manager.cs
@@ -104,9 +104,9 @@ namespace Model
return listeFavoris;
}
- public void AddFavoris(ObjetOhara obj)
+ public void AddBateauFavoris(Bateau bateau)
{
- obj.EstFavori = true;
+ bateau.EstFavori = true;
}
}
}
diff --git a/Sources/Ohara/PageBestiaire.xaml.cs b/Sources/Ohara/PageBestiaire.xaml.cs
index 0229b17..2bce1ab 100644
--- a/Sources/Ohara/PageBestiaire.xaml.cs
+++ b/Sources/Ohara/PageBestiaire.xaml.cs
@@ -16,7 +16,7 @@ public partial class PageBestiaire : ContentPage
var manager = new Manager();
- AjouterFavoris = new Command((obj) => manager.AddFavoris((ObjetOhara)obj));
+
listeBest.ItemsSource = manager.GetBestiaires();
diff --git a/Sources/Ohara/PageFavoris.xaml b/Sources/Ohara/PageFavoris.xaml
index c59225e..35a4f53 100644
--- a/Sources/Ohara/PageFavoris.xaml
+++ b/Sources/Ohara/PageFavoris.xaml
@@ -13,28 +13,23 @@
-
-
-
+
-
+
-
-
-
-
-
+
+
@@ -59,36 +54,27 @@
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
+ FontSize="19"
+ TextColor="#72a3b3"
+ FontAttributes="Bold" />
+
+
-
-
\ No newline at end of file
diff --git a/Sources/Ohara/PageFavoris.xaml.cs b/Sources/Ohara/PageFavoris.xaml.cs
index ff7923f..825f18e 100644
--- a/Sources/Ohara/PageFavoris.xaml.cs
+++ b/Sources/Ohara/PageFavoris.xaml.cs
@@ -74,8 +74,20 @@ public partial class PageFavoris : ContentPage
async void listeFavs_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
-
- await Navigation.PushAsync(new PageInfoBateau((Bateau)listeFavs.SelectedItem));
-
+ Type t = listeFavs.SelectedItem.GetType();
+ Console.WriteLine(t);
+ if (t.Equals(typeof(Bateau)))
+ await Navigation.PushAsync(new PageInfoBateau((Bateau)listeFavs.SelectedItem));
+ else if (t.Equals(typeof(Equipage)))
+ await Navigation.PushAsync(new PageInfoEquipage((Equipage)listeFavs.SelectedItem));
+ else if (t.Equals(typeof(Personnage)))
+ await Navigation.PushAsync(new PageInfoPersonnage((Personnage)listeFavs.SelectedItem));
+ else if (t.Equals(typeof(Ile)))
+ await Navigation.PushAsync(new PageInfoIle((Ile)listeFavs.SelectedItem));
+ else if (t.Equals(typeof(FruitDuDemon)))
+ await Navigation.PushAsync(new PageInfoFdd((FruitDuDemon)listeFavs.SelectedItem));
+ else if (t.Equals(typeof(Bestiaire)))
+ await Navigation.PushAsync(new PageInfoBestiaire((Bestiaire)listeFavs.SelectedItem));
+
}
}
\ No newline at end of file
diff --git a/Sources/Ohara/PageInfoBateau.xaml b/Sources/Ohara/PageInfoBateau.xaml
index 9050e1c..d100e56 100644
--- a/Sources/Ohara/PageInfoBateau.xaml
+++ b/Sources/Ohara/PageInfoBateau.xaml
@@ -42,6 +42,7 @@
+
@@ -51,11 +52,13 @@
-
+
+
+
-
+
bateau.EstFavori = true);
+ ButtonFav.Command = AjouterFavs;
}
-
+
private async void Hyperlink_Accueil(object sender, EventArgs e)
{
await Navigation.PushAsync(new MainPage());
@@ -52,4 +56,6 @@ public partial class PageInfoBateau : ContentPage
{
await Navigation.PushAsync(new PageFavoris(new Plugin.Maui.Audio.AudioManager()));
}
+
+
}
\ No newline at end of file
diff --git a/Sources/Ohara/Resources/Styles/Styles.xaml b/Sources/Ohara/Resources/Styles/Styles.xaml
index 05e8a50..8092d4c 100644
--- a/Sources/Ohara/Resources/Styles/Styles.xaml
+++ b/Sources/Ohara/Resources/Styles/Styles.xaml
@@ -641,5 +641,37 @@
-
+
+
+
diff --git a/Sources/TestConsole/Program.cs b/Sources/TestConsole/Program.cs
index 535260b..fa8efac 100644
--- a/Sources/TestConsole/Program.cs
+++ b/Sources/TestConsole/Program.cs
@@ -7,7 +7,7 @@ var manager = new Manager();
var xml = new XML_Serializer();
-Bestiaire luffy = new Bestiaire("", "", "", "");
+Bestiaire luffy = new Bestiaire("test", "", "", "");
/*
xml.SetPersonnage(manager.GetPersonnages().ToList());
xml.SetFDD(manager.GetFruits().ToList());
@@ -18,9 +18,9 @@ xml.SetIle(manager.GetIles().ToList());
*/
-List listeFavoris = manager.GetFavoris();
+Type t = luffy.GetType();
+if (t.Equals(typeof(Bestiaire)))
+ Console.WriteLine(luffy.Nom);
-foreach(ObjetOhara obj in listeFavoris)
-{
- Console.WriteLine(obj.Nom);
-}
+
+Console.WriteLine(t.Equals(typeof(Bestiaire)));