namespace GameAtlas.Views;

using GameAtlas.Models;

public partial class PageParcourir : ContentPage
{

    public Manager ParcourirManager => (App.Current as App).MyManager;
    public PageParcourir()
	{
		InitializeComponent();
        BindingContext = ParcourirManager;
    }

    async void OnGame_Tapped(System.Object sender, EventArgs e)
    {
        var selectedjeu = (sender as ImageButton)?.BindingContext as Jeu;
        if (selectedjeu != null)
        {
            //await Shell.Current.GoToAsync(nameof(PageJeu(selectedjeu));      ---- Ne marche pas ----
            await Navigation.PushAsync(new PageJeu(selectedjeu));
        }
       
    }

    async void Back_Tapped(System.Object sender, Microsoft.Maui.Controls.TappedEventArgs e)
    {
        await Navigation.PopAsync();
    }
}