AvaloniaUI / Avalonia.Xaml.Behaviors

Port of Windows UWP Xaml Behaviors for Avalonia Xaml.
MIT License
390 stars 46 forks source link

EventTriggerBehavior for CellPointerPressed is invoked with a null parameter #90

Closed Deinonychus71 closed 2 years ago

Deinonychus71 commented 2 years ago

Hello, I'm having an issue with an event of type CellPointerPressed here:

<DataGrid SelectedItem="{Binding SelectedBgmEntry, Mode=TwoWay}" Items="{Binding Items, Mode=OneWay}">
        <i:Interaction.Behaviors>
          <ia:EventTriggerBehavior EventName="CellPointerPressed">
            <ia:InvokeCommandAction Command="{Binding ActionReorderBgm}"/>
          </ia:EventTriggerBehavior>
        </i:Interaction.Behaviors>
[...]
</DataGrid>

which always invoke a null DataGridCellPointerPressedEventArgs

ActionReorderBgm = ReactiveCommand.Create<DataGridCellPointerPressedEventArgs>(ReorderBgm);

Here 'e' is always null:

public async void ReorderBgm(DataGridCellPointerPressedEventArgs e) {
   if (e == null || e.Column.DisplayIndex != 0)
       return;
}

This same code works fine in version 0.10.11-rc.1, it only started since 0.10.11.

Was there a breaking change of some sort in between? Thanks!

wieslawsoltes commented 2 years ago

Set PassEventArgsToCommand="True" on InvokeCommandAction