Muthu vj

Muthu vj

  • 1.2k
  • 163
  • 9.5k

'Pushasync is not supported globally on windows, please use a navigati

Mar 18 2021 11:17 AM
hi in xamarin form i am facing this Error while clicking the button for navigating another page. can you help me on this how to fix the Error
  1. public partial class HomePage: ContentPage {  
  2.   public HomePage() {  
  3.     InitializeComponent();  
  4.   }  
  5.   private void NavigateButton_OnClicked(object sender, EventArgs e) {  
  6.     Navigation.PushAsync(new NavigationPage(new SectionA_Form()));  
  7.   }  
  8. }  
  1. <?xml version="1.0" encoding="utf-8" ?>  
  2. <ContentPage  
  3.     xmlns="http://xamarin.com/schemas/2014/forms"  
  4.     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="WalgreensVaccine.Pages.HomePage">  
  5.     <ContentPage.Content>  
  6.         <StackLayout BackgroundColor="WhiteSmoke">  
  7.             <!-- Header-->  
  8.             <StackLayout VerticalOptions="Start" BackgroundColor="AntiqueWhite" Margin="0,10,0,0" >  
  9.                 <Label Text="Walgreens Covid Form" FontAttributes="Italic" FontSize="Header" TextColor="Red" HorizontalOptions="Center" />  
  10.             </StackLayout>  
  11.             <!-- Content -->  
  12.             <StackLayout VerticalOptions="CenterAndExpand">  
  13.                 <Button x:Name="sectionA" Clicked="NavigateButton_OnClicked" Text="Section A" BorderWidth="2" BorderColor="CadetBlue" FontSize="Medium" BackgroundColor="DarkRed" TextColor="White" HorizontalOptions="Center" WidthRequest="500" HeightRequest="50"></Button>  
  14.             </StackLayout>  
  15.         </StackLayout>  
  16.     </ContentPage.Content>  
  17. </ContentPage>  
  1. public partial class SectionA_Form : ContentPage  
  2. {  
  3. public SectionA_Form()  
  4. {  
  5. InitializeComponent();  
  6. }  
  7. }

Answers (1)