Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot pass CommandParameter and EventArguments into a Command for the InvokeCommandAction class #175

Open
anose001 opened this issue Aug 22, 2024 · 0 comments

Comments

@anose001
Copy link

anose001 commented Aug 22, 2024

Currently it is not possible to pass EventArguments and CommandParameter into the InvokeCommandAction class.

For example, I would like to implement PointerWheelChanged event to command pass a CommandParameter and EventArguments via the below snippet.

      <Interaction.Behaviors>
        <EventTriggerBehavior EventName="PointerWheelChanged"
                              SourceObject="{Binding #BorderControl}">
          <InvokeCommandAction Command="{Binding ZoomCommand}"
                               PassEventArgsToCommand="True"
                               InputConverter="{StaticResource TupleConverter2}"
                               InputConverterParameter="{Binding ElementName=MyCustomControl}">
            <InvokeCommandAction.CommandParameter>
              <MultiBinding>
                <Binding ElementName="MyCustomControl"/>
              </MultiBinding>
            </InvokeCommandAction.CommandParameter>
          </InvokeCommandAction>
        </EventTriggerBehavior>
      </Interaction.Behaviors>

So when the PointerWheelChanged is fired I would like to pass its EventArgs via PassEventArgsToCommand="True" (this currently works). However, passing additional CommandParameters on top of that does not work. According to the InvokeCommandAction.cs

https://github.com/AvaloniaUI/Avalonia.Xaml.Behaviors/blob/d62d2aa68e3943b26b8f33cc120f2e8cc707e038/src/Avalonia.Xaml.Interactions/Core/InvokeCommandAction.cs#L122C5-L159C21

the EventArgs are only passed to the command if no CommandParameter is set. However, I would like to pass it on top of that. Is it possible to implement this or send a PullRequest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant