Now I have a ListView and in one column there is:
<GridViewColumn CellTemplateSelector="{StaticResource messagerEditorTemplateSelector}"/>
And that's all right: the cell is filled with content based on the element. But now I want to place 2 controls in this cell: for one template, it must be selected based on the binding, and the other with a name, for example TimeRangeView
. But I do not understand how this can be implemented? So I should have code like:
<GridViewColumn> <DataTemplate> <StackPanel> <SomeControlWhichSupportTemplateSelector ... /> <views:TimeRangeView ... /> </StackPanel> </DataTemplate> </GridViewColumn>`
What control should be used for a template? I found only the list, but it should be attached to the collection. Of course, I could communicate like:
<ListBox ItemsSource="{Binding Converter=ItemToCollectionConverter}" />
but he does not look elegant. Maybe there is another way to do this?
source share