title: TextBox.TextChanged event firing twice on Windows Phone 7 emulator
body: <p>I have a very simple test app just to play around with Windows Phone 7. I've just added a <code>TextBox</code> and a <code>TextBlock</code> to the standard UI template. The only custom code is the following:</p>
  
  <pre><code>public partial class MainPage : PhoneApplicationPage
  {
      public MainPage()
      {
          InitializeComponent();
      }
  
      private int counter = 0;
  
      private void TextBoxChanged(object sender, TextChangedEventArgs e)
      {
          textBlock1.Text += "Text changed " + (counter++) + "\r\n";
      }
  }
  </code></pre>
  
  <p>The <code>TextBox.TextChanged</code> event is wired up to <code>TextBoxChanged</code> in the XAML:</p>
  
  <pre><code>&lt;TextBox Height="72" HorizontalAlignment="Left" Margin="6,37,0,0"
           Name="textBox1" Text="" VerticalAlignment="Top"
           Width="460" TextChanged="TextBoxChanged" /&gt;
  </code></pre>
  
  <p>However, every time I press a key when running in the emulator (either the on-screen keyboard or the physical one, having pressed Pause to enable the latter) it increments the counter twice, displaying two lines in the <code>TextBlock</code>. Everything I've tried shows that the event is genuinely firing twice, and I've no idea why. I've verified that it's only being subscribed once - if I unsubscribe in the <code>MainPage</code> constructor, nothing happens at all (to the text block) when the text changes.</p>
  
  <p>I've tried the equivalent code in a regular Silverlight app, and it didn't occur there. I don't have a physical phone to reproduce this with at the moment. I haven't found any record of this being a known problem in the Windows Phone 7.</p>
  
  <p>Can anyone explain what I'm doing wrong, or should I report this as a bug?</p>
  
  <p>EDIT: To reduce the possibility of this being down to having two text controls, I've tried removing the <code>TextBlock</code> completely, and changing the TextBoxChanged method to <em>just</em> increment <code>counter</code>. I've then run in the emulator, typed 10 letters and <em>then</em> put a breakpoint on the <code>counter++;</code> line (just to get rid of any possibility that breaking into the debugger is causing issues) - and it shows <code>counter</code> as 20.</p>
  
  <p>EDIT: I've now <a href="http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/thread/cb9b5544-a75e-4c9c-8475-0bf29e0bb5e3" rel="noreferrer">asked in the Windows Phone 7 forum</a>... we'll see what happens.</p>