Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

365
Vistas
MAUI project, cannot navigate to a new page

I've ran into a bug in MAUI and I just wanted to know if I'm the only one or if I'm doing something wrong in this new environment :)

Before I've always been able to do this when navigating to a new page via a button click:

private async void OnButtonClicked(object sender, EventArgs e)
       {
           await Navigation.PushAsync(new Page1());
       } 

But it does not seem to work anymore, this is how my Page1 looks like in C# code:

    public partial class Page1 : ContentPage
    {
        public Page1()
        {
           InitializeComponent();
        }

        protected override async void OnAppearing()
        {
            base.OnAppearing();

            await MainThread.InvokeOnMainThreadAsync(async () => { await LoadRecipes(); });
        }

        private async Task LoadRecipes() 
        {

           //no code yet
        }
    }
}

When I run this code and click the button, nothing happens.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You can navigate using this in a ButtonClick or TapGestureRecongnizer.

private void TapGestureRecognizer_Tapped_2(object sender, EventArgs e)
    {
        App.Current.MainPage = new NavigationPage(new Page1());

    }

Or in a Button.

 private void Button_Clicked(object sender, EventArgs e)
    {
        App.Current.MainPage = new NavigationPage(new Page1());
    }
over 4 years ago · Santiago Trujillo Denunciar

0

Try this: First in your App.xaml.cs

public partial class App : Application
{
    public App()
    {
        InitializeComponent();
        MainPage = new NavigationPage(new MainPage());
    }
}

Then in your MainPage you can do what you are attempiting to do:

private async void btnNav_Clicked(object sender, EventArgs e)
{
    await Navigation.PushAsync(new Page1());
}

This is supposed to work and to keep track of user's navigation, but in some weird scenarios im facing this is not working very well, but it's the solution that Microsoft documents on it's getting started guide. I would like to see more information in their Maui guide about navigation.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda