title: Dotnet MAUI with MVMM - Dynamic dataTemplate based on ObservableCollection<T> where T is an interface
body: <p>I'm trying de build a new DotNet MAUI application.</p>
  <p>I have a datasource of this kind :
  <code>public ObservableCollection&lt;IIpxElement&gt; IpxElements { get; }</code></p>
  <p>With this in the Xaml</p>
  <pre><code>&lt;CollectionView ItemsSource=&quot;{Binding IpxElements}&quot; SelectionMode=&quot;None&quot;&gt;
     &lt;CollectionView.ItemsLayout&gt;
       &lt;GridItemsLayout Orientation=&quot;Vertical&quot; Span=&quot;2&quot; /&gt;
    &lt;/CollectionView.ItemsLayout&gt;
  &lt;/CollectionView&gt;
  </code></pre>
  <p>I don't want to create a DataTemplateSelector for each type who implements <code>IIpxElement</code></p>
  <p>When i was using WPF and Caliburn Micro i could do something like that :</p>
  <pre><code>&lt;ItemsControl x:Name=&quot;IpxElements&quot;&gt;
    &lt;ItemsControl.ItemTemplate&gt;
      &lt;DataTemplate&gt;
        &lt;ContentControl cal:View.Model=&quot;{Binding}&quot; /&gt;
      &lt;/DataTemplate&gt;
    &lt;/ItemsControl.ItemTemplate&gt;
  &lt;/ItemsControl&gt;
  </code></pre>
  <p>The binding between the Name and the ItemSource was automatic but here i don't really care.</p>
  <p>I just want to have a &quot;dynamic&quot; dataTemplate based on associated concrete type (of ViewModel) and view (by naming convention) since i could have a lot of implementation.</p>
  <p>Is there anyway of doing something like this ?</p>
  <p>Thanks you,</p>
  <p>Cyril</p>