title: Assigning event GotFocus to all TextBoxes in WPF-Aplication
body: <p>I wanted to add GotFocus-Event to every Textbox in my WPF-Aplication, because its for Touch Devices and everytime a TextBox is in use the OSK should open. I got Problems with procedure adding the Event to my TextBoxes. The Aplication is already build for pc (I'm in an interhsip and my goal is it to bring this Apl. to Windows 8 Touch Devices).This is the link, where I got my Inspiration from: <a href="https://stackoverflow.com/questions/8657503/add-remove-handler-to-textbox">Add/Remove handler to textbox</a></p>
  
  <p>and here is my Solution:</p>
  
  <pre><code>private void Window_Loaded(object sender, RoutedEventArgs e)
  {
      foreach (Control tb in this.Controls)
      {
          if (tb is TextBox)
          {
              TextBox tb1 = (TextBox)tb;
              tb1.GotFocus += TextBox_GotFocus;
          }
      }
  }
  
  private void TextBox_GotFocus(object sender, RoutedEventArgs e)
  {
      KeyBoardManager.LaunchOnScreenKeyboard();
  }
  </code></pre>
  
  <p>when I want to run this Code I have the following Error:</p>
  
  <blockquote>
    <p>Error 1   'OSK_Test.MainWindow' does not contain a definition for
    'Controls' and no extension method 'Controls' accepting a first
    argument of type 'OSK_Test.MainWindow' could be found (are you missing
    a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>What have I got to do, that it works? And of course it's the same with LostFocus!</p>