diff --git a/MangaMap/Views/FicheAnime.xaml.cs b/MangaMap/Views/FicheAnime.xaml.cs index d4f8e6a..294f0b2 100644 --- a/MangaMap/Views/FicheAnime.xaml.cs +++ b/MangaMap/Views/FicheAnime.xaml.cs @@ -1,25 +1,17 @@ namespace MangaMap.Views; using Model; using System.ComponentModel; +using System.Xml.Linq; public partial class ficheAnime : ContentPage, INotifyPropertyChanged { - private Oeuvre animeModel; - public Oeuvre AnimeModel - { - get { return animeModel; } - set - { - if (animeModel != value) - { - animeModel = value; - OnPropertyChanged(nameof(AnimeModel)); - } - } - } + + public Manager DataManager { get; set; } + public Oeuvre AnimeModel { get; set; } public ficheAnime() { + List genres = new List() { "Action", "Aventure" }; AnimeModel = new Oeuvre("Evangelion", genres, "Type de l'oeuvre", "Description de l'oeuvre", 5, 12, "Chemin/vers/l'affiche.png"); @@ -28,10 +20,13 @@ public partial class ficheAnime : ContentPage, INotifyPropertyChanged this.BindingContext = this; } - public event PropertyChangedEventHandler PropertyChanged; - - protected virtual void OnPropertyChanged(string propertyName) + public ficheAnime(Oeuvre anime) { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + AnimeModel = anime; + + InitializeComponent(); + + this.BindingContext = this; } + } \ No newline at end of file diff --git a/MangaMap/Views/homePage.xaml b/MangaMap/Views/homePage.xaml index db1070e..6132466 100644 --- a/MangaMap/Views/homePage.xaml +++ b/MangaMap/Views/homePage.xaml @@ -29,80 +29,20 @@ Margin="30" /> - - - - - + + + - + - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MangaMap/Views/homePage.xaml.cs b/MangaMap/Views/homePage.xaml.cs index e454b1e..3195a98 100644 --- a/MangaMap/Views/homePage.xaml.cs +++ b/MangaMap/Views/homePage.xaml.cs @@ -2,15 +2,27 @@ namespace MangaMap.Views; using MangaMap.Model; + public partial class homePage : ContentPage { public Manager my_manager => (App.Current as App).MyManager; public homePage() { - InitializeComponent(); - a1.BindingContext = my_manager; - a2.BindingContext = my_manager; + + InitializeComponent(); + BindingContext = my_manager; + BindingContext = my_manager; } + + private void AnimeImageClicked(object sender, EventArgs e) + { + var selectedAnime = (sender as ImageButton)?.BindingContext as Oeuvre; + if (selectedAnime != null) + { + // Naviguez vers la page de la fiche d'anime en passant l'objet sélectionné + Navigation.PushAsync(new ficheAnime(selectedAnime)); + } + } }