<xcdg:Column.CellEditor>
<!-- ForeignKey CellEditor -->
<xcdg:CellEditor >
<xcdg:CellEditor.EditTemplate>
<DataTemplate>
<DataTemplate.Resources>
<xcdg:NullToBooleanConverter x:Key="nullToBooleanConverter" />
</DataTemplate.Resources>
<ListBox x:Name="fkListBox"
xcdg:Cell.IsCellFocusScope="True"
ItemTemplate="{Binding RelativeSource={RelativeSource Self},
Path=(xcdg:Cell.CellEditorContext).ParentColumn.CellContentTemplate, Mode=OneWay}"
ItemContainerStyle="{Binding RelativeSource={RelativeSource Self},
Path=(xcdg:Cell.CellEditorContext).ForeignKeyConfiguration.ItemContainerStyle, Mode=OneWay}"
ItemsSource="{Binding RelativeSource={RelativeSource Self},
Path=(xcdg:Cell.CellEditorContext).ForeignKeyConfiguration.ItemsSource, Mode=OneWay}"
SelectedValuePath="{Binding RelativeSource={RelativeSource Self},
Path=(xcdg:Cell.CellEditorContext).ForeignKeyConfiguration.ValuePath, Mode=OneWay}"
DisplayMemberPath="{Binding RelativeSource={RelativeSource Self},
Path=(xcdg:Cell.CellEditorContext).ForeignKeyConfiguration.DisplayMemberPath, Mode=OneWay}"
SelectedValue="{xcdg:CellEditorBinding}" />
<!-- Only affect Selector if Template or Style is null -->
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},
Path=(xcdg:Cell.CellEditorContext).ParentColumn.CellContentTemplate,
Converter={StaticResource nullToBooleanConverter},
Mode=OneWay}"
Value="True">
<Setter TargetName="fkListBox"
Property="ItemTemplateSelector"
Value="{Binding RelativeSource={RelativeSource Self},
Path=(xcdg:Cell.CellEditorContext).ParentColumn.CellContentTemplateSelector,
Mode=OneWay}" />
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},
Path=(xcdg:Cell.CellEditorContext).ForeignKeyConfiguration.ItemContainerStyle,
Converter={StaticResource nullToBooleanConverter},
Mode=OneWay}"
Value="True">
<Setter TargetName="fkListBox"
Property="ItemContainerStyleSelector"
Value="{Binding RelativeSource={RelativeSource Self},
Path=(xcdg:Cell.CellEditorContext).ForeignKeyConfiguration.ItemContainerStyleSelector,
Mode=OneWay}" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</xcdg:CellEditor.EditTemplate>
</xcdg:CellEditor>
</xcdg:Column.CellEditor>