1

I have 8 ComboBoxes in a Grid. Each ComboBox should trigger my SelectionChangedCommand (binded with Interaction.Triggers). Now I don't want to bind to every ComboBox the same Command. How Can I bubble the Event in the Tree?

Below is my CommandBinding. I don't want to do this 7 times more.

Thanks

<ComboBox Grid.Row="4" Grid.Column="4" IsEditable="False" Margin="10"
        ItemsSource="{Binding Source={x:Type sharedEnums:AxisNames}, Converter={StaticResource EnumToArrayConverter}}"
        SelectedValue="{Binding Path=TeachAxis[7].AxisName}" Style="{StaticResource ComboBoxStyle}" >
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="SelectionChanged">
            <i:InvokeCommandAction Command="{Binding SelectionChangedCommand}"/>
        </i:EventTrigger>
    </i:Interaction.Triggers>
    <ComboBox.ItemTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding Converter={StaticResource EnumToDisplayTextConverter}}" />
        </DataTemplate>
    </ComboBox.ItemTemplate>
</ComboBox>
ProgrammingLlama
  • 36,677
  • 7
  • 67
  • 86
Timo M.
  • 25
  • 2
  • [This answer](https://stackoverflow.com/a/22322742/1136211) may be helpful. If you're not forced to use a command, you may have an EventSetter for the SelectionChanged event in a Style. – Clemens Dec 14 '17 at 07:12

0 Answers0