title: Failed to assign to property 'System.Windows.Controls.Primitives.ButtonBase.Click'
body: <p>Have an interesting situation which I do not understand.</p>
  
  <p>Here's the scenario:</p>
  
  <p>I create a simple Silverlight 5 application.  I place a button control on the main page and create a Click event handler. </p>
  
  <p>XAML is shown below.....</p>
  
  <pre><code>&lt;UserControl x:Class="SilverlightApplication6.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      mc:Ignorable="d"
      d:DesignHeight="300" d:DesignWidth="400"&gt;
  
      &lt;Grid x:Name="LayoutRoot" Background="White"&gt;
          &lt;Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="130,43,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" /&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>So far so good.</p>
  
  <p>Wire up an event handler in code behind as so ....</p>
  
  <pre><code>private void button1_Click(object sender, RoutedEventArgs e)
  {
      MessageBox.Show("Hi There!!!");
  }
  </code></pre>
  
  <p>Compile and run the app. I 'Click' the button and get a nice little message box. Again, so far, so good.</p>
  
  <p>Add a new method (as shown below) to the code behind with the same method name as the button click event handler but with a different signature. </p>
  
  <pre><code>private void button1_Click()
  {
      MessageBox.Show("This method causes a XamlParseException!");
  }
  </code></pre>
  
  <p>Compile and execute the code. Bring up the app and click on the button and I get the following exception:</p>
  
  <pre><code>System.Windows.Markup.XamlParseException was unhandled by user code
    Message=Failed to assign to property 'System.Windows.Controls.Primitives.ButtonBase.Click'. [Line: 10 Position: 149]
    LineNumber=10
    LinePosition=149
    StackTrace:
         at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
         at SilverlightApplication6.MainPage.InitializeComponent()
         at SilverlightApplication6.MainPage..ctor()
         at SilverlightApplication6.App.Application_Startup(Object sender, StartupEventArgs e)
         at MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
         at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)
    InnerException: 
  </code></pre>
  
  <p>Why does this happen?</p>