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