1

I am trying to create simple multi-screen App.

I added Content Page and button to it.

MapPage.xaml.cs:

[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MapPage : ContentPage
{
    public MapPage ()
    {
        InitializeComponent ();
    }

    void ShowMap(object s, EventArgs e)
    {
    }
}

MapPage.xaml:

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:App14"
             x:Class="App14.MapPage">
    <ContentPage.Content>
        <StackLayout>
            <Label Text="Welcome to Xamarin Forms!" />
            <Button Text="show map" 
                    Clicked="ShowMap"/>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>

I am getting error: ShowMap Method does not have correct signature

What I am doing wrong?

J-Alex
  • 6,881
  • 10
  • 46
  • 64
Dmitry Bubnenkov
  • 9,415
  • 19
  • 85
  • 145
  • Check if this helps to resolve your issue: [https://stackoverflow.com/questions/38067982/button-does-not-have-the-correct-signature-xamarin](https://stackoverflow.com/questions/38067982/button-does-not-have-the-correct-signature-xamarin) – Habeeb Jul 31 '17 at 12:40

1 Answers1

1

change the event handler from private (the default if not specified) to protected

protected void ShowMap(object s, EventArgs e)
        {

        }
Jason
  • 86,222
  • 15
  • 131
  • 146