seanmet
Topic Author
Posts: 8
Joined: 19 Jun 2024, 10:01

Mouse left button events (bug?)

06 Aug 2024, 10:51

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 :)
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: Mouse left button events (bug?)

06 Aug 2024, 11:07

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.

Who is online

Users browsing this forum: Bing [Bot] and 2 guests