diff --git a/MangaMap/CustomHeader.xaml b/MangaMap/CustomHeader.xaml index 2266bf9..6e9f252 100644 --- a/MangaMap/CustomHeader.xaml +++ b/MangaMap/CustomHeader.xaml @@ -17,7 +17,8 @@ MaximumHeightRequest="30" BackgroundColor="{StaticResource Primary}" VerticalOptions="Center" - Clicked="ListButton_Clicked" /> + Clicked="ListButton_Clicked" + IsVisible="{Binding IsUserLoggedIn}" /> (App.Current as App).MyManager; public NewContent1() { InitializeComponent(); - } + } async void ImageButton_Clicked(System.Object sender, System.EventArgs e) { //Navigation.PushAsync(new homePage()); diff --git a/MangaMap/Model/Oeuvre.cs b/MangaMap/Model/Oeuvre.cs index 52f1016..56eec70 100644 --- a/MangaMap/Model/Oeuvre.cs +++ b/MangaMap/Model/Oeuvre.cs @@ -8,12 +8,12 @@ using System.Threading.Tasks; namespace MangaMap.Model { [DataContract] - public class Oeuvre + public class Oeuvre { [DataMember] public string Nom { get; private set; } [DataMember] - public List Genre { get; private set; } + public List Genre { get; private set; } [DataMember] public string Type { get; private set; } [DataMember] diff --git a/MangaMap/Resources/Images/addepisodes.png b/MangaMap/Resources/Images/addepisodes.png new file mode 100644 index 0000000..a84e38f Binary files /dev/null and b/MangaMap/Resources/Images/addepisodes.png differ diff --git a/MangaMap/Stub/Stub.cs b/MangaMap/Stub/Stub.cs index 31aaff2..b0a5129 100644 --- a/MangaMap/Stub/Stub.cs +++ b/MangaMap/Stub/Stub.cs @@ -9,8 +9,8 @@ namespace MangaMap.Stub { public class Stub : IPersistanceManager - //Cette classe sert à faire charger un jeu de données qui n'est pas celui enregistrer dans le fichier sur l'ordinateur. - //Il permet de faire des transistion entre différent moyen de persister. + //Cette classe sert à faire charger un jeu de données qui n'est pas celui enregistrer dans le fichier sur l'ordinateur. + //Il permet de faire des transistion entre différent moyen de persister. { public (List, List) chargeDonne() { @@ -39,4 +39,4 @@ namespace MangaMap.Stub throw new NotImplementedException(); } } -} +} \ No newline at end of file diff --git a/MangaMap/Views/CreateOeuvre.xaml.cs b/MangaMap/Views/CreateOeuvre.xaml.cs index 62ad23e..ee61349 100644 --- a/MangaMap/Views/CreateOeuvre.xaml.cs +++ b/MangaMap/Views/CreateOeuvre.xaml.cs @@ -1,6 +1,9 @@ using System.Text.RegularExpressions; using MangaMap.Model; using static System.Runtime.InteropServices.JavaScript.JSType; +using System.Threading.Tasks; +using Microsoft.Maui.Storage; + namespace MangaMap.Views; @@ -13,6 +16,27 @@ public partial class createOeuvre : ContentPage InitializeComponent(); } + private string imagePath; + + async void SelectImageClicked(object sender, EventArgs e) + { + var result = await FilePicker.PickAsync(new PickOptions + { + FileTypes = FilePickerFileType.Images, + PickerTitle = "Pick an image" + }); + + if (result != null) + { + var stream = await result.OpenReadAsync(); + // Utilisez le chemin d'accès à l'image sélectionnée + imagePath = result.FullPath; + + // Affichez l'image sélectionnée dans l'interface utilisateur, si nécessaire + + } + } + async void AddClicked(object sender, System.EventArgs e) { // Récupérer les valeurs des entrées @@ -43,7 +67,7 @@ public partial class createOeuvre : ContentPage return; } - Oeuvre oeuv = new Oeuvre(nom, type, description, nbEp, "logo.png"); + Oeuvre oeuv = new Oeuvre(nom, type, description, nbEp, imagePath); my_manager.Oeuvres.Add(oeuv); my_manager.sauvegarder(); await Navigation.PushAsync(new homePage()); diff --git a/MangaMap/Views/createOeuvre.xaml b/MangaMap/Views/createOeuvre.xaml index 3088088..1c4bdc3 100644 --- a/MangaMap/Views/createOeuvre.xaml +++ b/MangaMap/Views/createOeuvre.xaml @@ -7,6 +7,8 @@