locked
Events verses Property Animation? (Nidonocu) - 5/8/2007 7:56 PM PST RRS feed

  • Question

  • By: Nidonocu

    Hi, I've been using the Expression Blend Beta to help me create the WPF UI 
    for my application. Though I've been having some issues recently learning how 
    animation works.
    
    After creating a simple 'close button' template with a border control 
    containing a path (the X), I set up an 'IsMouseOver' property trigger to 
    transform the path up and to the left by a small distance. This worked fine. 
    I then created the reverse animation (transform back to 0, 0) and set them to 
    the activated and deactivated parts of the property trigger.
    I then created an 'IsPressed' animation to then move the path down 
    vertically, without changing its horizontal transform. Again, created its 
    reverse animation (transform back to postion set in IsMouseOver's activation 
    animation) and set that to the correct parts of that property trigger.
    
    When testing though, I found that all the animations worked correctly until 
    I had pressed the button at least once. Then the IsMouseOver deactivation 
    would not run ever again. But the IsPressed animation would continue to work 
    if I clicked again.
    
    Eventually I got around this by using event triggers with MouseEnter, Leave, 
    Down and Up, but it does mean that the button's cancel ability isn't clearly 
    shown (clicking and holding, then dragging off the button to cancel the 
    click, the IsPressed state would flick back to False at that point to let the 
    user know the click was cancelled).
    
    Why was the IsPressed animation killing the IsMouseOver and how can I fix 
    this?
    -- 
    Nidonocu  C:\>
    
    Tuesday, February 19, 2008 11:17 PM