title: Xamarin Forms TemplateSelector for View
body: <p>I would like to use a TemplateSelector to select a View. Not for ListViewItems, like every example out there shows, but with a "normal" View. So i tried <code>TemplatedView</code>, <code>ContentPresenter</code> and <code>ContentView</code>. But non of them is able to take a TemplateSelector. </p>
  
  <p>Is there something i have missed? Or how can i work around that?</p>
  
  <p>EDIT:
  I have a TemplateSelector, just like described <a href="https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/templates/data-templates/selector/" rel="nofollow noreferrer">here</a>. Now i want to add this Selector to some kind of ViewElement. Thats what i tried:</p>
  
  <pre><code>&lt;TemplatedView ControlTemplate="{StaticResource ViewItemTemplateSelector}"/&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>&lt;ContentPresenter Content="{StaticResource ViewItemTemplateSelector}"/&gt;
  </code></pre>
  
  <p>But nothing works, it always says "Invalid resource type"</p>
  
  <p>EDIT2:</p>
  
  <pre><code>&lt;ResourceDictionary MergedWith="dataTemplates:DataTemplates"&gt;
          &lt;helper:ViewItemTemplateSelector x:Key="ViewItemTemplateSelector" 
                                           TextDataTemplate="{StaticResource TextDataTemplate}"/&gt;
  </code></pre>