I think your approach is slightly off if I am understanding what you are trying to build.
In essence you want to build a filter builder correct?
So you want to populate a list with the filters
so something like this
Column A | "operator" | value | And/Or
Column B | "operator" | value | And/Or
Column B | "operator" | value |
If that is the case, I would use an item template that is more like this:
ComboBoxA | ComboBoxB | Textbox | ComboboxC
ComboBoxA's datasource is a list of available columns
ComboBoxB's datasource is a list of available operators (which in turn can be filtered based on the datatype of the selected column
ComboBoxC is empty/and/or (empty for when it is the last option) then as soon as And or Or is selected a new entry in the main list can be added.
Does that make sense?
----------------------------------------------------------------
Okay, so this is what I produced, it is a non-working example but it should point you in the right direction.
This is a DataTemplate to be added to your windows resources:
<DataTemplate x:Key="filterEntry" DataType="MyClasses:FilterComponent">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ComboBox Grid.Column="0" Margin="2" ItemsSource="{Binding Path=ColumnList}" SelectedItem="{Binding Path=Column}" />
<ComboBox Grid.Column="1" Margin="2" ItemsSource="{Binding Path=OperatorList}" SelectedItem="{Binding Path=Operator}" />
<TextBox Grid.Column="2" Margin="2" Text="{Binding Path=FilterValue}" />
<ComboBox Grid.Column="3" Margin="2" ItemsSource="{Binding Path=CombinerOperator.Combiner}" SelectedItem="{Binding Path=Combiner}" />
</Grid>
</DataTemplate>
The purpose of this is you designed a class called "FilterComponent" which has properties:
Column, Operator, FilterValue and Combiner, which together make up a section of the filter.
You then use a template selector / a style on the list which applies this data template when a row is selected (no point having all the controls displayed if it is view mode not edit).
On your view model, you have a property that is an observable collection of "FilterComponents" which make up your filter. This observable collection acts as the items source for the listview/listbox.
You also need properties/enums etc to apply as the items sources on the datatemplate.
Hopefully that should help point you in the right direction. :-)