title: WPF TabControl with a fixed height
body: <p>I am trying to create a generic dialog which is paged using a TabControl.  The dialog has SizeToContent="true" so that the dialog has no unused white-space.  The TabControl uses the ItemsSource to set the page content from the model and a ContentTemplateSelector to select the page layout.</p>
  
  <p>The problem I am having is the SizeToContent effect is causing the dialog to resize every time the TabControl.SelectedItem changes where I would rather the dialog sized itself using the content from the largest TabItem.</p>
  
  <p>I've tried using SharedSizeGroup option but this doesn't work.  I think this is because a TabControl with an ItemsSource and a ContentTemplateSelector will load the selected tab only and discards the rest, so there is only ever one element of the SharedSizeGroup that is instantiated at one time.</p>
  
  <p><a href="https://stackoverflow.com/questions/1073770/let-wpf-tabcontrol-height-assume-height-of-largest-item">This article</a> offers another solution where each TabItem is measured but this solution doesn't work for me because I am using an ItemsSource and reading the Items collection returns my model objects and not TabItems.</p>
  
  <p>If anyone can offer a solution to this I would be very grateful.</p>