title: ItemsPanelTemplate Selector in wpf?
body: <p>I need to set the ItemsPanelTemplate property of a listbox based on a dependency property on the control. How do I use the DataTemplateSelector to do that?</p>
  
  <p>I have something like:</p>
  
  <pre><code>&lt;ListBox.ItemsPanel&gt;
      &lt;ItemsPanelTemplate&gt;
          &lt;!-- Here I need to replace with either a StackPanel or a wrap panel--&gt;
      &lt;/ItemsPanelTemplate&gt;
  &lt;/ListBox.ItemsPanel&gt;
  </code></pre>
  
  <p>Thanks</p>