title: Difference between PreviewMouseLeftButtonDown and MouseLeftButtonDown WPF
body: <p>While learning WPF (I am new to this), I created a simple Window and put one TextBox for entering username. I put some Text value initially in this TextBox (say Username). I wanted this text to disappear as soon as MouseLeftButtonDown is fired. Below is my xaml and C# code-</p>
  
  <pre><code>&lt;TextBox Name="usernameTextBox" Background="Transparent" PreviewMouseLeftButtonDown="usernameTextBox_PreviewMouseLeftButtonDown"  HorizontalAlignment="Left" Height="23" Margin="10,103,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="166" Text="Username" /&gt;
  </code></pre>
  
  <p>C# code</p>
  
  <pre><code>private void usernameTextBox_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  {
       if (usernameTextBox.Text.ToLower() == "username")         
          usernameTextBox.Text = "";                       
  }
  </code></pre>
  
  <p>This however, didn't work. After some search, I came across <a href="https://stackoverflow.com/questions/12496258/mouseleftbuttonup-does-not-fire">this SO question</a>.
  And PreviewMouseLeftButtonDown event worked as expected.</p>
  
  <p>So my question is, what is the difference between these two events and how would I know when to use one and when to use the other?</p>
  
  <p>Thanks!</p>