0

Today I have changed all my interaction triggers from http://schemas.microsoft.com/expression/2010/interactivity to http //schemas.microsoft.com/xaml/behaviors. Now my problem is, that no selectionChanged event was firing in the view model. My datasource is the view model.

My code:

<ComboBox Name="CBGL" ItemsSource="{Binding Path=Troughs}" 
          DisplayMemberPath="TroughNumber"  SelectedValuePath="Id" 
          SelectedValue="{Binding Model.Trough}" Width="173">
     <i:Interaction.Triggers>
          <i:EventTrigger EventName="SelectionChanged">
               <i:InvokeCommandAction  Command="{Binding CBGLRegionChangedCmd}" />
          </i:EventTrigger>
     </i:Interaction.Triggers>

If someone changes the selection, CBGLRegionChangedCmd is not firing.

The code from the view model:

CBGLRegionChangedCmd = new MyICommand(InvokeCommandAction_Changed);

If I undo the update all is working fine...

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
freudi
  • 53
  • 1
  • 4
  • Any of these answers help? https://stackoverflow.com/questions/20743961/the-name-interaction-does-not-exist-in-the-namespace-http-schemas-microsoft – Leandro Nov 14 '21 at 15:15

1 Answers1

0

You must added ViewModel to this question for best answer. but i think your binding in SelectedValue="{Binding Model.Trough}" is wrong please define a property full inside viewmodel with type Trough and xxx name then call inside it a notifyPropertyChange() method then set SelectedItem="{Binding xxx,UpdateSourceTrigger=PropertyChanged}"

alse you can set a property full inside viewmodel of type int with name yyy and bind it to SelectedValue property for example: SelectedValue="{Binding yyy,UpdateSourceTrigger=PropertyChanged}"