title: Difficulty with tabControl/tabitem refresh
body: <p>I have a WPF window with a maintabWindow and several tabitems.
  It normally works fine and the layout is this:</p>
  
  <p><a href="https://i.stack.imgur.com/oNnLQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oNnLQ.png" alt="enter image description here"></a></p>
  
  <p>but when I BEFORE add the following window:</p>
  
  <p><a href="https://i.stack.imgur.com/1AM4K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1AM4K.png" alt="enter image description here"></a></p>
  
  <p>the result is this:</p>
  
  <p><a href="https://i.stack.imgur.com/uROIi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uROIi.png" alt="enter image description here"></a></p>
  
  <p>So the problem is related with the tabControl/tabItem refresh.
  This is fairly obvious but even more because if I move the window or pass with the mouse on the a tabItem they get refreshed one by one.</p>
  
  <p>I searched and found that here is a solution: <a href="http://geekswithblogs.net/NewThingsILearned/archive/2008/08/25/refresh--update-wpf-controls.aspx" rel="nofollow noreferrer">http://geekswithblogs.net/NewThingsILearned/archive/2008/08/25/refresh--update-wpf-controls.aspx</a> </p>
  
  <p>so I added:</p>
  
  <pre><code>  this.MainTab.Refresh();
    this.tabItem1.Refresh();
    this.tabItem2.Refresh();
    this.tabItem3.Refresh();
    this.tabItem4.Refresh();
    this.tabItem5.Refresh();
  </code></pre>
  
  <p>but that didn't change a thing.</p>
  
  <p>Thanx for any help</p>