title: WPF Virtualized TreeView with different orientations within doesn't virtualize?
body: <p>I have a <code>TreeView</code> in XAML with multiple layers. Using <a href="https://stackoverflow.com/a/42842476/3063273">this solution</a> I can get a XAML-configured look for each of the different layers, and confirmed that it is UI virtualizing.</p>
  
  <p>However, when I switch a particular layer's <code>VirtualizingStackPanel</code> to have a different <code>Orientation</code> (it doesn't matter whether through code like <a href="https://stackoverflow.com/a/42860839/3063273">this solution</a>, or with <a href="https://snoopwpf.codeplex.com/" rel="nofollow noreferrer">Snoop</a>) than its parent, then UI virtualization switches off and the <code>TreeView</code> realizes all the <code>TreeViewItem</code>s as soon as I expand that layer.</p>
  
  <p>While researching this behavior I noticed that within the reference source for <code>VirtualizingStackPanel</code> as you drill into its <code>MeasureOverride</code> function, you find <a href="https://referencesource.microsoft.com/#PresentationFramework/src/Framework/System/Windows/Controls/VirtualizingStackPanel.cs,2116" rel="nofollow noreferrer">this comment on line 2116</a>:</p>
  
  <blockquote>
    <p>Compute if this panel is different in orientation that (sic) either its parent or descendents</p>
  </blockquote>
  
  <p>It appears that Microsoft has intentionally disabled UI virtualization for this case. So I have two questions:</p>
  
  <ul>
  <li>Why does it matter to have orientation consistency between layers?</li>
  <li>How can I get UI virtualization to work with a <code>TreeView</code> having different orientations within it?</li>
  </ul>