title: Why does WPF IsKeyboardFocused provide false information?
body: <p>I attempted to follow a pattern described in an answer to this question.
  <a href="https://stackoverflow.com/questions/6737843/how-to-set-focus-to-textbox-using-mvvm">How to set focus to textbox using MVVM?</a></p>
  
  <p>However, I am having trouble with the concept of keyboard focus.  If I have notepad or some other application running at the same time as my WPF application and click on notepad to put the keyboard focus there, then do something to cause my other application to put the focus into one of its text boxes, then the trigger gives the visual cue that my application's text box now has the keyboard focus.  However when I start typing I can see that is not the case because the text is actually going into notepad.  </p>
  
  <p>Here is the xaml for my trigger.</p>
  
  <pre><code>&lt;TextBox.Style&gt;
      &lt;Style TargetType="{x:Type TextBox}"&gt;
          &lt;Style.Triggers&gt;
              &lt;DataTrigger Binding="{Binding ReadyForDataEntry}" Value="True"&gt;
                  &lt;Setter Property="FocusManager.FocusedElement" Value="{Binding RelativeSource={RelativeSource Self}}" /&gt;
             &lt;/DataTrigger&gt;
              &lt;Trigger Property="IsKeyboardFocused" Value="true"&gt;
                  &lt;Setter Property="Background" Value="Lavender"/&gt;
                  &lt;Setter Property="BorderBrush" Value="Blue"/&gt;
              &lt;/Trigger&gt;
          &lt;/Style.Triggers&gt;
   &lt;/Style&gt;
  </code></pre>
  
  <p></p>
  
  <p>Essentially the textbox will sometimes light up with the border and background color indicating that IsKeyboardFocused = true for that textbox, even though keyboard entry will be received by whatever application (e.g., one note, notepad) was last clicked in.  What am I missing?  Why would that WPF control have IsKeyboardFocused set true when the keyboard focus is clearly not true at all?</p>