You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
GameAtlas/GameAtlas/GameAtlas/Views/PageProfil.xaml.cs

36 lines
916 B

using GameAtlas.Models;
namespace GameAtlas.Views;
public partial class PageProfil : ContentPage
{
public Manager ProfilManager => (App.Current as App).MyManager;
public PageProfil()
{
InitializeComponent();
BindingContext = ProfilManager;
SwitchPage();
}
async void SwitchPage()
{
if (ProfilManager.ConnectedUser == null)
{
await Navigation.PushAsync(new PageConnexion());
}
else
{
await Shell.Current.GoToAsync("//page/PageProfil");
}
}
async void OnGame_Tapped(System.Object sender, Microsoft.Maui.Controls.TappedEventArgs e)
{
await Shell.Current.GoToAsync(nameof(PageJeu));
}
async void OnAdmin_Tapped(System.Object sender, Microsoft.Maui.Controls.TappedEventArgs e)
{
await Shell.Current.GoToAsync(nameof(PageAdmin));
}
}