Click here to Skip to main content
15,880,651 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys and girls, I have the following code

XML
<Button Command="{Binding ResetAll}"  Style="{StaticResource GlassButtonBlue}"  Width="65" Height="65" Canvas.Left="347">
                 <Button.Content>
                     <Image Source="/MainHub;component/Images/Update.png" IsHitTestVisible="False"/>
                 </Button.Content>
                 <Button.Triggers>
                     <EventTrigger RoutedEvent="LostMouseCapture">
                         <BeginStoryboard Storyboard="{StaticResource Reverse_ClickTwice}"/>
                     </EventTrigger>
                 </Button.Triggers>
             </Button>



which just moves some buttons around on my screen and hides the current one. However, the command of the current button does not always fire. Sometimes the animation happens, but neither a click event or a command is fired when the button is clicked. Can anyone tell me why this would happen? I've been told it could be because of the order of events that fire but i'm not sure.

Thanks!
Posted
Updated 26-Mar-13 20:05pm
v3

1 solution

Found it ! :) changed the event of the trigger to '
LostMouseCapture
' so that the command fires first and then the storyboard executes.

XML
<Button.Triggers>
   <EventTrigger RoutedEvent="LostMouseCapture">
      <BeginStoryboard Storyboard="{StaticResource SingleClick}"/>                          
   </EventTrigger>
</Button.Triggers>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900