Page 1 of 1

right click on buttons

Posted: 02 Jun 2022, 18:15
by simonb
Hi

I'm trying to implement mouse right click functionality for a Button element
it works fine in Blend with:
		<Button.InputBindings>
                    <MouseBinding
                        Command="{Binding RightClickToRemoveItem}"
                        CommandParameter="Item1"
                        Gesture="RightClick" />
                </Button.InputBindings>
But in Unity the bound function in the viewmodel does not get hit if I run it under the debugger

Does NG support the "RightClick" Gesture?

Re: right click on buttons

Posted: 06 Jun 2022, 16:10
by sfernandez
MouseBinding is still not implemented in Noesis: #1161. I'm gonna include it for the next release.

In the meantime you can use an interactivity EventTrigger to invoke a command in the same way:
<Button>
  <b:Interaction.Triggers>
    <b:EventTrigger EventName="MouseRightButtonDown">
      <b:InvokeCommandAction Command="{Binding RightClickRemoveItem}" CommandParameter="Item1"/>
    </b:EventTrigger>
  </b:Interaction.Triggers>
</Button>

Re: right click on buttons

Posted: 13 Jun 2022, 10:52
by simonb
great thanks for the work around & update