Page 1 of 1

Mouse left button events (bug?)

Posted: 06 Aug 2024, 10:51
by seanmet
Hello, i've encountered a weird issue and im not quite sure if its a problem with my code or maybe some bug.

When i have some component, a noesis button for example, and i try to catch events on the button with interaction triggers, like so:
            <Button Style="{StaticResource TransparentButtonStyle}" Width="85" Height="85" Canvas.Left="0" Canvas.Top="0">
                <b:Interaction.Triggers>
                    <b:EventTrigger EventName="MouseLeftButtonDown">
                        <b:InvokeCommandAction Command="{Binding UpButtonCommand}" PassEventArgsToCommand="True"/>
                    </b:EventTrigger>
                </b:Interaction.Triggers>
            </Button>
it doesnt work for the left click event, but for all of the other events listed in the documentation it does work(including the same event but with right click).

It also *does* work for the "Click" event.. so im wondering if maybe just this "MouseLeftButtonDown" event might be not working correctly?

Thanks a lot in advance :)

Re: Mouse left button events (bug?)

Posted: 06 Aug 2024, 11:07
by sfernandez
The Button handles mouse events (MouseLeftButtonDown, MouseLeftButtonUp and MouseMove) to implement its own logic (to generate the Click event and update the IsPressed property). You can hook to the Preview version of those events if you need to do something extra.