I'm trying to bind to properties on my GridView's DataContext and use a DataTemplateSelector to assign the correct template to the cell, but I can't seem to find the correct way to do this. Binding to DisplayMemberBinding overrides the template selector, but setting the CellTemplateSelector property binds to the DataContext rather than the properties I want to select templates for.
This answer seems to describe exactly what I'm looking for, but I'm having trouble finding information on how to implement what it describes: https://stackoverflow.com/a/12519433/1756960 .
This is what I tried using that isn't working (simplified for posting):
<ListView ItemsSource="{Binding Items}">
<ListView.View>
<GridView>
<GridViewColumn Header="Name"
DisplayMemberBinding="{Binding Name}"
CellTemplateSelector="{StaticResource ContentTypeTemplateSelector}" />
<GridViewColumn Header="Data"
DisplayMemberBinding="{Binding}"
CellTemplateSelector="{StaticResource ContentTypeTemplateSelector}" />
</GridView>
</ListView.View>
</ListView>