From 0f69d9c87cb94905a3b100e2967df91cdb12fee0 Mon Sep 17 00:00:00 2001 From: Yvan CALATAYUD Date: Thu, 1 Jun 2023 17:47:30 +0200 Subject: [PATCH] =?UTF-8?q?Amelioration=20de=20la=20connexion(Change=20aut?= =?UTF-8?q?omatiquement=20la=20PageProfil/PageConnexion=20si=20user=20conn?= =?UTF-8?q?ect=C3=A9)=20+=20Navigation=20TabBar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GameAtlas/GameAtlas/AppShell.xaml | 6 +++--- GameAtlas/GameAtlas/Models/Manager.cs | 12 ++++++++++-- GameAtlas/GameAtlas/Views/PageAccueil.xaml | 2 +- GameAtlas/GameAtlas/Views/PageConnexion.xaml.cs | 4 +++- GameAtlas/GameAtlas/Views/PageInscription.xaml.cs | 3 ++- GameAtlas/GameAtlas/Views/PageProfil.xaml.cs | 13 +++++++++++++ 6 files changed, 32 insertions(+), 8 deletions(-) diff --git a/GameAtlas/GameAtlas/AppShell.xaml b/GameAtlas/GameAtlas/AppShell.xaml index 381d174..3242a3c 100644 --- a/GameAtlas/GameAtlas/AppShell.xaml +++ b/GameAtlas/GameAtlas/AppShell.xaml @@ -21,7 +21,7 @@ - + - + Route="PageConnexion" />--> diff --git a/GameAtlas/GameAtlas/Models/Manager.cs b/GameAtlas/GameAtlas/Models/Manager.cs index 5f4bf7d..412eb3d 100644 --- a/GameAtlas/GameAtlas/Models/Manager.cs +++ b/GameAtlas/GameAtlas/Models/Manager.cs @@ -1,13 +1,15 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.ComponentModel; using System.Linq; +using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; namespace GameAtlas.Models { - public class Manager + public class Manager : INotifyPropertyChanged { public List ListJeux { get; private set; } public List Admins { get; private set; } @@ -21,23 +23,29 @@ namespace GameAtlas.Models set { connectedUser = value; - //OnPropertyChanged(); + OnPropertyChanged(); } } private Utilisateur connectedUser; + public event PropertyChangedEventHandler? PropertyChanged; + + void OnPropertyChanged([CallerMemberName] string propertyName = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); public Manager(IPersistanceManager persistance) { Utilisateurs = new List(); ListJeux = new List(); Persistance = persistance; + ConnectedUser = null; } public Manager() { ListJeux = new List(); Admins = new List(); Utilisateurs = new List(); + ConnectedUser = null; } public void AddJeux(Jeu jeux) diff --git a/GameAtlas/GameAtlas/Views/PageAccueil.xaml b/GameAtlas/GameAtlas/Views/PageAccueil.xaml index c4ecce0..b3af869 100644 --- a/GameAtlas/GameAtlas/Views/PageAccueil.xaml +++ b/GameAtlas/GameAtlas/Views/PageAccueil.xaml @@ -39,7 +39,7 @@ />