views:

795

answers:

1

Strange happenings in WPF... When I set the event to MouseUp I can get it to fire when I right-click the button. But this won't fire with either click!

               <Button MouseLeftButtonUp="btnNewConfig_MouseUp"  Name="btnNewConfig">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="Icons\new.ico" Height="24" Width="24" Margin="5"/>
                        <TextBlock VerticalAlignment="Center">New</TextBlock>
                    </StackPanel>
                </Button>

I know this is most likely something simple. Thanks for the help!

+5  A: 

Looks like Button control is eating up that event Since Button.Click is actually a combination of LeftButtonDown event and LeftButtonUp event.

But you can subscribe to the Tunnelled event PreviewMouseLeftButtonUp on the Button to get LeftButtonUp

Jobi Joy
Why thank you. I knew it had to be something easy as pie.
Adam Driscoll