title: WPF Microsoft Ribbon Control does not work with FocusManager?
body: <p>I have a problem where I cannot get the FocusManager to recognize when a Ribbon Control has the focus. </p>
  
  <p>The logic is simple. I put the focus on a text box. I have tried both a RibbonText and Textbox. I see that when I click the Textbox the GotFocus event fires showing that it now has the focus. When I move the mouse on the canvas it should update the Textbox but this does not happen. The FocusManager.GetFocusedElement returns null. I tried this with a Statusbar and added a Textbox. Using a Statusbar the GetFocusedElement returns the Textbox.</p>
  
  <p>This exact same code worked when I had used a grid with two columns. The Grid had a a canvas on the left column and a stackpanel with several expander controls with text boxes in them on the right column. The right was getting too busy with too many expander controls so I switched to the Ribbon Control since the multiple tabs and other features made it an optimal choice.</p>
  
  <p>I have tried all combinations of setting "Focusable" but it does not help</p>
  
  <pre><code>&lt;ribbon:RibbonWindow x:Class="WpfRibbonApplication1.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
          Title="MainWindow" x:Name="RibbonWindow" Width="640" Height="480"&gt;
      &lt;Grid x:Name="LayoutRoot"&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="Auto"/&gt;
              &lt;RowDefinition Height="*"/&gt;
          &lt;/Grid.RowDefinitions&gt;
  
          &lt;ribbon:Ribbon x:Name="Ribbon"&gt;
              &lt;ribbon:Ribbon.ApplicationMenu&gt;
                  &lt;ribbon:RibbonApplicationMenu SmallImageSource="Images\SmallIcon.png"&gt;
                      &lt;ribbon:RibbonApplicationMenuItem Header="Hello _Ribbon" x:Name="MenuItem1" ImageSource="Images\LargeIcon.png"/&gt;
                  &lt;/ribbon:RibbonApplicationMenu&gt;
              &lt;/ribbon:Ribbon.ApplicationMenu&gt;
              &lt;ribbon:RibbonTab x:Name="HomeTab" 
                                Header="Home"&gt;
                  &lt;ribbon:RibbonGroup x:Name="Group1" 
                                      Header="Group1"&gt;
                          &lt;TextBox Name="Try" Width="200" GotFocus="Try_GotFocus"&gt;&lt;/TextBox&gt;                   
                  &lt;/ribbon:RibbonGroup&gt;               
              &lt;/ribbon:RibbonTab&gt;
          &lt;/ribbon:Ribbon&gt;
          &lt;Canvas Grid.Row="1" Height="250" Margin="0,5,0,0" Name="canvas1" Background="AliceBlue" VerticalAlignment="Top" MouseMove="canvas1_MouseMove" /&gt;
      &lt;/Grid&gt;
  &lt;/ribbon:RibbonWindow&gt;
  
  
  using Microsoft.Windows.Controls.Ribbon;
  
  namespace WpfRibbonApplication1
  {
      /// &lt;summary&gt;
      /// Interaction logic for MainWindow.xaml
      /// &lt;/summary&gt;
      public partial class MainWindow : RibbonWindow
      {
          public MainWindow()
          {
              InitializeComponent();
          }
  
          private void canvas1_MouseMove(object sender, MouseEventArgs e)
          {
                  if (e.LeftButton == System.Windows.Input.MouseButtonState.Pressed)
                  {
                      System.Windows.Point p = e.GetPosition(canvas1);
                      var fe = FocusManager.GetFocusedElement(this);   
                      if (fe != null)
                      {
                          var element = fe as FrameworkElement;
  
                          if (element.Name == "Try")
                          {
                              Try.Text = "Canvas has Focus";
                          }
                      }
                  }
          }
  
          private void Try_GotFocus(object sender, RoutedEventArgs e)
          {
              Try.Text = "Got Focus";
          }
      }
  }
  </code></pre>