title: How to select tabs with AvalonDock
body: <p>I'm trying to select tabs (both in a LayoutDocumentPaneGroup and LayoutAnchorablePane) in AvalonDock. This seems like it should be an easy task, but I'm struggling to find any documentation on the subject. So far the best I've gotten is the ability to select the initial tab (see below), but this binding doesn't seem to persist when changing the bound property after the initial load.</p>
  
  <pre><code>    &lt;dock:DockingManager Name="DockingManager" Grid.Row="2" 
                           AnchorablesSource="{Binding Anchorables}" 
                           DocumentsSource="{Binding Documents}" 
                           DocumentClosed="DockingManager_DocumentClosed"
                           DocumentClosing="DockingManager_DocumentClosing"
                           Loaded="DockingManager_Loaded" 
                           MouseUp="DockingManager_MouseUp"&gt;
          &lt;dock:DockingManager.LayoutItemContainerStyle&gt;
              &lt;Style TargetType="{x:Type dockctrl:LayoutItem}" &gt;
                  &lt;Setter Property="Title" Value="{Binding Model.Title}" /&gt;
                  &lt;Setter Property="CloseCommand" Value="{Binding Model.CloseCommand}" /&gt;
                  &lt;Setter Property="CanClose" Value="{Binding Model.CanClose}" /&gt;
                  &lt;Setter Property="IsSelected" Value="False" /&gt;
                  &lt;Style.Triggers&gt;
                      &lt;DataTrigger Binding="{Binding Model.Title}" Value="Resources"&gt;
                          &lt;Setter Property="IsSelected" Value="True" /&gt;
                      &lt;/DataTrigger&gt;
                  &lt;/Style.Triggers&gt;
              &lt;/Style&gt;
          &lt;/dock:DockingManager.LayoutItemContainerStyle&gt;
  
          &lt;dock:LayoutRoot&gt;
              &lt;dock:LayoutPanel Orientation="Horizontal"&gt;
  
                  &lt;dock:LayoutAnchorablePaneGroup x:Name="leftAnchorableGroup" DockWidth="300" &gt;
                      &lt;dock:LayoutAnchorablePane  /&gt;
                  &lt;/dock:LayoutAnchorablePaneGroup&gt;
  
                  &lt;dock:LayoutPanel Orientation="Vertical"&gt;
                      &lt;dock:LayoutPanel Orientation="Horizontal"&gt;
                          &lt;dock:LayoutDocumentPaneGroup x:Name="leftDocumentGroup"&gt;
                              &lt;dock:LayoutDocumentPane /&gt;
                          &lt;/dock:LayoutDocumentPaneGroup&gt;
                      &lt;/dock:LayoutPanel&gt;
                  &lt;/dock:LayoutPanel&gt;
  
              &lt;/dock:LayoutPanel&gt;
          &lt;/dock:LayoutRoot&gt;
      &lt;/dock:DockingManager&gt;
  </code></pre>
  
  <p>However if I replace these lines:</p>
  
  <pre><code>&lt;Setter Property="IsSelected" Value="False" /&gt;
  &lt;Style.Triggers&gt;
      &lt;DataTrigger Binding="{Binding Model.Title}" Value="Resources"&gt;
          &lt;Setter Property="IsSelected" Value="True" /&gt;
      &lt;/DataTrigger&gt;
  &lt;/Style.Triggers&gt;
  </code></pre>
  
  <p>with:</p>
  
  <pre><code>&lt;Setter Property="IsSelected" Value="{Binding Model.ContentIsSelected" /&gt;
  </code></pre>
  
  <p>...it doesn't work when I change the value of <em>ContentIsSelected</em>. I can see (using Snoop) that the value of <em>ContentIsSelected</em> itself i in fact changing but <em>IsSelected</em> Does not change with it?!</p>
  
  <p>I also found this other question (which lead me down the path of trying to use IsSelected): <a href="https://stackoverflow.com/questions/33918513/how-to-switch-between-document-tabs-in-avalondock-2">How to switch between document tabs in AvalonDock 2</a> However 'm not entirely sure how to programatically access the <em>LayoutItems</em> beyond the bindings in XAML. I tried the <em>DockingManager.GetLayoutItemFromModel()</em> function but could not get it to return anything other than NULL.</p>
  
  <p>How can I select a tab and bring it into view/focus (as if I were clicking the tab with a mouse)?</p>