title: Xamarin App opens different Page from Navigation.PushAsync() Page
body: <h3>Description</h3>
  <p>Xamarin application opens different Page upon  NavigationPage.Pushaync().<br/>
  NavigationPage.Asyncpush() is called within a ButtonClicked Method.
  That different page used to be the one being pushed but it no longer is.</p>
  <p>ViewModel.cs</p>
  <pre><code>private async void OnAboutUsClicked()
  {
      var modifiedContactUs = new ModifiedContactUs() { BackgroundColor = ResourceColourModel.BackgroundColor };
      await Application.Current.MainPage.Navigation.PushAsync(modifiedContactUs);
  }
  </code></pre>
  <p>ModifiedContactUs.xaml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
  &lt;ContentPage xmlns=&quot;http://xamarin.com/schemas/2014/forms&quot;
               xmlns:x=&quot;http://schemas.microsoft.com/winfx/2009/xaml&quot;
               x:Class=&quot;Project.Views.Pages.ModifiedContact&quot;
               xmlns:mapObject=&quot;clr-namespace:Xamarin.Forms.Maps;assembly=Xamarin.Forms.Maps&quot;&gt;
      &lt;ContentPage.Content&gt;
          &lt;StackLayout&gt;
              &lt;Grid BackgroundColor=&quot;white&quot;&gt;
                  &lt;mapObject:Map x:Name=&quot;mapId&quot; HasZoomEnabled=&quot;True&quot; MapType=&quot;Street&quot;&gt;
  
                  &lt;/mapObject:Map&gt;
              &lt;/Grid&gt;
          &lt;/StackLayout&gt;
      &lt;/ContentPage.Content&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  <p>ModifiedContactUs.xaml.cs</p>
  <pre><code>using Xamarin.Forms;
  using Xamarin.Forms.Xaml;
  
  namespace Project.Views.Pages
  {
      [XamlCompilation(XamlCompilationOptions.Compile)]
      public partial class ModifiedContactUs : ContentPage
      {
          public ModifiedContactUs()
          {
              InitializeComponent();
          }
      }
  </code></pre>
  <p>ContactUs.xaml(The different Page)</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
  &lt;customControl:CustomContentPage
      xmlns=&quot;http://xamarin.com/schemas/2014/forms&quot;
      xmlns:x=&quot;http://schemas.microsoft.com/winfx/2009/xaml&quot;
      xmlns:d=&quot;http://xamarin.com/schemas/2014/forms/design&quot;
      xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
      xmlns:map =&quot;clr-namespace:Xamarin.Forms.Maps;assembly=Xamarin.Forms.Maps&quot;
      xmlns:ffimageloading=&quot;clr-namespace:FFImageLoading.Svg.Forms;assembly=FFImageLoading.Svg.Forms&quot;
      xmlns:customControl=&quot;clr-namespace:Project.CustomControls.Renderers&quot;
      xmlns:templates_navbar=&quot;clr-namespace:Project.Views.Templates.Menus&quot;
      xmlns:fontAwesome=&quot;clr-namespace:Project._Utilities&quot;
      mc:Ignorable=&quot;d&quot;
      x:Class=&quot;Project.Views.Pages.ContactUs&quot;
      &gt;
  
      &lt;ContentPage.Content&gt;
          &lt;StackLayout BackgroundColor=&quot;Transparent&quot; Spacing=&quot;0&quot;&gt;
              
              &lt;templates_navbar:NavBar DotMenu_IsVisible=&quot;False&quot; BackButton_IsVisible=&quot;True&quot;/&gt;
  
              &lt;Grid BackgroundColor=&quot;white&quot;&gt;
                  &lt;Grid.RowDefinitions&gt;
                      &lt;RowDefinition Height=&quot;.33*&quot;/&gt;
                      &lt;RowDefinition Height=&quot;.07*&quot;/&gt;
                      &lt;RowDefinition Height=&quot;.6*&quot;/&gt;
                  &lt;/Grid.RowDefinitions&gt;
  
                  &lt;Grid Grid.Row=&quot;0&quot;&gt;
                      &lt;Grid.ColumnDefinitions&gt;
                          &lt;ColumnDefinition Width=&quot;.7*&quot;/&gt;
                          &lt;ColumnDefinition Width=&quot;.3*&quot;/&gt;
                      &lt;/Grid.ColumnDefinitions&gt;
  
                      &lt;StackLayout Grid.Column=&quot;0&quot; Padding=&quot;10&quot;&gt;
                          &lt;StackLayout&gt;
                              &lt;Label 
                                  Text=&quot;Company Name&quot; 
                                  FontAttributes=&quot;Bold&quot; 
                                  FontSize=&quot;Medium&quot;
                                  FontFamily=&quot;Lato-Bold&quot;
                                  VerticalOptions=&quot;CenterAndExpand&quot; 
                                  HorizontalOptions=&quot;StartAndExpand&quot; 
                                  /&gt;
                              &lt;Label
                                  Text=&quot;{Binding Address}&quot; 
                                  FontFamily=&quot;Lato-Bold&quot;
                                  VerticalOptions=&quot;CenterAndExpand&quot; 
                                  HorizontalOptions=&quot;StartAndExpand&quot;
                                  /&gt;
                          &lt;/StackLayout&gt;
                          &lt;StackLayout&gt;
                              &lt;Label 
                                  Text=&quot;Opening Times&quot;
                                  FontAttributes=&quot;Bold&quot; 
                                  FontSize=&quot;Medium&quot; 
                                  FontFamily=&quot;Lato-Bold&quot;
                                  VerticalOptions=&quot;CenterAndExpand&quot; 
                                  HorizontalOptions=&quot;StartAndExpand&quot; 
                                  /&gt;
                              &lt;Label
                                  x:Name=&quot;weekdays_lbl&quot;
                                  Text=&quot;{Binding Weekday}&quot;
                                  FontFamily=&quot;Lato-Bold&quot;
                                  VerticalOptions=&quot;CenterAndExpand&quot; 
                                  HorizontalOptions=&quot;StartAndExpand&quot; 
                                  /&gt;
                              &lt;Label 
                                  x:Name=&quot;weekend_lbl&quot; 
                                  Text=&quot;{Binding Weekend}&quot; 
                                  FontFamily=&quot;Lato-Bold&quot;
                                  VerticalOptions=&quot;CenterAndExpand&quot; 
                                  HorizontalOptions=&quot;StartAndExpand&quot; 
                                  /&gt;
                          &lt;/StackLayout&gt;
                      &lt;/StackLayout&gt;
  
                      &lt;StackLayout Grid.Column=&quot;1&quot;&gt;
                          &lt;StackLayout VerticalOptions=&quot;CenterAndExpand&quot;&gt;
  
                              &lt;Button 
                                  x:Name=&quot;CallUsBtn&quot; 
                                  Text=&quot;Call Us&quot;
                                  TextColor=&quot;White&quot;
                                  BackgroundColor=&quot;{StaticResource PrimaryColour}&quot;
                                  FontFamily=&quot;Lato-Bold&quot; 
                                  FontSize=&quot;12&quot;
                                  BorderWidth=&quot;2&quot; 
                                  BorderColor=&quot;White&quot; 
                                  Margin=&quot;1&quot; 
                                  CornerRadius=&quot;22&quot; 
                                  Command=&quot;{Binding PhoneCommand}&quot;
                                  /&gt;
  
                              &lt;Button 
                                  x:Name=&quot;MessageUsBtn&quot; 
                                  Text=&quot;Message&quot; 
                                  TextColor=&quot;White&quot;
                                  BackgroundColor=&quot;{StaticResource PrimaryColour}&quot;
                                  FontFamily=&quot;Lato-Bold&quot; 
                                  FontSize=&quot;12&quot; 
                                  BorderWidth=&quot;2&quot; 
                                  BorderColor=&quot;White&quot; 
                                  Margin=&quot;1&quot; 
                                  CornerRadius=&quot;22&quot; 
                                  Command=&quot;{Binding EmailCommand}&quot;
                                  /&gt;
  
                              &lt;Button 
                                  x:Name=&quot;RequestCallBack&quot; 
                                  Text=&quot;Request CallBack&quot;
                                  TextColor=&quot;White&quot;
                                  BackgroundColor=&quot;{StaticResource AccentColour}&quot;
                                  FontFamily=&quot;Lato-Bold&quot; 
                                  FontSize=&quot;11&quot; 
                                  BorderWidth=&quot;2&quot; 
                                  BorderColor=&quot;White&quot; 
                                  Margin=&quot;1&quot; 
                                  CornerRadius=&quot;22&quot;
                                  Command=&quot;{Binding CallbackCommand}&quot;
                                  /&gt;
  
                          &lt;/StackLayout&gt;
                      &lt;/StackLayout&gt;
  
                  &lt;/Grid&gt;
  
                  &lt;Grid Grid.Row=&quot;1&quot; Padding=&quot;5&quot;&gt;
                      &lt;Grid.ColumnDefinitions&gt;
                          &lt;ColumnDefinition Width=&quot;.25*&quot;/&gt;
                          &lt;ColumnDefinition Width=&quot;.25*&quot;/&gt;
                          &lt;ColumnDefinition Width=&quot;.25*&quot;/&gt;
                          &lt;ColumnDefinition Width=&quot;.25*&quot;/&gt;
                      &lt;/Grid.ColumnDefinitions&gt;
  
                      &lt;StackLayout Grid.Column=&quot;0&quot;&gt;
                          &lt;Grid VerticalOptions=&quot;CenterAndExpand&quot;&gt;
                              &lt;Image
                                  Source=&quot;{FontImage FontFamily={StaticResource MaterialFontFamily},
                                  Glyph={x:Static fontAwesome:IconFonts.Facebook}, Color=#1877F2,Size=60}&quot;
                                  HeightRequest=&quot;80&quot;
                                  /&gt;
                              &lt;Button Clicked=&quot;SocialMediaBtnHandler&quot; BackgroundColor=&quot;Transparent&quot; Margin=&quot;5, 0&quot; CommandParameter=&quot;facebook&quot;/&gt;
                          &lt;/Grid&gt;
                      &lt;/StackLayout&gt;
                      &lt;StackLayout Grid.Column=&quot;1&quot;&gt;
                          &lt;Grid VerticalOptions=&quot;CenterAndExpand&quot;&gt;
                              &lt;Image 
                                  Source=&quot;{FontImage FontFamily={StaticResource MaterialFontFamily},
                                  Glyph={x:Static fontAwesome:IconFonts.Twitter}, Color=#00ACED, Size=60}&quot;/&gt;
                              &lt;Button Clicked=&quot;SocialMediaBtnHandler&quot; BackgroundColor=&quot;Transparent&quot; Margin=&quot;5, 0&quot; CommandParameter=&quot;twitter&quot;/&gt;
                          &lt;/Grid&gt;
                      &lt;/StackLayout&gt;
                      &lt;StackLayout Grid.Column=&quot;2&quot;&gt;
                          &lt;Grid VerticalOptions=&quot;CenterAndExpand&quot;&gt;
                              &lt;Image
                                  Source=&quot;{FontImage FontFamily={StaticResource MaterialFontFamily},
                                  Glyph={x:Static fontAwesome:IconFonts.Linkedin}, Color=#0E76A8, Size=60}&quot;/&gt;
                              &lt;Button Clicked=&quot;SocialMediaBtnHandler&quot; BackgroundColor=&quot;Transparent&quot; Margin=&quot;5, 0&quot; CommandParameter=&quot;linkedIn&quot;/&gt;
                          &lt;/Grid&gt;
                      &lt;/StackLayout&gt;
                      &lt;StackLayout Grid.Column=&quot;3&quot;&gt;
                          &lt;Grid VerticalOptions=&quot;CenterAndExpand&quot; Padding=&quot;2&quot;&gt;
                              &lt;ffimageloading:SvgCachedImage
                                  Source=&quot;social_logo_instagram.png&quot;
                                  HeightRequest=&quot;40&quot;/&gt;
                              &lt;Button Clicked=&quot;SocialMediaBtnHandler&quot; BackgroundColor=&quot;Transparent&quot; Margin=&quot;5, 0&quot; CommandParameter=&quot;instagram&quot;/&gt;
                          &lt;/Grid&gt;
                      &lt;/StackLayout&gt;
  
                  &lt;/Grid&gt;
  
                  &lt;Grid Grid.Row=&quot;2&quot;&gt;
                      &lt;Grid&gt;
                          &lt;StackLayout Grid.Row=&quot;0&quot; Padding=&quot;5&quot;&gt;
                              &lt;map:Map x:Name=&quot;mapObject&quot; HasZoomEnabled=&quot;True&quot; MapType=&quot;Street&quot;&gt;
                                  &lt;map:Map.ItemTemplate&gt;
                                      &lt;DataTemplate&gt;
                                          &lt;map:Pin
                                              Position=&quot;{Binding Position}&quot;
                                              Address=&quot;{Binding Address}&quot;
                                              Label=&quot;{Binding PlaceName}&quot;
                                              /&gt;
                                      &lt;/DataTemplate&gt;
                                  &lt;/map:Map.ItemTemplate&gt;
                              &lt;/map:Map&gt;
                          &lt;/StackLayout&gt;
                      &lt;/Grid&gt;
                  &lt;/Grid&gt;
  
  
              &lt;/Grid&gt;
  
              &lt;AbsoluteLayout  BackgroundColor=&quot;Red&quot; HorizontalOptions=&quot;FillAndExpand&quot; VerticalOptions=&quot;FillAndExpand&quot; AbsoluteLayout.LayoutBounds=&quot;0, 0, 1, 1&quot; AbsoluteLayout.LayoutFlags=&quot;SizeProportional&quot;&gt;
  
  
              &lt;/AbsoluteLayout&gt;
  
          &lt;/StackLayout&gt;
      &lt;/ContentPage.Content&gt;
  &lt;/customControl:CustomContentPage&gt;
  </code></pre>
  <p>ContactUs.xaml.cs (The different page)</p>
  <pre><code>using Project._SharedData;
  using Project.CustomControls.Renderers;
  using Project.Models;
  using Project.ViewModels;
  using Rg.Plugins.Popup.Services;
  using System;
  using Xamarin.Essentials;
  using Xamarin.Forms;
  using Xamarin.Forms.Maps;
  using Xamarin.Forms.Xaml;
  
  namespace Project.Views.Pages
  {
      [XamlCompilation(XamlCompilationOptions.Compile)]
      [System.ComponentModel.DesignTimeVisible(false)]
      public partial class ContactUsPage : CustomContentPage
      {
          ContactUsVM _ContactUsVM;
          public ContactUsPage()
          {
              InitializeComponent();
              BindingContext = _ContactUsVM = new ContactUsVM();
              initMap();
  
              configureDisplay();
  
              setFontOpeningTime();
          }
  
          protected override void OnAppearing()
          {
              base.OnAppearing();
  
              _ContactUsVM.OnAppearing();
              configureDisplay();
          }
  
          protected override void OnDisappearing()
          {
              base.OnDisappearing();
              _ContactUsVM.OnDisappearing();
  
              try
              {
                  if (PopupNavigation.Instance != null)
                      PopupNavigation.Instance.PopAsync(true);
              }
              catch (Exception) { }
          }
  
          private void setFontOpeningTime()
          {
              DayOfWeek day = DateTime.Now.DayOfWeek;
  
              // Set the font based on whether current day is weekday or weekend
              if ((day == DayOfWeek.Saturday) || (day == DayOfWeek.Sunday))
              {
                  weekend_lbl.FontAttributes = FontAttributes.Bold;
              }
              else
              {
                  weekdays_lbl.FontAttributes = FontAttributes.Bold;
              }
          }
  
          private void configureDisplay()
          {
              if (!string.IsNullOrEmpty(SharedPrefs.UserSessionEmail))
              {
                  RequestCallBack.IsVisible = true;
                  MessageUsBtn.Text = &quot;Email&quot;;
              }
              else
              {
                  RequestCallBack.IsVisible = false;
                  MessageUsBtn.Text = &quot;Message&quot;;
              }
          }
  
          private async void SocialMediaBtnHandler(object sender, EventArgs e)
          {
              string socialMediaName = (sender as Button).CommandParameter.ToString().ToLower();
              await Launcher.OpenAsync(SocialMediaModel.WebLink(socialMediaName));
          }
  
  
  
          private void initMap()
          {
              try
              {
                  double latitude = Convert.ToDouble(SharedData.CompanyDetailsList[0].Latitude);
                  double longitude = Convert.ToDouble(SharedData.CompanyDetailsList[0].Longitude);
  
                  mapObject.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(latitude, longitude), Distance.FromMeters(100)));
  
                  mapObject.ItemsSource = SharedData.CompanyDetailsList;
              }
              catch (Exception e)
              {
                  Console.WriteLine(e.Message);
              }
          }
      }
  }
  </code></pre>
  <h3>Expected behavior</h3>
  <p>To navigate to a new Page named ModifiedContactUs</p>
  <h3>Actual behavior:</h3>
  <p>Navigates to page called named ContactUs</p>
  <h3>Basic Information:</h3>
  <p>Android Build:<br/>
  -minimum level 21 <br/>
  -Target level 30<br/>
  Devices: <br/>
  -Huawei Y6 2019 <br/>
  -API level 29
  <br/>
  <br/>
  -Pixel 5 <br/>
  -API level 30</p>
  <h3>Notes</h3>
  <p>This question is different to from the <a href="https://stackoverflow.com/questions/71529505/xamarin-navigationpage-pushasync-crashes">first question</a>  I asked recently (Where the device crashes). This is behavior happens on all devices I test on except the one from that <a href="https://stackoverflow.com/questions/71529505/xamarin-navigationpage-pushasync-crashes">first question</a></p>