Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

XamlParseException Can't find button's click event method

$
0
0

I have researched an answer to this problem on several occasions and haven't even seen anybody else running into this issue, so I hope someone could help me out here. I have a Xamarin Forms project (only concentrating on iOS for now). All the UI is coded in the XAML file and assigning the events to the code behind. Everything was working fine yesterday, I open the project today, try to rebuild, and the app crashes as soon as it opens with XamlParseException saying it can't find the click event for my button. Nothing has changed at all with the project. A couple weeks ago this happened, and after not being able to figure it out, I simply created a new project and copied everything over to the new project. That worked for the last week or so until today. I can't recreate the project every time this arises, so I really need to figure out what is going on.

Here is a snippet of the xaml:
<?xml version="1.0" encoding="utf-8" ?>

  <ContentPage.Padding>
    <OnPlatform x:TypeArguments="Thickness" iOS="0, 20, 0, 0" />
  </ContentPage.Padding>

  <ScrollView x:Name="scroll_view" HorizontalOptions="Center">
    <Grid>
      <StackLayout Spacing="0" Grid.Row="1">
        <Grid x:Name="grid_Login" RowSpacing="15" ColumnSpacing="10" WidthRequest="350" HorizontalOptions="Center">
          <... />
          <Button Image="ic_Settings.png" Clicked="BtnSettingsClicked" WidthRequest="56" HeightRequest="42"/>
        </Grid>
      </StackLayout>
    </Grid>
  </ScrollView>
</ContentPage>

And the code-behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;

namespace Pages
{
    public partial class LoginPage : ContentPage
    {
        public LoginPage()
        {
            InitializeComponent();
        }

        private void BtnSettingsClicked(object sender, EventArgs args)
        {
            //...
        }
    }
}

I'm using Visual Studio 2013, Xamarin Forms 1.4.0.0. On the mac, Xamarin.iOS 8.8.1.9, Build Host 3.9.0.512. If anyone could provide some insight, that would be great.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>