title: How to declare event handlers inside ControlTemplate?
body: <p>I have the following <code>ControlTemplate</code>:</p>
  
  <pre><code>&lt;ControlTemplate&gt;
      &lt;Grid VerticalAlignment="Stretch" HorizontalAlignment="Left" Width="400"&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width="18" /&gt;
              &lt;ColumnDefinition Width="20*" /&gt;
              &lt;ColumnDefinition Width="20*" /&gt;
              &lt;ColumnDefinition Width="20*" /&gt;
              &lt;ColumnDefinition Width="45" /&gt;
          &lt;/Grid.ColumnDefinitions&gt;
          &lt;TextBox Grid.Column="1" Template="{StaticResource watermark}" HorizontalAlignment="Stretch" Margin="4,0,0,4" Tag="Number" /&gt;
          &lt;TextBox Grid.Column="2" Template="{StaticResource watermark}" HorizontalAlignment="Stretch" Margin="4,0,0,4" Tag="Login" /&gt;
          &lt;TextBox Grid.Column="3" Template="{StaticResource watermark}" HorizontalAlignment="Stretch" Margin="4,0,0,4" Tag="Password" /&gt;
          &lt;Button Grid.Column="4" HorizontalAlignment="Stretch" Content="Add" Margin="4,0,0,4" Click="AddUser_Click"/&gt;
      &lt;/Grid&gt;
  &lt;/ControlTemplate&gt;
  </code></pre>
  
  <p>How should I write <code>AddUser_Click</code> to get access to textboxes <code>Text</code> properties?</p>
  
  <p><strong>upd:</strong> just to make it clear. I know how to connect <code>Click</code> event handler here. The question is how to read contents of textboxes in it since I cant give them name because they are in a template. </p>