title: Force my tabitem to calcultate its width
body: <p>I have the following style for my tabitems :</p>
  
  <pre><code>&lt;Style x:Key="BoutonMenuHaut" TargetType="{x:Type TabItem}"&gt;
              &lt;Setter Property="OverridesDefaultStyle" Value="True"/&gt;
              &lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate TargetType="{x:Type TabItem}"&gt;
                          &lt;Border Height="40" HorizontalAlignment="Stretch" CornerRadius="0" Name="border"&gt;
                              &lt;Grid&gt;
                                  &lt;ContentPresenterVerticalAlignment="Center"
                            HorizontalAlignment="Left"
                              TextBlock.Foreground="{StaticResource CouleurTexteBoutonsHaut}"
                              TextBlock.FontSize="{DynamicResource FontSizeBig}"
                              Name="textTab" 
                              ContentSource="Header" Margin="10,0,60,0"
                              RecognizesAccessKey="True"&gt;
                                  &lt;/ContentPresenter&gt;
                                  &lt;Rectangle Height="2" x:Name="separation" Fill="Red" VerticalAlignment="Bottom" /&gt;
                              &lt;/Grid&gt;
                          &lt;/Border&gt;
                      &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
          &lt;/Style&gt;
  </code></pre>
  
  <p>As you can see I bind the fontsize to a value defined like this :</p>
  
  <pre><code>xmlns:sys="clr-namespace:System;assembly=mscorlib"
  &lt;sys:Double x:Key="FontSizeBig"&gt;16&lt;/sys:Double&gt;
  </code></pre>
  
  <p>And in the window_sizechanged event I do this :</p>
  
  <pre><code>this.Resources["FontSizeBig"] = TextSizeFromResolution(12, height);
  </code></pre>
  
  <p>where height is the height of the screen.</p>
  
  <p>But when I resize my window my tabitem doesn't resize itself and i'm not able to see all my tabs in the page anymore.</p>
  
  <p>So my question is : How can I force the tabcontrol to resize the tabitems when the size changes ? (because the size of the text has changed so the tabitem's width should change too.
  I've tried InvalidateMeasure, Update Layout... but I could not manage to make it work.</p>
  
  <p>Could you help me ?</p>
  
  <p>Thanks !</p>