Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

public partial class HomePage : ContentPage
   {
       public HomePage()
       {
           InitializeComponent();
       }
       private void NavigateButton_OnClicked(object sender, EventArgs e)
       {
           Navigation.PushAsync(new NavigationPage(new SectionA_Form()));
       }
   }


What I have tried:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="WalgreensVaccine.Pages.HomePage">
    <ContentPage.Content>
        <StackLayout BackgroundColor="WhiteSmoke">
        <!-- Header-->
        <StackLayout VerticalOptions="Start" BackgroundColor="AntiqueWhite"  Margin="0,10,0,0" >
          
            <Label Text="Walgreens Covid Form" FontAttributes="Italic" FontSize="Header" TextColor="Red" HorizontalOptions="Center" />
            
        </StackLayout>

        <!-- Content  -->
         <StackLayout VerticalOptions="CenterAndExpand">
                <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>
               
            </StackLayout>
        </StackLayout>

    </ContentPage.Content>
</ContentPage>


public partial class SectionA_Form : ContentPage
{
public SectionA_Form()
{
InitializeComponent();
}
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900